You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Private, offline embeddings — code never leaves the machine
Model flexibility — users can pick whatever embedding model they've pulled locally (e.g. nomic-embed-text, mxbai-embed-large)
Free — no API costs
What the implementation would look like
Ollama exposes an OpenAI-compatible embeddings endpoint at /api/embed (and /v1/embeddings for the OpenAI-compat layer). The simplest path is probably a thin provider class similar to the existing OpenAIEmbeddingProvider, pointing at http://localhost:11434 by default and reading the host from an env var (e.g. OLLAMA_HOST).
EMBEDDING_PROVIDER=ollama
OLLAMA_HOST=http://localhost:11434 # optional, this would be the default
EMBEDDING_MODEL=nomic-embed-text
The main things to figure out:
Which Ollama API endpoint to use (/api/embed vs /v1/embeddings)
How to handle dimension detection (model-dependent, could query /api/show)
Whether to require the user to have the model already pulled, or surface a clear error
Background
Right now there's a placeholder in the embedding provider code that falls back to Transformers.js when Ollama is selected:
This means setting
EMBEDDING_PROVIDER=ollamadoes nothing useful — you still end up running local Transformers.js inference, which defeats the point.Why this matters
Ollama is the most common way people run local models. Having real Ollama support would mean:
onnxruntime-nodemutex bug on macOS (see Bug Report: Mutex Lock Failed During Indexing on Intel Mac #68) entirely, without needing an OpenAI API keynomic-embed-text,mxbai-embed-large)What the implementation would look like
Ollama exposes an OpenAI-compatible embeddings endpoint at
/api/embed(and/v1/embeddingsfor the OpenAI-compat layer). The simplest path is probably a thin provider class similar to the existingOpenAIEmbeddingProvider, pointing athttp://localhost:11434by default and reading the host from an env var (e.g.OLLAMA_HOST).EMBEDDING_PROVIDER=ollama OLLAMA_HOST=http://localhost:11434 # optional, this would be the default EMBEDDING_MODEL=nomic-embed-textThe main things to figure out:
/api/embedvs/v1/embeddings)/api/show)Related
OPENAI_BASE_URLsupport, which technically lets you point at Ollama's OpenAI-compat layer as a short-term workaround, but native support would be cleaner