Skip to content

Commit c874abb

Browse files
authored
Merge branch 'main' into Resolve-conflict
2 parents bd3ceb6 + 3a2387b commit c874abb

File tree

3 files changed

+36
-15
lines changed

3 files changed

+36
-15
lines changed

README.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -798,6 +798,10 @@ ollama pull nomic-embed-text
798798
}
799799
```
800800

801+
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`.
802+
803+
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`.
804+
801805
## 📈 Performance
802806

803807
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.
@@ -857,6 +861,26 @@ Works with any server that implements the OpenAI `/v1/embeddings` API format (ll
857861
```
858862
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.
859863

864+
**Custom Ollama models via OpenAI-compatible API**
865+
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:
866+
867+
```json
868+
{
869+
"embeddingProvider": "custom",
870+
"customProvider": {
871+
"baseUrl": "http://127.0.0.1:11434/v1",
872+
"model": "qwen3-embedding:0.6b",
873+
"dimensions": 1024,
874+
"apiKey": "ollama"
875+
}
876+
}
877+
```
878+
879+
Notes:
880+
- The plugin appends `/embeddings`, so `baseUrl` should be `http://127.0.0.1:11434/v1`, not just `http://127.0.0.1:11434`.
881+
- Ollama ignores the API key, but some OpenAI-compatible clients expect one, so a placeholder like `"ollama"` is fine.
882+
- Make sure `dimensions` matches the actual output size of the model you pulled locally.
883+
860884
## ⚠️ Tradeoffs
861885

862886
Be aware of these characteristics:

package-lock.json

Lines changed: 11 additions & 14 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@
7070
]
7171
},
7272
"dependencies": {
73+
"@opencode-ai/plugin": "~1.3.13",
7374
"chokidar": "^5.0.0",
7475
"ignore": "^7.0.5",
7576
"p-queue": "^9.1.1",
@@ -80,7 +81,6 @@
8081
"@eslint/js": "^9.39.4",
8182
"@modelcontextprotocol/sdk": "^1.29.0",
8283
"@napi-rs/cli": "^3.6.0",
83-
"@opencode-ai/plugin": "^1.3.13",
8484
"@types/node": "^25.5.2",
8585
"@vitest/coverage-v8": "^4.1.2",
8686
"eslint": "^9.39.4",

0 commit comments

Comments
 (0)