Add "Think" button that toggles reasoning_effort to "reasoning_effort" (or medium if not set) / none #11006
Replies: 6 comments 5 replies
|
What happens for o3 on "none" reasoning effort? Thinking button is disabled and it will still think? |
|
Yes I agree this should be a feature for seamless usage, and I also think it could go even further to reduce the need for reasoning models listed alongside their non-reasoning counterparts. Perhaps we could have the ability to add a reasoning model override to each non-reasoning models settings, so when the 'Think' button is selected, the model switches to that in the bg. |
|
+1 it would be useful to have a button in the UI to enable / disable reasoning for each prompt |
|
+1 lacking this |
|
Filters can do this and should be used here |
|
The following filter function allows to use for example different thinking reasoning levels for Qwen3.8. It should not be set as global but rather for specific models. It works very well for my infrastructure. """
title: Reasoning
author: Toni Deleo
version: 1.2.0
description: Per-chat reasoning control for Qwen3.8 via vLLM.
"""
from typing import Literal, Optional
from pydantic import BaseModel, Field
class Filter:
class Valves(BaseModel):
priority: int = Field(
default=0,
description="Filter execution priority.",
)
assistant_name: str = Field(
default="Luna",
description="Assistant name used in status messages, e.g. Luna or Qwen3.8.",
)
preserve_thinking: bool = Field(
default=True,
description="Preserve previous reasoning context between turns.",
)
class UserValves(BaseModel):
reasoning_mode: Literal[
"off",
"low",
"medium",
"xhigh",
] = Field(
default="medium",
description="Select the reasoning level.",
json_schema_extra={
"input": {
"type": "select",
"options": [
{
"value": "off",
"label": "⚡ Off — Direct answer",
},
{
"value": "low",
"label": "🧠 Low — Fast reasoning",
},
{
"value": "medium",
"label": "🧠 Medium — Balanced",
},
{
"value": "xhigh",
"label": "🧠 Deep — Maximum reasoning",
},
],
}
},
)
def __init__(self):
self.valves = self.Valves()
# Makes the filter appear as a toggleable chip in Open WebUI.
self.toggle = True
self.icon = (
"data:image/svg+xml,"
"%3Csvg xmlns='http://www.w3.org/2000/svg' "
"viewBox='0 0 24 24' fill='none' "
"stroke='%239F5A05' stroke-width='2' "
"stroke-linecap='round' stroke-linejoin='round'%3E"
"%3Cpath d='M9.5 4A3.5 3.5 0 0 0 6 7.5v1"
"A3.5 3.5 0 0 0 4 15a3 3 0 0 0 3 3h2.5V4Z'/%3E"
"%3Cpath d='M14.5 4A3.5 3.5 0 0 1 18 7.5v1"
"A3.5 3.5 0 0 1 20 15a3 3 0 0 1-3 3h-2.5V4Z'/%3E"
"%3Cpath d='M9.5 9H7M14.5 9H17M9.5 14H7M14.5 14H17'/%3E"
"%3C/svg%3E"
)
async def inlet(
self,
body: dict,
__user__: Optional[dict] = None,
__event_emitter__=None,
) -> dict:
if not __user__ or "valves" not in __user__:
return body
user_valves = __user__["valves"]
mode = getattr(
user_valves,
"reasoning_mode",
"medium",
)
if mode not in {"off", "low", "medium", "xhigh"}:
mode = "medium"
assistant_name = self.valves.assistant_name.strip() or "Assistant"
preserve_thinking = bool(self.valves.preserve_thinking)
# Prevent Open WebUI's generic reasoning_effort field
# from conflicting with Qwen's chat-template setting.
body.pop("reasoning_effort", None)
chat_kwargs = body.setdefault(
"chat_template_kwargs",
{},
)
chat_kwargs["preserve_thinking"] = preserve_thinking
if mode == "off":
chat_kwargs["enable_thinking"] = False
chat_kwargs.pop("reasoning_effort", None)
mode_label = "Off"
else:
chat_kwargs["enable_thinking"] = True
chat_kwargs["reasoning_effort"] = mode
mode_label = {
"low": "Low",
"medium": "Medium",
"xhigh": "Deep",
}[mode]
if __event_emitter__:
await __event_emitter__(
{
"type": "status",
"data": {
"description": (f"{assistant_name} reasoning: {mode_label}"),
"done": True,
"hidden": False,
},
}
)
return body |

Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
It would be great to have a button like in Grok to turn on/off thinking this is useful for models like Claude 3-7 with the thinking pipe function:
open-webui/pipelines#443
As the reasoning_effort is currently set to None when default is selected and whatever you put in when you edit the model in the sidebar, this needs to toggle between:
None -> "none" => Disables reasoning (button is not active - like the code interpreter)
"reasoning_effort" is set => "reasoning_effort"
"reasoning_effort" is default => "medium"
All reactions