mirror of
https://github.com/open-webui/open-webui.git
synced 2026-05-07 03:18:23 -05:00
[GH-ISSUE #13314] Add the enable_thinking parameter to Qwen3 #16881
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @lingyezhixing on GitHub (Apr 29, 2025).
Original GitHub issue: https://github.com/open-webui/open-webui/issues/13314
Check Existing Issues
Problem Description
The latest Qwen3 cannot switch response mode in the current open webui version
Desired Solution you'd like
Add the enable_thinking parameter to Qwen3
Alternatives Considered
Add the enable_thinking parameter to Qwen3
Additional Context
No response
@1790374044 commented on GitHub (Apr 29, 2025):
If it is really impossible to add options to a single model, providing
extra_bodyoption is also fine. At least we have a way to solve some minor adaptation problems by ourselves.(;´д`)ゞ
@ZV-Liu commented on GitHub (Apr 29, 2025):
+1
@Wannabeasmartguy commented on GitHub (Apr 29, 2025):
To disable the thinking process, what is required of you is to add
/no_thinkto your prompt (for the current round) or the system message (for the entire dialogue) without making any other settings.@1790374044 commented on GitHub (Apr 29, 2025):
Although as stated in https://github.com/open-webui/open-webui/issues/1484 ,
Functioncan cover this usage scenario, but usingFunctionis too much like using a sledgehammer to crack a nut....( _ _)ノ|
@1790374044 commented on GitHub (Apr 29, 2025):
In some cases (like qwen-plus provided by aliyun) , enable_thinking is turned off by default, which leads to the inability to enable the thinking process.
@1790374044 commented on GitHub (Apr 30, 2025):
As mentioned above,
Functioncan be used for this.Yesterday I found Gemini Safety Settings off .
So...
Filter Functionfilteryou created in the previous stepI'm a novice, so I don't know why it works. But, it is not as complicated as
Pipe Function, and, it just works.@zhongli0226 commented on GitHub (Apr 30, 2025):
A switch to turn on thinking could be added at the bottom of the dialog so that you can choose whether to start thinking or not
@cpwan commented on GitHub (Apr 30, 2025):
This one works. But does not allow user to toggle in chat config.
@TheNexter commented on GitHub (Apr 30, 2025):
Very important, in title generation we don't need to be able to force the non thinking version to generate instead of the thinking version for Qwen3
@Xi-Gong commented on GitHub (Apr 30, 2025):
We need custom model parameter settings in OpenWebUI. Adding some simple parameters through Functions complicates model management process.
@TheDropZone commented on GitHub (Apr 30, 2025):
The "Think" or "Reason" toggles are becoming fairly standard on AI chat interfaces and apps alike. I think a toggle such as that (or potentially enhanced with a dropdown, on the toggle, to fine-tune the thinking effort/level on models that support it) would address a lot of the before mentioned desires, in a user friendly way, that is standard with what users are coming to expect with AI chat interfaces
@cpwan commented on GitHub (Apr 30, 2025):
In fact, they can be different models under the button. For instance, deepseek v3 and deepseek r1 are different models even it is rendered as a button toggle.
@1790374044 commented on GitHub (Apr 30, 2025):
Now different models have different ways to enable reasoning.
How to make a toggle work with different models may be a complicated challenge.
(;′⌒`)
@TheDropZone commented on GitHub (Apr 30, 2025):
Ideally, it would be actioned by the standard openai "reasoning" field, with the effort object. But, openai reasoning.effort doesn't support disabling currently, just low/medium/high. So yah, being flexible for various models will be the hard part.
But I do think the think/reason toggle, from a ui perspective, is the way to go in terms of user experience
@At87668 commented on GitHub (May 1, 2025):
I think could let an administrator to configure the thinking option for the model,
can turn it on/off, or turn it on to use another thinking model.
The think option is not displayed by default.
@dongs0104 commented on GitHub (May 1, 2025):
@1790374044 that's true
There are several publicly available hybrid thinking models, but a standard has not been established yet.
https://huggingface.co/nvidia/Llama-3_3-Nemotron-Super-49B-v1
https://huggingface.co/NousResearch/DeepHermes-3-Llama-3-8B-Preview
I don’t think this feature will follow an official API standard, but I believe Qwen’s approach could be adopted as the de facto standard.
@EntropyYue commented on GitHub (May 11, 2025):
Perhaps we can use a function to add custom buttons (similar to enabling a filter when pressed, and if they are checked in the model settings interface, they will be displayed
Because they function like filters, we can fully customize their behavior after pressing the button, such as adding a sentence to enable or disable inference when prompted by the system
@ssakar commented on GitHub (May 11, 2025):
How would you handle the fact that in thinking and non-thinking mode, different sampling parameters are recommended?
@kenvix commented on GitHub (May 11, 2025):
It looks like this must be done by removing the parameter
--enable-reasoning --reasoning-parser deepseek_r1on the vllm side, or else it will cause the output to be mistakenly thought of as thinking@fifiand1 commented on GitHub (May 13, 2025):
openwebui是否可以加个按钮,实现自动给用户prompt尾部添加/no_think或/think
@dongfangzan commented on GitHub (May 15, 2025):
How about this one?

Add a swtich checkbox on model edit page to enable switching think/non-think mode
Then add a think button on message input

For other models that do not support switching between thinking/non-thinking modes, there does not exist the Thinking button.
If anyone were interested in this solution, I could submit the code.
@MicahZoltu commented on GitHub (May 15, 2025):
For prompting, I would want the switch on the chat window or model selector, not buried deep in the model details. Perhaps the model details page could have configuration on how to apply the switch (
/thinkand/no_thinkfor qwen3).Of more interest to me though would be Open Web UI turning off thinking for certain operations automatically, like for summary generation.
@EntropyYue commented on GitHub (May 15, 2025):
@dongfangzan I'm interested in this, can you upload to github?
@MicahZoltu commented on GitHub (May 15, 2025):
I just tested to verify, title and tag generation at the least don't work without putting
/no_thinkin the prompts that are used. I'm guessing because the output ends up not being formatted like the prompt declares because of the extra<thinking></thinking>. Also, thinking is much slower and unnecessary (waste of resources) for title and tag generation. Being able to teach OpenWebUI how to enable/disable thinking for each model on a per-query basis would allow OpenWebUI to fix this problem automatically.@MicahZoltu commented on GitHub (May 15, 2025):
For image and code generation, I would like the model to think deeply, but I believe things will break if the output includes the
<thinking></thinking>tags. This is another situation where it feels like OpenWebUI should be aware of how models think and filter that out of the final response.@1790374044 commented on GitHub (May 15, 2025):
I'm sorry if I offended you.
If I understand correctly, is this solution only effective for qwen3?
If it is a solution limited to qwen3, might open-webui not accept such a pr?
>︿<
@dongfangzan commented on GitHub (May 15, 2025):
No, any model can be effective with this solution if they used the same parameter
enable_thinking: true. However, for now there is only one model which support switching thinking/non-thinking modes.You can have a look at the qwen3 Offical document below.
Nevermind whether open-webui could accept this pr, I've used it in my production.
@1790374044 commented on GitHub (May 15, 2025):
In fact, there are some other models. For example,Claude 3.7 Sonnet, Llama-3_3-Nemotron-Super-49B-v1
...( _ _)ノ|
@dongfangzan commented on GitHub (May 15, 2025):
Alright, I really didn't notice that. Most of my works are related to Qwen. This is indeed a difficult problem to solve if there is not a standard API.
@1790374044 commented on GitHub (May 15, 2025):
Actually, I've been curious for a long time...
Why not place some dynamically generated buttons next to the "Web Search" button based on the
Filterused?Clicking the button would open a pop-up window containing a toggle switch and configuration options for the
Filter.Does this sound like it could serve as a fallback solution for adapting models?
¯\_(ツ)_/¯
@tjbck commented on GitHub (May 16, 2025):
This will be implemented as a subtype of a Filter Function. There's too much variation in how all the different model providers handle "reasoning" model toggle from the backend, hard coding any params directly to our backend middleware is almost pointless. We'll revisit this approach once the ecosystem matures a bit more.
@tjbck commented on GitHub (May 16, 2025):
Toggle Filter support has been added to dev.
e.g.)
@MicahZoltu commented on GitHub (May 17, 2025):
Is there information somewhere on how a user can utilize this filter feature to enable/disable thinking in qwen3?
Should I open a new separate issue for the problem of thinking models breaking a lot of features in the UI like tag generation, title generation, image prompting, and code generation?
@yazon commented on GitHub (May 23, 2025):
Disables thinking for Qwen3 (by default is is enabled).
@Benchangatrul284 commented on GitHub (May 23, 2025):
You can use two filter functions to make default as non-thinking mode and toggle it to thinking mode
First function: automatically add /no_think after user prompt
And another function to add "Thinking button" (removing all /no_think tag in the user prompt)
remember to set the first function to higher priority (smaller number) so that it executes first
@nickyisadog commented on GitHub (Jun 16, 2025):
same....
no reason to use reasoning to generate title...
@ZV-Liu commented on GitHub (Jul 23, 2025):
Assume your Filter class is defined as previously corrected:
class Filter:
class Valves(BaseModel):
pass
body["chat_template_kwargs"]=[
"enable_thinking"
] = enable_thinking_for_llm
@gaby commented on GitHub (Aug 1, 2025):
@tjbck This issue was close as completed but I can't find the option in the latest Open-WebUI release?
This is affecting models like Qwen3 and ExaOne, they both do not have the
<think>tag at the beginning so the reasoning content shows as output to the users.@rgaricano commented on GitHub (Aug 1, 2025):
This can of model issues should be managed by model provider, in ollama repo there are some threads opened about, e.g. https://github.com/ollama/ollama/issues/10929
Is an issue related with model versions compatibilities, and have not sense patch here and patch in ollama (or other providers).
By the way, if it's necessary use filter for specific model issues.
@MicahZoltu commented on GitHub (Aug 1, 2025):
I am using
Qwen3:30-a3bviaollamaand thinking works. I haven't fiddled withenable_thinkingthough. I do get thinking hidden in the thinking blocks.@gaby commented on GitHub (Aug 1, 2025):
In my case the backend is vLLM v0.10.0, not ollama. Adding
enable_thinkingdoes make the model reason, but thereasoning_contentalways shows in the chat mixed with the response, and we never get the "Thinking...".@gaby commented on GitHub (Aug 11, 2025):
Anyone knows how to make a
dropdownwith options for reasoning effort? I followed the docs but it doesn't show up in the UI only in the admin panel