Click Claw
Why your local model (Ollama) hangs in OpenClaw — and how to fix it
You wired up a local model through Ollama, went through onboarding, and… the chat just hangs. Or it spits out a fragment of raw JSON and stops. The model works fine in ollama run, but inside OpenClaw it's useless.
This is the most common — and most demoralizing — local-LLM problem, and it's almost never OpenClaw itself. It's the model. There are three real causes, in the order worth checking.
"Spits out a piece of the JSON" = botched tool call
That symptom is the tell: the model is *trying* to make a tool call but botching the format, so OpenClaw can't parse it and the turn stalls.
A lot of local models don't do structured tool-calls reliably. Models that work well via Ollama right now: qwen2.5 (or qwen2.5-coder), llama3.1 / llama3.2, mistral-nemo. If you're on a Gemma model, or something small and heavily quantized, switch to one of those first — that alone fixes most "hangs / raw JSON" cases.
To check whether a model even claims tool support:
ollama show <model>
Look for tools/function-calling in its capabilities. If it's not there, the model can't drive an agent, full stop.
The context window — the one that surprises people
OpenClaw sends a large payload at session start — on the order of ~65k tokens once you count the system prompt, tool definitions, and skills. Any local model whose context window is smaller than that will truncate the prompt, then either auto-compact-loop or just fail. The result looks exactly like "hangs."
The catch: Ollama's default num_ctx is often only 2k–4k. So even a capable model gets choked at the default. Raise it:
# In a Modelfile
PARAMETER num_ctx 32768
…and make sure the model you chose actually *supports* a context that large. A 7B model at 32k+ context also needs real memory for the KV cache — several GB on top of the weights.
Size and your hardware
Below ~7–8B, and at heavy quantization, models often can't follow the tool-call format at all. And here's the part nobody tells you: a tool-capable model at OpenClaw's ~65k context needs a lot of RAM. On a 16GB laptop, the model weights + KV cache + OS can exceed what you have — which is *why* local setups hang on smaller machines. If you keep hitting a wall, a larger-RAM machine, a smaller-context profile, or Ollama's cloud option may be the realistic fix.
The short version
- Tool-calling: use
qwen2.5/llama3.1-3.2/mistral-nemo, not Gemma or tiny models. - Context: raise
num_ctxwell above the default; OpenClaw needs room for a ~65k startup payload. - Hardware: a tool-capable model at that context is memory-hungry — make sure your machine can hold it.
Note that openclaw doctor checks the gateway, config, and channels — but it does not diagnose the model layer, which is why "the model won't work" is so hard to pin down. (Click Claw is working on exactly this gap — checking your model's tool support and context fit against what OpenClaw actually needs.) Either way, the three causes above are where the problem almost always lives.