openclaw - 💡(How to fix) Fix Feature: per-model Ollama API options in config (e.g. think: false for Qwen 3.5) [1 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
openclaw/openclaw#44457Fetched 2026-04-08 00:46:45
View on GitHub
Comments
1
Participants
2
Timeline
3
Reactions
1
Timeline (top)
subscribed ×2commented ×1

Root Cause

  • think: false is supported by Ollama's native API — it disables the thinking phase entirely (0 thinking tokens, ~1s response vs 30s+)
  • Without it, Qwen 3.5 122B is unusable in the main session — the thinking phase with a full workspace context prompt runs for 60+ seconds and times out
  • The Ollama Modelfile has no equivalent parameter (PARAMETER think false returns unknown parameter)
  • A workaround proxy is brittle and breaks other local models (blocks VRAM)

Fix Action

Workaround

Running an async proxy between OpenClaw and Ollama that injects think: false, but this is fragile.

Code Example

{
  "models": {
    "providers": {
      "ollama": {
        "baseUrl": "http://localhost:11434",
        "models": [
          {
            "id": "qwen3.5:122b-a10b-nothink",
            "name": "Qwen 3.5 122B (no thinking)",
            "api": "ollama",
            "options": {
              "think": false
            }
          }
        ]
      }
    }
  }
}
RAW_BUFFERClick to expand / collapse

Problem

The OpenClaw Ollama provider has no way to pass model-specific API options in config. This becomes critical for Qwen 3.5 thinking models, which stream endless <think> tokens by default unless the request includes think: false.

Since OpenClaw sends its own system prompt (workspace context, SOUL.md, etc.), the Ollama Modelfile SYSTEM /no_think trick doesn't work — OpenClaw's system prompt overrides it.

Requested Feature

Allow per-model Ollama API options in the provider config:

{
  "models": {
    "providers": {
      "ollama": {
        "baseUrl": "http://localhost:11434",
        "models": [
          {
            "id": "qwen3.5:122b-a10b-nothink",
            "name": "Qwen 3.5 122B (no thinking)",
            "api": "ollama",
            "options": {
              "think": false
            }
          }
        ]
      }
    }
  }
}

The options object would be merged into the Ollama API request body.

Why This Matters

  • think: false is supported by Ollama's native API — it disables the thinking phase entirely (0 thinking tokens, ~1s response vs 30s+)
  • Without it, Qwen 3.5 122B is unusable in the main session — the thinking phase with a full workspace context prompt runs for 60+ seconds and times out
  • The Ollama Modelfile has no equivalent parameter (PARAMETER think false returns unknown parameter)
  • A workaround proxy is brittle and breaks other local models (blocks VRAM)

Workaround

Running an async proxy between OpenClaw and Ollama that injects think: false, but this is fragile.

Environment

  • OpenClaw: 2026.3.11
  • Ollama: 0.17.5/0.17.7
  • Model: qwen3.5:122b-a10b, Apple M1 Ultra

extent analysis

Fix Plan

To address the issue, we need to modify the OpenClaw Ollama provider to support per-model API options in the config.

Here are the steps:

  • Update the provider config to include an options object for each model.
  • Modify the Ollama API request to merge the options object into the request body.

Example Code

# Updated provider config
config = {
  "models": {
    "providers": {
      "ollama": {
        "baseUrl": "http://localhost:11434",
        "models": [
          {
            "id": "qwen3.5:122b-a10b-nothink",
            "name": "Qwen 3.5 122B (no thinking)",
            "api": "ollama",
            "options": {
              "think": False
            }
          }
        ]
      }
    }
  }
}

# Modified Ollama API request
def send_request(model, prompt, options=None):
    request_body = {
        "prompt": prompt,
        # Merge options into request body
        **(options or {})
    }
    response = requests.post(f"{config['baseUrl']}/generate", json=request_body)
    return response.json()

# Usage
model_id = "qwen3.5:122b-a10b-nothink"
model_config = next((m for m in config["models"]["providers"]["ollama"]["models"] if m["id"] == model_id), None)
if model_config:
    options = model_config.get("options")
    response = send_request(model_id, "Hello, world!", options)
    print(response)

Verification

To verify that the fix worked, test the Qwen 3.5 122B model with the think: false option. The response should be received within 1 second, and the thinking phase should be disabled.

Extra Tips

  • Make sure to update the OpenClaw and Ollama versions to the latest releases to ensure compatibility.
  • If using a proxy, remove it and test the direct connection to Ollama.
  • Consider adding error handling and logging to the modified Ollama API request to handle any potential issues.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING