Skip to main content

Code

cookbook/11_models/cerebras/basic_stream.py
from agno.agent import Agent  # noqa
from agno.models.cerebras import Cerebras

agent = Agent(
    model=Cerebras(id="llama-4-scout-17b-16e-instruct"),
    markdown=True,
)

# Print the response in the terminal
agent.print_response("write a two sentence horror story", stream=True)

Usage

1

Set up your virtual environment

uv venv --python 3.12
source .venv/bin/activate
2

Set your API key

export CEREBRAS_API_KEY=xxx
3

Install dependencies

uv pip install -U cerebras-cloud-sdk agno
4

Run Agent

python cookbook/11_models/cerebras/basic_stream.py