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

# Get Started with Agno

> Learn how to use Cerebras models in Agno for building AI agents with high-speed, low-latency inference.

[Cerebras Inference](/introduction) provides high-speed, low-latency AI model inference powered by Cerebras Wafer-Scale Engines and CS-3 systems. Agno integrates directly with the Cerebras Python SDK, allowing you to use state-of-the-art models with a simple interface.

Agno is an open-source framework for building AI agents and agentic systems, designed for performance and simplicity.

## Prerequisites

To use Cerebras with Agno, you need to:

1. **Install the required packages:**
   ```bash theme={null}
   pip install cerebras-cloud-sdk agno
   ```

2. **Set your API key:**
   The Cerebras SDK expects your API key to be available as an environment variable:
   ```bash theme={null}
   export CEREBRAS_API_KEY=your_api_key_here
   ```

## Basic Usage

Here's how to use a Cerebras model with Agno:

```python theme={null}
from agno.agent import Agent
from agno.models.cerebras import Cerebras

agent = Agent(
    model=Cerebras(
        id="gpt-oss-120b",
        default_headers={"X-Cerebras-3rd-Party-Integration": "agno"}
    ),
    markdown=True,
)

# Print the response in the terminal
agent.print_response("write a two sentence horror story")
```

## Supported Models

Cerebras currently supports a variety of production models (see [docs](/models) for the latest list).

## Configuration Options

The `Cerebras` class accepts the following parameters:

| Parameter        | Type                       | Description                                        | Default      |
| :--------------- | :------------------------- | :------------------------------------------------- | :----------- |
| `id`             | str                        | Model identifier (e.g., "gpt-oss-120b")            | **Required** |
| `name`           | str                        | Display name for the model                         | "Cerebras"   |
| `provider`       | str                        | Provider name                                      | "Cerebras"   |
| `api_key`        | Optional\[str]             | API key (falls back to `CEREBRAS_API_KEY` env var) | None         |
| `temperature`    | float                      | Sampling temperature                               | 0.7          |
| `top_p`          | float                      | Top-p sampling value                               | 1.0          |
| `request_params` | Optional\[Dict\[str, Any]] | Additional request parameters                      | None         |

### Example with Custom Parameters

```python theme={null}
from agno.agent import Agent
from agno.models.cerebras import Cerebras

agent = Agent(
    model=Cerebras(
        id="gpt-oss-120b",
        temperature=0.7,
        default_headers={"X-Cerebras-3rd-Party-Integration": "agno"}
    ),
    markdown=True
)

agent.print_response("Explain quantum computing in simple terms")
```

## Resources

* [Cerebras Inference Documentation](/introduction)
* [Cerebras API Reference](/api-reference/chat-completions)
* [Agno Documentation](https://docs.agno.com/?utm_source=cerebras\&utm_campaign=agno)
* [Agno GitHub Repository](https://github.com/agno-agi/agno/?utm_source=cerebras\&utm_campaign=agno)
* [Migrate to GLM4.7](https://inference-docs.cerebras.ai/resources/glm-47-migration)

## FAQ

<Accordion title="What makes Cerebras different for Agno agents?">
  Cerebras provides ultra-fast inference speeds (up to \~3000 tokens/second) powered by Wafer-Scale Engines and CS-3 systems. This makes your Agno agents significantly more responsive compared to traditional GPU-based inference, enabling real-time conversational experiences and rapid agent workflows.
</Accordion>

<Accordion title="Can I use streaming with Cerebras models in Agno?">
  Yes! Cerebras models support streaming responses. You can enable streaming by setting `stream=True` when creating your agent, or use the `agent.print_response()` method which automatically streams output to the terminal.
</Accordion>

<Accordion title="Which Cerebras model should I choose for my agent?">
  * **gpt-oss-120b**: Large open-source model for diverse applications with highest speed
  * **zai-glm-4.7**: Advanced 357B parameter model with strong reasoning capabilities
</Accordion>

## Troubleshooting

<Accordion title="Import errors with Cerebras SDK">
  If you encounter import errors:

  1. Make sure the Cerebras SDK is installed: `pip install cerebras-cloud-sdk --upgrade`
  2. Verify you're using Python 3.10 or higher: `python --version`
  3. Try creating a fresh virtual environment and reinstalling:
     ```bash theme={null}
     python -m venv venv
     source venv/bin/activate  # On Windows: venv\Scripts\activate
     pip install cerebras-cloud-sdk
     ```
</Accordion>

<Accordion title="API key not found">
  If you see API key errors:

  1. Verify your API key is set as an environment variable: `echo $CEREBRAS_API_KEY`
  2. Ensure the variable is exported in your current shell session
  3. Alternatively, pass the API key directly to the model:
     ```python theme={null}
     from agno.models.cerebras import Cerebras

     model = Cerebras(
         id="gpt-oss-120b",
         api_key="your-api-key",
         request_params={"extra_headers": {"X-Cerebras-3rd-Party-Integration": "agno"}}
     )
     ```
</Accordion>

<Accordion title="Model not found errors">
  If you see model not found errors:

  1. Verify the model ID matches one of the supported models: `gpt-oss-120b`, `gpt-oss-120b`, or `zai-glm-4.7`
  2. Check that your API key has access to the requested model
  3. Review the [available models documentation](/models) for the latest model list
</Accordion>
