Cerebras OSS GPT
Run gpt-oss-120b on Cerebras with web search via WebSearchTools.
"""
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__":
passRun the Example
Set up your virtual environment
uv venv --python 3.12
source .venv/bin/activateInstall dependencies
uv pip install -U agno cerebras-cloud-sdk ddgsExport 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.pyFull source: cookbook/90_models/cerebras/oss_gpt.py