"config validation failed: ollama.models expected array"
This error means the models field in your Ollama provider config is a string, an object, or missing, but OpenClaw's schema requires an array of model objects, each with at least an id, even for a single model. Wrap your model in square brackets as an array of objects, save openclaw.json, and restart the gateway.
Likely cause
You passed models as a string (or omitted it). The schema expects an array of model objects, each with at least an id, even when you only run one model.
The fix
- 1 Wrap the model in an array of objects with an id field.
- 2 Save and restart the gateway.
"models": [{ "id": "qwen3-coder:30b" }]Hit a different error?
Paste any agent error and get the cause and fix in seconds.
Frequently asked questions
Why does it say 'received undefined'?
That variant means the models field doesn't exist in your Ollama provider section at all. You defined baseUrl and apiKey but forgot models. Add a models array with at least one object containing an id.
I only run one model. Do I still need an array?
Yes. The schema requires an array even with a single entry, so write "models": [{ "id": "qwen3-coder:30b" }] with the square brackets.
Can I avoid writing a models array at all?
On current OpenClaw versions you can set OLLAMA_API_KEY as an env var, remove the explicit block, and let OpenClaw auto-discover whatever Ollama has pulled.
Stop firefighting agent errors
Decoding errors one at a time is the manual version of what BetterClaw automates. Run your OpenClaw agents hosted with managed models, retries and config validation built in.
$19/month per agent · BYOK · 7-day money-back guarantee
