Demo DeepSeek Qwen
Use Qwen3.6 on Groq for a separate reasoning stage and final response.
Groq retired the source's Qwen-2.5-32b model in April 2025. Replace it with qwen/qwen3.6-27b. Groq retired the source's Deepseek-r1-distill-qwen-32b model in April 2025. Replace it with qwen/qwen3.6-27b. See Groq deprecations.
"""Run `uv pip install ddgs sqlalchemy pgvector pypdf openai groq` to install dependencies."""
from agno.agent import Agent
from agno.models.groq import Groq
# ---------------------------------------------------------------------------
# Create Agent
# ---------------------------------------------------------------------------
agent_with_reasoning = Agent(
model=Groq(id="Qwen-2.5-32b"),
reasoning_model=Groq(
id="Deepseek-r1-distill-qwen-32b", temperature=0.6, max_tokens=1024, top_p=0.95
),
)
agent_with_reasoning.print_response("9.11 and 9.9 -- which is bigger?", markdown=True)
# ---------------------------------------------------------------------------
# Run Agent
# ---------------------------------------------------------------------------
if __name__ == "__main__":
passWith the substitutions below, Agno runs the separate reasoning_model stage before the final model call. This adapter uses the first stage's answer text, or text inside its <think> tags, for that handoff; the current Groq response parser does not retain the provider's separate reasoning field.
Run the Example
Set up your virtual environment
uv venv --python 3.12
source .venv/bin/activateInstall dependencies
uv pip install -U agno groqExport your Groq API key
export GROQ_API_KEY="your_groq_api_key_here"Replace Qwen 2.5 32B
Replace Qwen-2.5-32b with qwen/qwen3.6-27b in the saved file.
Replace DeepSeek Qwen Distill
Replace Deepseek-r1-distill-qwen-32b with qwen/qwen3.6-27b in the saved file.
Run the example
Save the code above as demo_deepseek_qwen.py, then run:
python demo_deepseek_qwen.pyFull source: cookbook/90_models/groq/reasoning/demo_deepseek_qwen.py