Copy
Ask AI
"""
Ollama Demo Deepseek R1
=======================
Cookbook example for `ollama/chat/demo_deepseek_r1.py`.
"""
from agno.agent import Agent, RunOutput # noqa
from agno.models.ollama import Ollama
# ---------------------------------------------------------------------------
# Create Agent
# ---------------------------------------------------------------------------
agent = Agent(model=Ollama(id="deepseek-r1:14b"), markdown=True)
# Print the response in the terminal
agent.print_response(
"Write me python code to solve quadratic equations. Explain your reasoning."
)
# ---------------------------------------------------------------------------
# Run Agent
# ---------------------------------------------------------------------------
if __name__ == "__main__":
pass
Run the Example
Copy
Ask AI
# Clone and setup repo
git clone https://github.com/agno-agi/agno.git
cd agno/cookbook/90_models/ollama/chat
# Create and activate virtual environment
./scripts/demo_setup.sh
source .venvs/demo/bin/activate
python demo_deepseek_r1.py