Cerebras OSS GPT

Run gpt-oss-120b on Cerebras with web search via WebSearchTools.

oss_gpt.py
"""
Cerebras Oss Gpt
================

Cookbook example for `cerebras/oss_gpt.py`.
"""

from agno.agent.agent import Agent
from agno.models.cerebras.cerebras import Cerebras
from agno.tools.websearch import WebSearchTools

# ---------------------------------------------------------------------------
# Create Agent
# ---------------------------------------------------------------------------

agent = Agent(
    model=Cerebras(
        id="gpt-oss-120b",
    ),
    tools=[WebSearchTools()],
    markdown=True,
)

# Print the response in the terminal
agent.print_response("Whats happening in France?")

# ---------------------------------------------------------------------------
# Run Agent
# ---------------------------------------------------------------------------

if __name__ == "__main__":
    pass

Run the Example

Set up your virtual environment

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

Install dependencies

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

Export your Cerebras API key

export CEREBRAS_API_KEY="your_cerebras_api_key_here"

Run the example

Save the code above as oss_gpt.py, then run:

python oss_gpt.py

Full source: cookbook/90_models/cerebras/oss_gpt.py