Skip to main content
1

Create a Python file

touch groq_plus_claude.py
2

Add the following code to your Python file

groq_plus_claude.py
from agno.agent import Agent
from agno.models.anthropic import Claude
from agno.models.groq import Groq

reasoning_agent = Agent(
    model=Claude(id="claude-3-7-sonnet-20250219"),
    reasoning_model=Groq(
        id="deepseek-r1-distill-llama-70b", temperature=0.6, max_tokens=1024, top_p=0.95
    ),
)
reasoning_agent.print_response("9.11 and 9.9 -- which is bigger?", stream=True)
3

Create a virtual environment

Open the Terminal and create a python virtual environment.
python3 -m venv .venv
source .venv/bin/activate
4

Install libraries

pip install -U agno groq anthropic
5

Export your Groq and Anthropic API keys

  export GROQ_API_KEY="your_groq_api_key_here"
  export ANTHROPIC_API_KEY="your_anthropic_api_key_here"
6

Run Agent

python groq_plus_claude.py