Code
cookbook/11_models/ollama/demo_deepseek_r1.py
Usage
1
Set up your virtual environment
2
Install Ollama
Follow the Ollama installation guide and run:
3
Install dependencies
4
Run Agent
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
from agno.agent import Agent, RunOutput # noqa
from agno.models.ollama import Ollama
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."
)
Set up your virtual environment
uv venv --python 3.12
source .venv/bin/activate
uv venv --python 3.12
.venv\Scripts\activate
Install Ollama
ollama pull deepseek-r1:14b
Install dependencies
uv pip install -U ollama agno
Run Agent
python cookbook/11_models/ollama/demo_deepseek_r1.py
Was this page helpful?