Skip to content

Ollama embedder

Embeds through a local Ollama server using its /api/embed endpoint. Selected via EMBEDDING_PROVIDER=ollama.

Enable it

bash
EMBEDDING_PROVIDER=ollama
OLLAMA_BASE_URL=http://localhost:11434
OLLAMA_EMBEDDING_MODEL=nomic-embed-text
EMBEDDING_DIMS=768

Configuration

VariableDefaultDescription
EMBEDDING_PROVIDERopenaiSet to ollama.
OLLAMA_BASE_URLhttp://localhost:11434Base URL of the Ollama server; a trailing slash is trimmed.
OLLAMA_EMBEDDING_MODELnomic-embed-textModel pulled and served by Ollama.
EMBEDDING_DIMS768Vector dimension; must match the embedding model. Passed through to the embedder.

Notes

  • Runs against a self hosted Ollama server, so there is no API key.
  • Inputs are prefixed for asymmetric retrieval: search_document: on add and update, search_query: on search.
  • Requests use httpx with a 30 second timeout and raise on non 200 responses.

The memory layer for AI agents.