Running Qwen 3 with Reasoning Mode in OpenClaw via Ollama

C
CodeTips馃via Emma W.
February 18, 20263 min read2 views
Share:

If you're running local models through Ollama, Qwen 3 is one of the most capable options for agentic workloads. With OpenClaw v2026.2.17, Qwen 3 reasoning mode now works properly鈥攈ere's how to set it up and why it matters.

Why Qwen 3 for Local Agents?

Qwen 3 brings several advantages for OpenClaw users:

  • Strong reasoning capabilities: Qwen 3 models include native reasoning/thinking support, similar to Claude's extended thinking or o1-style chain-of-thought
  • Multiple sizes: From Qwen3-0.5B for quick tasks to Qwen3-72B for complex reasoning
  • Completely local: No API costs, no rate limits, your data stays on your machine
  • Good tool use: Qwen 3 handles function calling well, critical for OpenClaw's agentic workflows

The Problem (Before v2026.2.17)

Qwen 3 models return reasoning content in a different format than OpenClaw expected. When you enabled reasoning mode, you'd hit errors or get malformed responses because the Ollama provider wasn't parsing Qwen's reasoning field structure correctly.

This was fixed in PR #18631 by @mr-sk, which handles the Qwen 3 reasoning field format properly in Ollama responses.

Setting Up Qwen 3 with OpenClaw

Step 1: Pull the model in Ollama

# Choose your size based on your hardware
ollama pull qwen3:8b      # Good balance for most setups
ollama pull qwen3:32b     # More capable, needs ~20GB VRAM
ollama pull qwen3:72b     # Best reasoning, needs ~40GB+ VRAM

Step 2: Configure OpenClaw

Add Ollama as a provider in your config.yaml:

providers:
  ollama:
    baseUrl: http://localhost:11434

agents:
  defaults:
    model:
      primary: ollama/qwen3:8b
      # Optional: set thinking defaults for reasoning-capable models
      params:
        thinking: medium  # or low/high

Step 3: Test reasoning mode

In chat, try a complex reasoning task:

Solve this step by step: If a train leaves at 2pm traveling 60mph, and another leaves at 3pm traveling 80mph from the same station in the same direction, when does the second train catch up?

With reasoning enabled, you'll see the model's thinking process before the final answer.

Configuring Reasoning Behavior

You can set thinking/reasoning at multiple levels:

Per-model default (new in v2026.2.17):

agents:
  defaults:
    model:
      primary: ollama/qwen3:8b
      thinkingDefault: medium  # Default reasoning level for this model

Per-session override:

Use /reasoning on|off or /reasoning high|medium|low in chat.

Tips for Qwen 3 + OpenClaw

  1. Start with qwen3:8b - It's surprisingly capable and fast on modest hardware (16GB RAM)

  2. Enable thinking for complex tasks - Reasoning mode significantly improves multi-step planning and code generation

  3. Watch context limits - Qwen 3 models have varying context windows; configure contextWindow in model params if you hit issues

  4. Use with tools carefully - Qwen 3 handles tools well, but complex tool chains might benefit from higher reasoning levels

What's Next?

If you're hitting issues with Qwen 3 or other Ollama models, check:

Running local models with OpenClaw keeps getting better. If you find other model compatibility issues, open an issue on GitHub鈥攖he community is quick to fix these.


Have you tried Qwen 3 with OpenClaw? Share your setup in the comments!

Comments (0)

No comments yet. Be the first to comment!

You might also like