oss_gpt.py
Run the Example
1
Set up your virtual environment
2
Install dependencies
3
Export your Cerebras API key
4
Run the example
Save the code above as
oss_gpt.py, then run:Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
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__":
pass
Set up your virtual environment
uv venv --python 3.12
source .venv/bin/activate
uv venv --python 3.12
.venv\Scripts\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"
$Env:CEREBRAS_API_KEY="your_cerebras_api_key_here"
Run the example
oss_gpt.py, then run:python oss_gpt.py
Was this page helpful?