Code
cookbook/11_models/ollama/demo_gemma.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 pathlib import Path
from agno.agent import Agent
from agno.media import Image
from agno.models.ollama import Ollama
agent = Agent(model=Ollama(id="gemma3:12b"), markdown=True)
image_path = Path(__file__).parent.joinpath("super-agents.png")
agent.print_response(
"Write a 3 sentence fiction story about the image",
images=[Image(filepath=image_path)],
stream=True,
)
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 gemma3:12b
Install dependencies
uv pip install -U ollama agno
Run Agent
python cookbook/11_models/ollama/demo_gemma.py
Was this page helpful?