> ## Documentation Index
> Fetch the complete documentation index at: https://phidatainc.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

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

  <Step title="Install dependencies">
    ```bash theme={null}
    uv pip install -U agno ollama
    ```
  </Step>

  <Step title="Prepare Ollama">
    Install and start Ollama, then pull the model used by this example:

    ```bash theme={null}
    ollama pull gemma3:12b
    ```
  </Step>

  <Step title="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.
  </Step>

  <Step title="Run the example">
    Save the code above as `demo_gemma.py`, then run:

    ```bash theme={null}
    python demo_gemma.py
    ```
  </Step>
</Steps>

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