Groq DeepSeek R1

Add the following code to your Python file

1from kern.agent import Agent
2from kern.models.groq import Groq
3
4agent = Agent(
5 model=Groq(
6 id="deepseek-r1-distill-llama-70b", temperature=0.6, max_tokens=1024, top_p=0.95
7 ),
8 markdown=True,
9)
10agent.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

Export your Groq API key

1export GROQ_API_KEY="your_groq_api_key_here"
1$Env:GROQ_API_KEY="your_groq_api_key_here"

Run Agent

1python groq.py