> ## Documentation Index
> Fetch the complete documentation index at: https://docs.zeroruntime.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Cerebras

> JavaScript API reference for the cerebras llm plugin.

## CerebrasLLM

Cerebras large language model provider.

Creates a configured Cerebras LLM provider for use in a voice agent.

### Constructor

```typescript theme={null}
new CerebrasLLM(opts: CerebrasLLMOptions)
```

<ParamField path="apiKey" type="string">
  Cerebras API key. Falls back to the `CEREBRAS_API_KEY` env var.
</ParamField>

<ParamField path="model" type="CerebrasLLMModel | string">
  Model ID. Default: `'llama3.3-70b'`.
</ParamField>

<ParamField path="temperature" type="number">
  Sampling temperature. Default: `0.7`.
</ParamField>

<ParamField path="toolChoice" type="string">
  Tool-selection strategy, e.g. `'auto'`, `'none'`. Default: `'auto'`.
</ParamField>

<ParamField path="maxCompletionTokens" type="number">
  Maximum number of completion tokens to generate. Default: `1024`.
</ParamField>

<ParamField path="topP" type="number">
  Nucleus sampling probability mass. Default: `null`.
</ParamField>

<ParamField path="seed" type="number">
  Sampling seed for reproducible outputs. Default: `null`.
</ParamField>

<ParamField path="stop" type="string">
  Stop sequence. Default: `null`.
</ParamField>

<ParamField path="user" type="string">
  Opaque end-user identifier. Default: `null`.
</ParamField>

### cancelCurrentGeneration

```typescript theme={null}
cancelCurrentGeneration(): Promise<void>
```

Cancel the in-flight generation for the current session, if any.

### chat

```typescript theme={null}
chat(_messages: any, _opts?: LLMChatOptions): AsyncIterator<LLMResponse>
```

Stream a completion for the given messages, yielding LLMResponse chunks.

<ResponseField name="returns" type="AsyncIterator<LLMResponse>" />

### close

```typescript theme={null}
close(): Promise<void>
```

Release any resources held by the provider.

### closeEmitter

```typescript theme={null}
closeEmitter(): Promise<void>
```

Close the emitter: drop all handlers and stop emitting. Waits up to 2 seconds
for in-flight async handlers to settle before returning.

### emit

```typescript theme={null}
emit(event: string, ...args: any[]): void
```

<ParamField path="event" type="string" required />

### getRuntimeConfig

```typescript theme={null}
getRuntimeConfig(): Record<string, any>
```

<ResponseField name="returns" type="Record<string, any>" />

### listenerCount

```typescript theme={null}
listenerCount(event: string): number
```

<ParamField path="event" type="string" required />

<ResponseField name="returns" type="number" />

### off

```typescript theme={null}
off(event: string, handler: EventHandler): void
```

<ParamField path="event" type="string" required />

<ParamField path="handler" type="EventHandler" required />

### on

```typescript theme={null}
on(event: string, handler: EventHandler): EventHandler
```

<ParamField path="event" type="string" required />

<ParamField path="handler" type="EventHandler" required />

<ResponseField name="returns" type="EventHandler" />

### once

```typescript theme={null}
once(event: string, handler: EventHandler): EventHandler
```

<ParamField path="event" type="string" required />

<ParamField path="handler" type="EventHandler" required />

<ResponseField name="returns" type="EventHandler" />

### removeAllListeners

```typescript theme={null}
removeAllListeners(event?: string): void
```

<ParamField path="event" type="string" />

***

## CerebrasLLMModel

```typescript theme={null}
type CerebrasLLMModel = 'gpt-oss-120b' | 'zai-glm-4.7'
```
