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

# Ollama Embedder

> Generate embeddings with OllamaEmbedder and an explicit local embedding model.

`OllamaEmbedder` connects to an Ollama server. Set `id` and `dimensions` to match the model served by Ollama.

```python ollama_embedder.py theme={null}
from agno.knowledge.embedder.ollama import OllamaEmbedder

embedder = OllamaEmbedder(
    id="mxbai-embed-large",
    dimensions=1024,
)

embedding = embedder.get_embedding("The quick brown fox jumps over the lazy dog.")

print(embedding[:5])
print(len(embedding))
```

## Run the Example

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

  <Step title="Install Ollama">
    Install [Ollama](https://ollama.com/download), then pull the model:

    ```bash theme={null}
    ollama pull mxbai-embed-large
    ```
  </Step>

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

  <Step title="Run the example">
    ```bash theme={null}
    python ollama_embedder.py
    ```
  </Step>
</Steps>

## Developer Resources

* [OllamaEmbedder reference](/reference/knowledge/embedder/ollama)
* [Ollama embeddings](https://docs.ollama.com/capabilities/embeddings)
* [Embedders overview](/knowledge/concepts/embedder/overview)
