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

# Ollama

> Learn how to use Ollama with Agno.

Run Large Language Models locally with Ollama

[Ollama](https://ollama.com) is a fantastic tool for running models locally.

Ollama supports multiple open-source models. See the library [here](https://ollama.com/library).

We recommend experimenting to find the best-suited model for your use-case. Here are some general recommendations:

* `llama3.3` models are good for most basic use-cases.
* `qwen` models perform specifically well with tool use.
* `deepseek-r1` models have strong reasoning capabilities.
* `phi4` models are powerful, while being really small in size.

## Set up a model

Install [ollama](https://ollama.com) and run a model using

```bash run model theme={null}
ollama run llama3.1
```

This gives you an interactive session with the model.

Alternatively, to download the model to be used in an Agno agent

```bash pull model theme={null}
ollama pull llama3.1
```

## Example

After you have the model locally, use the `Ollama` model class to access it

<CodeGroup>
  ```python agent.py theme={null}
  from agno.agent import Agent, RunResponse
  from agno.models.ollama import Ollama

  agent = Agent(
      model=Ollama(id="llama3.1"),
      markdown=True
  )

  # Print the response in the terminal
  agent.print_response("Share a 2 sentence horror story.")
  ```
</CodeGroup>

<Note> View more examples [here](../examples/models/ollama). </Note>

## Params

<Snippet file="model-ollama-params.mdx" />

`Ollama` is a subclass of the [Model](/reference/models/model) class and has access to the same params.
