Code
reasoning_agent.py
Usage
1
Set up your virtual environment
2
Set your API key
3
Install dependencies
4
Run Agent
Save the code above as
reasoning_agent.py, then run:Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
Pair a Groq reasoning model with a Groq response model to answer step by step.
from agno.agent import Agent
from agno.models.groq import Groq
# Create a reasoning agent that uses:
# - `deepseek-r1-distill-llama-70b` as the reasoning model
# - `openai/gpt-oss-120b` to generate the final response
reasoning_agent = Agent(
model=Groq(id="openai/gpt-oss-120b"),
reasoning_model=Groq(
id="deepseek-r1-distill-llama-70b", temperature=0.6, max_tokens=1024, top_p=0.95
),
)
# Prompt the agent to solve the problem
reasoning_agent.print_response("Is 9.11 bigger or 9.9?", stream=True)
Set up your virtual environment
uv venv --python 3.12
source .venv/bin/activate
uv venv --python 3.12
.venv\Scripts\activate
Set your API key
export GROQ_API_KEY=xxx
Install dependencies
uv pip install -U groq agno
Run Agent
reasoning_agent.py, then run:python reasoning_agent.py
Was this page helpful?