fix(ollama): harden native provider routing

This commit is contained in:
Peter Steinberger
2026-04-27 01:01:51 +01:00
parent be56f172ab
commit a3e0674261
18 changed files with 909 additions and 120 deletions

View File

@@ -318,6 +318,10 @@ Once configured, all your Ollama models are available:
}
```
Custom Ollama provider ids are also supported. When a model ref uses the active
provider prefix, such as `ollama-spark/qwen3:32b`, OpenClaw strips only that
prefix before calling Ollama so the server receives `qwen3:32b`.
## Ollama Web Search
OpenClaw supports **Ollama Web Search** as a bundled `web_search` provider.
@@ -437,7 +441,8 @@ For the full setup and behavior details, see [Ollama Web Search](/tools/ollama-s
<Accordion title="Memory embeddings">
The bundled Ollama plugin registers a memory embedding provider for
[memory search](/concepts/memory). It uses the configured Ollama base URL
and API key.
and API key, calls Ollama's current `/api/embed` endpoint, and batches
multiple memory chunks into one `input` request when possible.
| Property | Value |
| ------------- | ------------------- |

View File

@@ -78,18 +78,22 @@ If no explicit Ollama base URL is set, OpenClaw uses `http://127.0.0.1:11434`.
If your Ollama host expects bearer auth, OpenClaw reuses
`models.providers.ollama.apiKey` (or the matching env-backed provider auth)
for web-search requests too.
for requests to that configured host.
## Notes
- No web-search-specific API key field is required for this provider.
- If the Ollama host is auth-protected, OpenClaw reuses the normal Ollama
provider API key when present.
- If the configured host does not expose web search and `OLLAMA_API_KEY` is set,
OpenClaw can fall back to `https://ollama.com/api/web_search` without sending
that env key to the local host.
- OpenClaw warns during setup if Ollama is unreachable or not signed in, but
it does not block selection.
- Runtime auto-detect can fall back to Ollama Web Search when no higher-priority
credentialed provider is configured.
- The provider uses Ollama's `/api/web_search` endpoint.
- The provider tries Ollama's `/api/web_search` endpoint first, then the legacy
`/api/experimental/web_search` endpoint for older hosts.
## Related