feat: add Ollama as local embedding provider - #81
Conversation
Adds OllamaEmbeddingProvider that uses Ollama's /api/embed endpoint. Supports custom base URL, model, and dimensions. Defaults to nomic-embed-text with 768 dimensions. Closes #6
|
Clean implementation — follows the same pattern as OpenAI, batch support via One thought for later: a health check on init (ping Ollama, verify model is pulled) would give users a clear error instead of a cryptic fetch failure. Not blocking though. |
|
Clean implementation — the factory pattern extension is exactly right, and good call using A couple thoughts for follow-up:
Closes #6. Merging. 🎉 |
TerminalGravity
left a comment
There was a problem hiding this comment.
Clean implementation. Batch endpoint usage avoids N+1 round trips — good call.
A few suggestions for follow-up:
- Timeout on fetch calls — if Ollama is down or slow to load a model, the MCP server will hang. Even a 30s timeout + clear error would help.
- Node engine bump — the package-lock bumps to >=20, worth noting since it's technically breaking for anyone on 18.
- Health check — a quick
/api/tagsping would make it easy to surface 'Ollama not running' vs 'model not found' errors.
None block merge. Nice close on #6.
TerminalGravity
left a comment
There was a problem hiding this comment.
Nice and clean. The Ollama provider looks solid — using the batch /api/embed endpoint for both single and batch is smart.
One small thing: if Ollama isn't running, the fetch will throw a connection refused error that'll be hard to debug. Worth wrapping with a friendlier message like "Cannot connect to Ollama at ${this.baseUrl} — is it running?" in a try/catch around the fetch calls.
Also, the node engine bump from >=18 to >=20 in package-lock.json — was that intentional? If so, should match in package.json too. If not, might want to revert that line.
|
Superseded by a newer PR. |
Adds OllamaEmbeddingProvider using Ollama /api/embed endpoint. Fully local, no API key needed. Defaults to nomic-embed-text, 768 dims. Closes #6