> ## Documentation Index
> Fetch the complete documentation index at: https://agno-v2.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Ollama Demo Gemma

> Stream a short story about a local image from Gemma 3 12B running on Ollama.

```python demo_gemma.py theme={null}
"""
Ollama Demo Gemma
=================

Cookbook example for `ollama/chat/demo_gemma.py`.
"""

from pathlib import Path

from agno.agent import Agent
from agno.media import Image
from agno.models.ollama import Ollama

# ---------------------------------------------------------------------------
# Create Agent
# ---------------------------------------------------------------------------

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,
)

# ---------------------------------------------------------------------------
# Run Agent
# ---------------------------------------------------------------------------

if __name__ == "__main__":
    pass
```

## Run the Example

<Snippet file="create-venv-step.mdx" />

**1. Install dependencies**

```bash theme={null}
uv pip install -U agno ollama
```

**2. Prepare Ollama**

Install and start Ollama, then pull the model used by this example:

```bash theme={null}
ollama pull gemma3:12b
```

**3. Add the sample image**

Place an image named `super-agents.png` in the same directory as the script, or update `image_path` to point to your own image.

**4. Run the example**

Save the code above as `demo_gemma.py`, then run:

```bash theme={null}
python demo_gemma.py
```

Full source: [cookbook/90\_models/ollama/chat/demo\_gemma.py](https://github.com/agno-agi/agno/blob/v3.0.4/cookbook/90_models/ollama/chat/demo_gemma.py)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.