Ollama

"config validation failed: ollama.models expected array"

Last checked

This error means the models field in your Ollama provider config is a string, a single object, or (on older OpenClaw) missing, but OpenClaw's schema requires an array of model objects, each with an id and a name, even for a single model. Wrap your model in square brackets as an array of objects, save openclaw.json, run openclaw config validate, and restart the gateway.

Why it happens

You passed models as a string or a single object (or, on older OpenClaw, omitted it). The schema expects an array of model objects, each with at least an id and a name, even when you only run one model.

  1. models is a string, such as "models": "qwen3-coder:30b", or a bare object without square brackets. The validator wants a list, so it reports expected array and names the type it got.
  2. The models key is missing from an ollama block that sets baseUrl or apiKey. OpenClaw releases before 2026.7.1 rejected this with "received undefined"; 2026.7.1 lets bundled providers such as ollama omit baseUrl and models.
  3. You named the provider something custom, such as ollama-remote. Custom provider ids still must declare both baseUrl and a models array on current versions.
  4. The array is there but an entry is incomplete. Each model object needs both id and name, so [{ "id": "qwen3-coder:30b" }] alone fails one level deeper, at models.0.name.

The fix

  1. 1 Wrap the model in an array of objects with id and name fields (name can repeat the id).
  2. 2 Run openclaw config validate to confirm the file now passes.
  3. 3 Restart the gateway with openclaw gateway restart.
"models": [{ "id": "qwen3-coder:30b", "name": "qwen3-coder:30b" }]

Still failing?

  • Run openclaw config validate and read the path it prints. models.0.name means the array is fine but an entry lacks a name.
  • Print what OpenClaw actually loaded with openclaw config get models.providers.ollama, in case another file or a typo in the provider id is involved.
  • Check openclaw --version. Before 2026.7.1 an ollama block always needs a models array; on 2026.7.1 or later you can delete the key and rely on discovery.
  • Keep baseUrl on the native Ollama URL (http://127.0.0.1:11434) without /v1. The /v1 path validates, but it switches to OpenAI-compatible mode, where tool calling is unreliable.
  • Once it validates, run openclaw models list --provider ollama to confirm the model shows up.

Related errors

Full guideFix: OpenClaw Ollama "models Expected Array"

Hit a different error?

Paste any agent error and get the cause and fix in seconds.

Open the decoder

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", "name": "qwen3-coder:30b" }] with the square brackets.

Can I avoid writing a models array at all?

Yes. Remove the explicit models.providers.ollama block, set OLLAMA_API_KEY (any value such as ollama-local works for a local host) or an auth profile, and OpenClaw discovers the models Ollama has installed. On 2026.7.1 or later you can also keep an ollama block for settings like timeouts without a models key.

It now says models.0.name expected string. What changed?

The array fixed the first error, and validation moved on to the entry itself. Every model object needs a name as well as an id. Add "name" with the same value as the id.

Stop firefighting agent errors

Decoding errors one at a time is the manual version of what BetterClaw automates. Run your agents on a no-code AI agent platform with managed models, retries and config validation built in.

Free plan available · Pro $49/mo · BYOK · 7-day money-back guarantee