Skip to main content
Cerebras Inference 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:
  2. Set your API key: The Cerebras SDK expects your API key to be available as an environment variable:

Basic Usage

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

Supported Models

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

Configuration Options

The Cerebras class accepts the following parameters:

Example with Custom Parameters

Resources

FAQ

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.
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.
  • 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

Troubleshooting

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:
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:
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 for the latest model list