> ## 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 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

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

**1. Install Ollama**

Install [Ollama](https://ollama.com/download), then pull the model:

```bash theme={null}
ollama pull mxbai-embed-large
```

**2. Install dependencies**

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

**3. Run the example**

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

## Developer Resources

* [OllamaEmbedder reference](https://agno-v2.mintlify.site/reference/knowledge/embedder/ollama.md)
* [Ollama embeddings](https://docs.ollama.com/capabilities/embeddings)
* [Embedders overview](https://agno-v2.mintlify.site/knowledge/concepts/embedder/overview.md)


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