OpenClaw can connect to local models, but don't assume that "being able to chat" is the same as "being able to be an agent". If a small request works on the local OpenAI-compatible backend but OpenClaw agent turn fails, it is usually due to an incompatibility in the message format, tool call, or context length.
Do a three-layer test first
- Directly hit the local
/v1/chat/completionsto confirm that the backend is available. - Use
openclaw infer model runto test whether the model can complete the basic reply in OpenClaw. - Let the agent call up a simple tool, such as reading a small file or executing a security command.
Common compatible amendments
- Report
messages[].contentString required: Addcompat.requiresStringContent: trueto the model. - Normal chat works, tool calls fail: Consider setting up
compat.supportsTools: falseand don't let it take on tool-based tasks. - Small prompts can crash, large contexts crash: This is a model or server-side limitation, reducing the context or changing the backend.
Local models are suitable for privacy, offline, and low-cost scenarios, but complex toolchains are more stable for the model. It is recommended to put the local model in low-risk tasks or fallbacks, and the key automation is still covered by a strong model.
Official open source address: https://github.com/openclaw/openclaw.
The safest approach is to build a separate test agent for the local model, allowing only low-risk tools. Make sure it can handle contexts, tool calls, and error recovery stably, and then put it in the main agent's fallback.