Ollama

no

Original Documentation

Documentation Index#

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

Chroma provides a convenient wrapper around Ollama’s embeddings API. You can use the OllamaEmbeddingFunction embedding function to generate embeddings for your documents with a model of your choice.

from chromadb.utils.embedding_functions.ollama_embedding_function import (
    OllamaEmbeddingFunction,
)

ollama_ef = OllamaEmbeddingFunction(
    url="http://localhost:11434",
    model_name="llama2",
)

embeddings = ollama_ef(["This is my first text to embed",
                        "This is my second document"])
// npm install @chroma-core/ollama

import { OllamaEmbeddingFunction } from "@chroma-core/ollama";
const embedder = new OllamaEmbeddingFunction({
    url: "http://127.0.0.1:11434/",
    model: "llama2"
})

// use directly
const embeddings = embedder.generate(["document1", "document2"])

// pass documents to query for .add and .query
let collection = await client.createCollection({
    name: "name",
    embeddingFunction: embedder
})
collection = await client.getCollection({
    name: "name",
    embeddingFunction: embedder
})
Link last verified June 7, 2026. View original ↗
Source: Chroma Docs
Link last verified: 2026-03-04