Bug Report: Ollama Models Failing with "does not support thinking" Error
Environment
- OS: Windows 11
- CCR Version: v2.0.58
- Node Version: (run
node -v to get this)
- Ollama Version: Latest
- Models: qwen2.5:14b, qwen2.5-coder:7b, deepseek-r1:7b
Description
When using Ollama local models with claude-code-router, all requests fail with error: "model_name does not support thinking". This happens even when the think router is set to empty string or disabled.
使用 Ollama 本地模型时,所有请求都会失败并报错:"模型名称 does not support thinking"。即使将 think 路由设置为空字符串或禁用也无法解决。
Steps to Reproduce
-
Install claude-code-router v2.0.58:
npm install -g @musistudio/claude-code-router@2.0.58
-
Configure ~/.claude-code-router/config.json:
{
"Providers": [
{
"name": "ollama",
"api_base_url": "http://localhost:11434/v1/chat/completions",
"api_key": "ollama",
"models": ["qwen2.5:14b"],
"request_overrides": {
"tool_choice": "none"
}
}
],
"Router": {
"default": "ollama,qwen2.5:14b",
"think": ""
}
}
-
Start the service:
-
Send any message (e.g., "Hello")
Expected Behavior
The model should respond normally, as Ollama models work fine with direct API calls and other tools like Continue VSCode extension.
模型应该正常响应,因为 Ollama 模型在直接 API 调用和其他工具(如 Continue VSCode 扩展)中都能正常工作。
Actual Behavior
Every request fails with:
API Error: 400 {"error":{"message":"Error from provider(ollama,qwen2.5:14b: 400):
{\"error\":{\"message\":\"\\\"qwen2.5:14b\\\" does not support thinking\",
\"type\":\"api_error\",\"param\":null,\"code\":null}}"}}
Additional Context
- Tested with multiple models:
qwen2.5:14b, qwen2.5-coder:7b, deepseek-r1:7b - all fail
- Direct Ollama API calls work fine:
ollama run qwen2.5:14b works normally
- Tried various config options:
- Setting
"think": "" (empty string)
- Setting
"think": "ollama,qwen2.5:14b" (same model)
- Adding
"thinking": {"type": "disabled"} to request_overrides
- Adding
"tools": null to request_overrides
- None of these resolve the issue
尝试了多种配置选项均无法解决:
- 将
think 设为空字符串
- 在
request_overrides 中添加各种禁用选项
- 所有配置都无法解决问题
Root Cause Analysis
It appears that v2.0.58 force-enables the extended thinking feature for all requests, even when:
- The
think router is empty
- The provider explicitly disables it
- The model doesn't support Claude's extended thinking API
看起来 v2.0.58 版本强制启用了 extended thinking 功能,即使在以下情况下也会尝试使用:
- think 路由为空
- Provider 明确禁用
- 模型不支持 Claude 的 extended thinking API
Suggested Fix
Add a global flag to completely disable extended thinking for providers that don't support it:
建议添加全局标志来完全禁用不支持的功能:
{
"Providers": [
{
"name": "ollama",
"capabilities": {
"thinking": false,
"tools": false
}
}
]
}
Or detect provider capabilities automatically and skip unsupported features.
或者自动检测 Provider 的能力并跳过不支持的功能。
Workaround
Currently no workaround exists. Users with Ollama models cannot use v2.0.58.
目前没有可用的解决方法。使用 Ollama 模型的用户无法使用 v2.0.58 版本。
Potential temporary solution: Downgrade to an earlier version (if available).
可能的临时解决方案:降级到早期版本(如果可用)。
Hardware: Lenovo Y9000P, RTX 4060 (8GB VRAM)
Use Case: Local AI development without API costs
Thank you for this amazing project! Looking forward to Ollama support being fixed. 🙏
感谢这个出色的项目!期待 Ollama 支持问题能够得到修复。🙏
Bug Report: Ollama Models Failing with "does not support thinking" Error
Environment
node -vto get this)Description
When using Ollama local models with
claude-code-router, all requests fail with error:"model_name does not support thinking". This happens even when thethinkrouter is set to empty string or disabled.使用 Ollama 本地模型时,所有请求都会失败并报错:
"模型名称 does not support thinking"。即使将think路由设置为空字符串或禁用也无法解决。Steps to Reproduce
Install claude-code-router v2.0.58:
Configure
~/.claude-code-router/config.json:{ "Providers": [ { "name": "ollama", "api_base_url": "http://localhost:11434/v1/chat/completions", "api_key": "ollama", "models": ["qwen2.5:14b"], "request_overrides": { "tool_choice": "none" } } ], "Router": { "default": "ollama,qwen2.5:14b", "think": "" } }Start the service:
Send any message (e.g., "Hello")
Expected Behavior
The model should respond normally, as Ollama models work fine with direct API calls and other tools like Continue VSCode extension.
模型应该正常响应,因为 Ollama 模型在直接 API 调用和其他工具(如 Continue VSCode 扩展)中都能正常工作。
Actual Behavior
Every request fails with:
Additional Context
qwen2.5:14b,qwen2.5-coder:7b,deepseek-r1:7b- all failollama run qwen2.5:14bworks normally"think": ""(empty string)"think": "ollama,qwen2.5:14b"(same model)"thinking": {"type": "disabled"}torequest_overrides"tools": nulltorequest_overrides尝试了多种配置选项均无法解决:
think设为空字符串request_overrides中添加各种禁用选项Root Cause Analysis
It appears that v2.0.58 force-enables the extended thinking feature for all requests, even when:
thinkrouter is empty看起来 v2.0.58 版本强制启用了 extended thinking 功能,即使在以下情况下也会尝试使用:
Suggested Fix
Add a global flag to completely disable extended thinking for providers that don't support it:
建议添加全局标志来完全禁用不支持的功能:
{ "Providers": [ { "name": "ollama", "capabilities": { "thinking": false, "tools": false } } ] }Or detect provider capabilities automatically and skip unsupported features.
或者自动检测 Provider 的能力并跳过不支持的功能。
Workaround
Currently no workaround exists. Users with Ollama models cannot use v2.0.58.
目前没有可用的解决方法。使用 Ollama 模型的用户无法使用 v2.0.58 版本。
Potential temporary solution: Downgrade to an earlier version (if available).
可能的临时解决方案:降级到早期版本(如果可用)。
Hardware: Lenovo Y9000P, RTX 4060 (8GB VRAM)
Use Case: Local AI development without API costs
Thank you for this amazing project! Looking forward to Ollama support being fixed. 🙏
感谢这个出色的项目!期待 Ollama 支持问题能够得到修复。🙏