diff --git a/docs/providers/ollama.md b/docs/providers/ollama.md index 339dd1d7fe3..27f5aead375 100644 --- a/docs/providers/ollama.md +++ b/docs/providers/ollama.md @@ -326,11 +326,11 @@ prefix before calling Ollama so the server receives `qwen3:32b`. OpenClaw supports **Ollama Web Search** as a bundled `web_search` provider. -| Property | Detail | -| ----------- | ----------------------------------------------------------------------------------------------------------------- | -| Host | Uses your configured Ollama host (`models.providers.ollama.baseUrl` when set, otherwise `http://127.0.0.1:11434`) | -| Auth | Key-free | -| Requirement | Ollama must be running and signed in with `ollama signin` | +| Property | Detail | +| ----------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| Host | Uses your configured Ollama host (`models.providers.ollama.baseUrl` when set, otherwise `http://127.0.0.1:11434`); `https://ollama.com` uses the hosted API directly | +| Auth | Key-free for signed-in local Ollama hosts; `OLLAMA_API_KEY` or configured provider auth for direct `https://ollama.com` search or auth-protected hosts | +| Requirement | Local/self-hosted hosts must be running and signed in with `ollama signin`; direct hosted search requires `baseUrl: "https://ollama.com"` plus a real Ollama API key | Choose **Ollama Web Search** during `openclaw onboard` or `openclaw configure --section web`, or set: diff --git a/docs/reference/api-usage-costs.md b/docs/reference/api-usage-costs.md index 9dd612b8daa..16d8bd38507 100644 --- a/docs/reference/api-usage-costs.md +++ b/docs/reference/api-usage-costs.md @@ -132,7 +132,7 @@ See [Memory](/concepts/memory). - **Grok (xAI)**: `XAI_API_KEY` or `plugins.entries.xai.config.webSearch.apiKey` - **Kimi (Moonshot)**: `KIMI_API_KEY`, `MOONSHOT_API_KEY`, or `plugins.entries.moonshot.config.webSearch.apiKey` - **MiniMax Search**: `MINIMAX_CODE_PLAN_KEY`, `MINIMAX_CODING_API_KEY`, `MINIMAX_API_KEY`, or `plugins.entries.minimax.config.webSearch.apiKey` -- **Ollama Web Search**: key-free by default, but requires a reachable Ollama host plus `ollama signin`; can also reuse normal Ollama provider bearer auth when the host requires it +- **Ollama Web Search**: key-free for a reachable signed-in local Ollama host; direct `https://ollama.com` search uses `OLLAMA_API_KEY`, and auth-protected hosts can reuse normal Ollama provider bearer auth - **Perplexity Search API**: `PERPLEXITY_API_KEY`, `OPENROUTER_API_KEY`, or `plugins.entries.perplexity.config.webSearch.apiKey` - **Tavily**: `TAVILY_API_KEY` or `plugins.entries.tavily.config.webSearch.apiKey` - **DuckDuckGo**: key-free fallback (no API billing, but unofficial and HTML-based) diff --git a/docs/tools/ollama-search.md b/docs/tools/ollama-search.md index 280748e6637..2b159e148c6 100644 --- a/docs/tools/ollama-search.md +++ b/docs/tools/ollama-search.md @@ -1,8 +1,9 @@ --- -summary: "Ollama Web Search via your configured Ollama host" +summary: "Ollama Web Search via a local Ollama host or the hosted Ollama API" read_when: - You want to use Ollama for web_search - You want a key-free web_search provider + - You want to use hosted Ollama Web Search with OLLAMA_API_KEY - You need Ollama Web Search setup guidance title: "Ollama web search" --- @@ -11,12 +12,15 @@ OpenClaw supports **Ollama Web Search** as a bundled `web_search` provider. It uses Ollama's web-search API and returns structured results with titles, URLs, and snippets. -Unlike the Ollama model provider, this setup does not need an API key by +For local or self-hosted Ollama, this setup does not need an API key by default. It does require: - an Ollama host that is reachable from OpenClaw - `ollama signin` +For direct hosted search, set the Ollama provider base URL to `https://ollama.com` +and provide a real `OLLAMA_API_KEY`. + ## Setup @@ -62,6 +66,25 @@ configured host. Optional Ollama host override: +```json5 +{ + plugins: { + entries: { + ollama: { + config: { + webSearch: { + baseUrl: "http://ollama-host:11434", + }, + }, + }, + }, + }, +} +``` + +If you already configure Ollama as a model provider, the web-search provider can +reuse that host instead: + ```json5 { models: { @@ -80,11 +103,36 @@ If your Ollama host expects bearer auth, OpenClaw reuses `models.providers.ollama.apiKey` (or the matching env-backed provider auth) for requests to that configured host. +Direct hosted Ollama Web Search: + +```json5 +{ + models: { + providers: { + ollama: { + baseUrl: "https://ollama.com", + apiKey: "OLLAMA_API_KEY", + }, + }, + }, + tools: { + web: { + search: { + provider: "ollama", + }, + }, + }, +} +``` + ## 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 `baseUrl` is `https://ollama.com`, OpenClaw calls + `https://ollama.com/api/web_search` directly and sends the configured Ollama + API key as bearer auth. - 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. diff --git a/docs/tools/web.md b/docs/tools/web.md index e759ae3de9e..a3d93bdb361 100644 --- a/docs/tools/web.md +++ b/docs/tools/web.md @@ -82,7 +82,7 @@ local while `web_search` and `x_search` can use xAI Responses under the hood. Structured results via the MiniMax Coding Plan search API. - Key-free search via your configured Ollama host. Requires `ollama signin`. + Search via a signed-in local Ollama host or the hosted Ollama API. Structured results with content extraction controls and domain filtering. @@ -97,20 +97,20 @@ local while `web_search` and `x_search` can use xAI Responses under the hood. ### Provider comparison -| Provider | Result style | Filters | API key | -| ----------------------------------------- | -------------------------- | ------------------------------------------------ | -------------------------------------------------------------------------------- | -| [Brave](/tools/brave-search) | Structured snippets | Country, language, time, `llm-context` mode | `BRAVE_API_KEY` | -| [DuckDuckGo](/tools/duckduckgo-search) | Structured snippets | -- | None (key-free) | -| [Exa](/tools/exa-search) | Structured + extracted | Neural/keyword mode, date, content extraction | `EXA_API_KEY` | -| [Firecrawl](/tools/firecrawl) | Structured snippets | Via `firecrawl_search` tool | `FIRECRAWL_API_KEY` | -| [Gemini](/tools/gemini-search) | AI-synthesized + citations | -- | `GEMINI_API_KEY` | -| [Grok](/tools/grok-search) | AI-synthesized + citations | -- | `XAI_API_KEY` | -| [Kimi](/tools/kimi-search) | AI-synthesized + citations | -- | `KIMI_API_KEY` / `MOONSHOT_API_KEY` | -| [MiniMax Search](/tools/minimax-search) | Structured snippets | Region (`global` / `cn`) | `MINIMAX_CODE_PLAN_KEY` / `MINIMAX_CODING_API_KEY` | -| [Ollama Web Search](/tools/ollama-search) | Structured snippets | -- | None by default; `ollama signin` required, can reuse Ollama provider bearer auth | -| [Perplexity](/tools/perplexity-search) | Structured snippets | Country, language, time, domains, content limits | `PERPLEXITY_API_KEY` / `OPENROUTER_API_KEY` | -| [SearXNG](/tools/searxng-search) | Structured snippets | Categories, language | None (self-hosted) | -| [Tavily](/tools/tavily) | Structured snippets | Via `tavily_search` tool | `TAVILY_API_KEY` | +| Provider | Result style | Filters | API key | +| ----------------------------------------- | -------------------------- | ------------------------------------------------ | --------------------------------------------------------------------------------------- | +| [Brave](/tools/brave-search) | Structured snippets | Country, language, time, `llm-context` mode | `BRAVE_API_KEY` | +| [DuckDuckGo](/tools/duckduckgo-search) | Structured snippets | -- | None (key-free) | +| [Exa](/tools/exa-search) | Structured + extracted | Neural/keyword mode, date, content extraction | `EXA_API_KEY` | +| [Firecrawl](/tools/firecrawl) | Structured snippets | Via `firecrawl_search` tool | `FIRECRAWL_API_KEY` | +| [Gemini](/tools/gemini-search) | AI-synthesized + citations | -- | `GEMINI_API_KEY` | +| [Grok](/tools/grok-search) | AI-synthesized + citations | -- | `XAI_API_KEY` | +| [Kimi](/tools/kimi-search) | AI-synthesized + citations | -- | `KIMI_API_KEY` / `MOONSHOT_API_KEY` | +| [MiniMax Search](/tools/minimax-search) | Structured snippets | Region (`global` / `cn`) | `MINIMAX_CODE_PLAN_KEY` / `MINIMAX_CODING_API_KEY` | +| [Ollama Web Search](/tools/ollama-search) | Structured snippets | -- | None for signed-in local hosts; `OLLAMA_API_KEY` for direct `https://ollama.com` search | +| [Perplexity](/tools/perplexity-search) | Structured snippets | Country, language, time, domains, content limits | `PERPLEXITY_API_KEY` / `OPENROUTER_API_KEY` | +| [SearXNG](/tools/searxng-search) | Structured snippets | Categories, language | None (self-hosted) | +| [Tavily](/tools/tavily) | Structured snippets | Via `tavily_search` tool | `TAVILY_API_KEY` | ## Auto-detection @@ -176,7 +176,7 @@ API-backed providers first: Key-free fallbacks after that: 10. **DuckDuckGo** -- key-free HTML fallback with no account or API key (order 100) -11. **Ollama Web Search** -- key-free fallback via your configured Ollama host; requires Ollama to be reachable and signed in with `ollama signin` and can reuse Ollama provider bearer auth if the host needs it (order 110) +11. **Ollama Web Search** -- key-free fallback via your configured local Ollama host when it is reachable and signed in with `ollama signin`; can reuse Ollama provider bearer auth when the host needs it, and can call direct `https://ollama.com` search when configured with `OLLAMA_API_KEY` (order 110) 12. **SearXNG** -- `SEARXNG_BASE_URL` or `plugins.entries.searxng.config.webSearch.baseUrl` (order 200) If no provider is detected, it falls back to Brave (you will get a missing-key