Skip to content

Commit 0d2ec6c

Browse files
authored
docs: clarify Ollama custom provider setup (#50)
1 parent 9ff4807 commit 0d2ec6c

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

README.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -571,6 +571,10 @@ ollama pull nomic-embed-text
571571
}
572572
```
573573

574+
The built-in `ollama` provider uses Ollama's native `/api/embeddings` endpoint and is the simplest setup when you want to use `nomic-embed-text`.
575+
576+
If you want to use a different Ollama embedding model through its OpenAI-compatible API, use the `custom` provider instead and set `customProvider.baseUrl` to `http://127.0.0.1:11434/v1` so the plugin calls `.../v1/embeddings`.
577+
574578
## 📈 Performance
575579

576580
The plugin is built for speed with a Rust native module (`tree-sitter`, `usearch`, SQLite). In practice, indexing and retrieval remain fast enough for interactive use on medium/large repositories.
@@ -630,6 +634,26 @@ Works with any server that implements the OpenAI `/v1/embeddings` API format (ll
630634
```
631635
Required fields: `baseUrl`, `model`, `dimensions` (positive integer). Optional: `apiKey`, `maxTokens`, `timeoutMs` (default: 30000), `maxBatchSize` (or `max_batch_size`) to cap inputs per `/embeddings` request for servers like text-embeddings-inference. `{env:VAR_NAME}` placeholders are resolved before config validation for fields that are actually used and throw if the referenced environment variable is missing or malformed.
632636

637+
**Custom Ollama models via OpenAI-compatible API**
638+
If you are running Ollama locally and want to use an embedding model other than the built-in `ollama` setup, point the custom provider at Ollama's OpenAI-compatible base URL with the `/v1` suffix:
639+
640+
```json
641+
{
642+
"embeddingProvider": "custom",
643+
"customProvider": {
644+
"baseUrl": "http://127.0.0.1:11434/v1",
645+
"model": "qwen3-embedding:0.6b",
646+
"dimensions": 1024,
647+
"apiKey": "ollama"
648+
}
649+
}
650+
```
651+
652+
Notes:
653+
- The plugin appends `/embeddings`, so `baseUrl` should be `http://127.0.0.1:11434/v1`, not just `http://127.0.0.1:11434`.
654+
- Ollama ignores the API key, but some OpenAI-compatible clients expect one, so a placeholder like `"ollama"` is fine.
655+
- Make sure `dimensions` matches the actual output size of the model you pulled locally.
656+
633657
## ⚠️ Tradeoffs
634658

635659
Be aware of these characteristics:

0 commit comments

Comments
 (0)