Skip to main content

Common recipes

Replace model IDs with exact names from ollama list or openclaw models list --provider ollama.
Ollama on the same machine as the Gateway, discovered automatically:
Leave models.providers.ollama unset to use the default local endpoint, or configure a self-hosted endpoint with models: [] to keep discovery eligible.
contextTokens caps OpenClaw’s active-input budget; params.num_ctx sets Ollama’s request context. Keep them aligned when hardware cannot run the model’s full advertised context.
No local daemon, hosted models directly:
For the dedicated ollama-cloud provider id instead of this shape, see Ollama Cloud.
Custom provider IDs when running more than one Ollama server; each gets its own host, models, auth, and timeout.
OpenClaw strips the active provider prefix (falling back to a bare ollama/ prefix) before calling Ollama, so ollama-large/qwen3.5:27b reaches Ollama as qwen3.5:27b.
Local Ollama models automatically use structured Tool Search when tools.toolSearch is unset. This keeps optional capabilities available while loading their schemas only when needed. Setup does not enable lean mode. App, interactive CLI, and non-interactive setup use a 32,768-token runtime context, or the model’s native window if smaller. The advertised native window is retained separately; known cloud routes keep their hosted context. Large file reads use OpenClaw’s context-based paging. The native adapter preserves those text pages and their continuation instructions; structured fallback data is bounded separately. Bound any explicit context override to what the host can support:
Explicit tools.toolSearch settings take precedence, including false. Tool Search does not change Ollama’s context or thinking mode. Ollama thinking defaults to off; an explicit thinking setting can change that independently. If you previously enabled localModelLean, set it to false to restore optional tools while retaining automatic Tool Search.Use compat.supportsTools: false only when the model or server reliably fails on tool schemas; it disables tool use entirely. For a deliberately narrower agent, prefer tools.profile or a per-agent tool policy.

Model selection

Custom provider ids work the same way: for a ref using the active provider prefix, such as ollama-spark/qwen3:32b, OpenClaw strips that prefix before calling Ollama, sending qwen3:32b. For slow local models, prefer provider-scoped tuning before raising the whole agent runtime timeout:
timeoutSeconds covers the model HTTP request: connection setup, headers, body streaming, and the total guarded-fetch abort. params.keep_alive is forwarded as top-level keep_alive on native /api/chat requests; set it per model when first-turn load time is the bottleneck.

Quick verification

For remote hosts, replace 127.0.0.1 with the baseUrl host. If curl works but OpenClaw does not, check whether the Gateway runs on a different machine, container, or service account.