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

# Cerebras

> LLM service implementation using Cerebras's API with OpenAI-compatible interface

## Overview

`CerebrasLLMService` provides access to Cerebras's language models through an OpenAI-compatible interface. It inherits from `OpenAILLMService` and supports streaming responses, function calling, and context management with ultra-fast inference speeds.

<CardGroup cols={2}>
  <Card title="Cerebras LLM API Reference" icon="code" href="https://reference-server.pipecat.ai/en/latest/api/pipecat.services.cerebras.llm.html">
    Pipecat's API methods for Cerebras integration
  </Card>

  <Card title="Example Implementation" icon="play" href="https://github.com/pipecat-ai/pipecat/blob/main/examples/function-calling/function-calling-cerebras.py">
    Complete example with function calling
  </Card>

  <Card title="Cerebras Documentation" icon="book" href="https://inference-docs.cerebras.ai/api-reference/chat-completions">
    Official Cerebras inference API documentation
  </Card>

  <Card title="Cerebras Platform" icon="microphone" href="https://cloud.cerebras.ai/">
    Access models and manage API keys
  </Card>
</CardGroup>

## Installation

To use Cerebras services, install the required dependency:

```bash theme={null}
uv add "pipecat-ai[cerebras]"
```

## Prerequisites

### Cerebras Account Setup

Before using Cerebras LLM services, you need:

1. **Cerebras Account**: Sign up at [Cerebras Cloud](https://cloud.cerebras.ai/)
2. **API Key**: Generate an API key from your account dashboard
3. **Model Selection**: Choose from available Cerebras models with ultra-fast inference

### Required Environment Variables

* `CEREBRAS_API_KEY`: Your Cerebras API key for authentication

## Configuration

<ParamField path="api_key" type="str" required>
  Cerebras API key for authentication.
</ParamField>

<ParamField path="base_url" type="str" default="https://api.cerebras.ai/v1">
  Base URL for Cerebras API endpoint.
</ParamField>

<ParamField path="model" type="str" default="None" deprecated>
  Model identifier to use.

  *Deprecated in v0.0.105. Use `settings=CerebrasLLMService.Settings(model=...)` instead.*
</ParamField>

<ParamField path="settings" type="CerebrasLLMService.Settings" default="None">
  Runtime-configurable settings. See [Settings](#settings) below.
</ParamField>

### Settings

Runtime-configurable settings passed via the `settings` constructor argument using `CerebrasLLMService.Settings(...)`. These can be updated mid-conversation with `LLMUpdateSettingsFrame`. See [Service Settings](/pipecat/fundamentals/service-settings) for details.

This service uses the same settings as `OpenAILLMService`. See [OpenAI LLM Settings](/api-reference/server/services/llm/openai#settings) for the full parameter reference.

## Usage

### Basic Setup

```python theme={null}
import os
from pipecat.services.cerebras import CerebrasLLMService

llm = CerebrasLLMService(
    api_key=os.getenv("CEREBRAS_API_KEY"),
    model="gpt-oss-120b",
)
```

### With Custom Settings

```python theme={null}
from pipecat.services.cerebras import CerebrasLLMService

llm = CerebrasLLMService(
    api_key=os.getenv("CEREBRAS_API_KEY"),
    settings=CerebrasLLMService.Settings(
        model="gpt-oss-120b",
        temperature=0.7,
        top_p=0.9,
        max_completion_tokens=1024,
    ),
)
```

## Notes

* Cerebras supports a subset of OpenAI parameters. Advanced parameters like `frequency_penalty` and `presence_penalty` are not passed to the API.
* Cerebras is known for ultra-fast inference speeds on supported models.

<Tip>
  The `InputParams` / `params=` pattern is deprecated as of v0.0.105. Use
  `Settings` / `settings=` instead. See the [Service Settings
  guide](/pipecat/fundamentals/service-settings) for migration details.
</Tip>
