Groq Claude + DeepSeek R1

Add the following code to your Python file

1from kern.agent import Agent
2from kern.models.anthropic import Claude
3from kern.models.groq import Groq
4
5reasoning_agent = Agent(
6 model=Claude(id="claude-sonnet-4-5"),
7 reasoning_model=Groq(
8 id="deepseek-r1-distill-llama-70b", temperature=0.6, max_tokens=1024, top_p=0.95
9 ),
10)
11reasoning_agent.print_response("9.11 and 9.9 -- which is bigger?", stream=True)

Set up your virtual environment

1uv venv --python 3.12
2source .venv/bin/activate
1uv venv --python 3.12
2.venv\Scripts\activate

Install dependencies

1uv pip install -U kern-ai groq anthropic

Export your Groq and Anthropic API keys

1export GROQ_API_KEY="your_groq_api_key_here"
2 export ANTHROPIC_API_KEY="your_anthropic_api_key_here"
1$Env:GROQ_API_KEY="your_groq_api_key_here"
2$Env:ANTHROPIC_API_KEY="your_anthropic_api_key_here"

Run Agent

1python groq_plus_claude.py