-
-
Notifications
You must be signed in to change notification settings - Fork 69.2k
Ollama auto-discovery fails: schema requires baseUrl+models[] but docs describe apiKey-only env var mode #22836
Description
Description
When trying to enable Ollama auto-discovery using only OLLAMA_API_KEY environment variable (as described in docs), the config schema validator rejects any models.providers.ollama entry that doesn't include both baseUrl and models[].
Steps to reproduce
- Set
OLLAMA_API_KEY=ollama-localin gateway plist EnvironmentVariables - Do NOT define
models.providers.ollamain openclaw.json (as docs recommend for auto-discovery) - Run
openclaw models list— Ollama models do not appear - Try
openclaw config set models.providers.ollama.apiKey "ollama-local"
Error
Error: Config validation failed:
- models.providers.ollama.baseUrl: Invalid input: expected string, received undefined
- models.providers.ollama.models: Invalid input: expected array, received undefined
What docs say
From /providers/ollama docs:
OpenClaw can auto-discover tool-capable models when you opt in with
OLLAMA_API_KEY(or an auth profile) and do not define an explicitmodels.providers.ollamaentry.
The simplest way to enable Ollama is via environment variable:
export OLLAMA_API_KEY="ollama-local"
What actually happens
The schema validator requires baseUrl and models[] whenever models.providers.ollama is defined at all — but the env-var-only path (no config entry) also fails to trigger auto-discovery.
Environment
- OpenClaw: 2026.2.19-2
- macOS: Darwin 25.3.0 arm64 (M4 Mac mini)
- Ollama: 0.16.3
- Models installed: mistral:7b, llama3.2:3b (both report
toolscapability via /api/show) - OLLAMA_API_KEY confirmed present in gateway process env via
launchctl print - Ollama API accessible at http://127.0.0.1:11434 (curl /api/tags returns models)
Expected behavior
Setting OLLAMA_API_KEY=ollama-local in the gateway environment should be sufficient to trigger auto-discovery and surface Ollama models in openclaw models list without requiring any config file changes.