> ## Documentation Index
> Fetch the complete documentation index at: https://agno-v2.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Groq Reasoning Agent

> Pair DeepSeek R1 Distill for reasoning with Llama 3.3 for the final answer.

> [!WARNING]
>
> Groq retired `deepseek-r1-distill-llama-70b` on October 2, 2025. Replace it with `openai/gpt-oss-120b`. See [Groq deprecations](https://console.groq.com/docs/deprecations).

```python reasoning_agent.py theme={null}
"""
Groq Reasoning Agent
====================

Cookbook example for `groq/reasoning_agent.py`.
"""

from agno.agent import Agent
from agno.models.groq import Groq

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

# 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)

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

if __name__ == "__main__":
    pass
```

## Run the Example

<Snippet file="create-venv-step.mdx" />

**1. Install dependencies**

```bash theme={null}
uv pip install -U agno groq
```

**2. Export your Groq API key**

```bash Mac/Linux theme={null}
export GROQ_API_KEY="your_groq_api_key_here"
```

```bash Windows theme={null}
$Env:GROQ_API_KEY="your_groq_api_key_here"
```

**3. Replace DeepSeek R1 Distill**

Replace `deepseek-r1-distill-llama-70b` with `openai/gpt-oss-120b` in the saved file.

**4. Run the example**

Save the code above as `reasoning_agent.py`, then run:

```bash theme={null}
python reasoning_agent.py
```

Full source: [cookbook/90\_models/groq/reasoning\_agent.py](https://github.com/agno-agi/agno/blob/v3.0.4/cookbook/90_models/groq/reasoning_agent.py)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.