mirror of
https://github.com/open-webui/open-webui.git
synced 2026-07-16 06:03:26 -05:00
[GH-ISSUE #9421] <thinking> breaks the current thinking feature. #31029
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 @EliEron on GitHub (Feb 5, 2025).
Original GitHub issue: https://github.com/open-webui/open-webui/issues/9421
Originally assigned to: @tjbck on GitHub.
Bug Report
If a model outputs the specific tag <thinking> it triggers the thinking mode in Open-Webui, but for some reason the closing </thinking> does not end the thinking mode. Leading Open-Webui to just endlessly treat the model as thinking.
On top of that the thinking mode sometimes triggers a word or two late, meaning part of the output is placed before the thinking section rather than within it.
This bug was encountered on the latest version v0.5.9. The one that explicitly makes some changes to the thinking code.
Installation Method
Installed via Docker.
Environment
Confirmation:
Expected Behavior:
The thinking mode should end as soon as the </thinking> tag is encountered.
And in general, even if no ending tag was found it should end when the model finishes its output. Not spin infinitely waiting for it to end.
Actual Behavior:
It last forever even after encountering the </thinking> tag
Description
Reproduction Details
Steps to Reproduce:
Make a request that will cause the model to output its thoughts within <thinking> tags.
Something as simple as using this as a system message will usually be enough:
Before responding output your thoughts within <thinking> tags.Logs and Screenshots
Screenshots/Screen Recordings (if applicable):
https://github.com/user-attachments/assets/dbfeb205-212c-45a4-8d71-8eeaa13b2dee
Demonstrates both of the issues of tokens appearing outside the thinking section and the thinking never ending.
Additional Information
I have a number of COT system prompts that instruct models to use <thinking> tags for their COT output, which predates the recent waves of deep thinking models. This is why I encountered the bug.
@stupid-ve commented on GitHub (Feb 5, 2025):
I can't even see the thinking process. I'm using 0.5.9,Win11 and Chrome. I changed model and when them think it's just the line shinning. Also the Code Interpreter keep showing it's analyzing the code after the reply appears.
@LorenzoBoccaccia commented on GitHub (Feb 5, 2025):
same here, both with Nova as pipeline model with pipeline side tools
and with nova as litellm model with "native" function calling:
may be that the end tag is tokenized differently than expected?
@spammenotinoz commented on GitHub (Feb 5, 2025):
Hi, just curious using the main branch, I don't see the Thinking with o3 or R1 do you need a custom system prompt to enable the thinking step.
@stupid-ve commented on GitHub (Feb 5, 2025):
Hi Ive read ur comment and I m using lm studio as an api for the webui. I can see it showing the model thinks in lm but not in the webui . Before i updated to the newest version i could see the thoughts. So i think it doesnt need custom prompt. Maybe i did sth wrong myself during the update process.
@tjbck commented on GitHub (Feb 5, 2025):
Should be addressed with
648878782b, 0.5.10 will be released shortly.@spammenotinoz commented on GitHub (Feb 5, 2025):
Hi Tim, I still do not see reasoning\thinking when using o series models, with v0.5.10.
Have cleared cookies\refreshed browser. Is there something I need to do to enable?
I am not using any tools for functions.
@sid-6581 commented on GitHub (Feb 6, 2025):
I'm also not seeing any reasoning/thinking when using R1 through OpenRouter with Open WebUI. When I use the OpenRouter web interface I see the thinking, but in WebUI it just sits there forever and then gives me the answer with none of the reasoning in the output anywhere.
Edit: I'm on 0.5.10 as well.
@stupid-ve commented on GitHub (Feb 6, 2025):
Are you guys using LM studio?
@sid-6581 commented on GitHub (Feb 6, 2025):
I use LM Studio, but I haven't connected Open WebUI to it. LM Studio shows the thinking for all the R1 models I've tried.
@stupid-ve commented on GitHub (Feb 6, 2025):
I don't know how to solve your situation, but for myself, I'm using it as an api. I found out that in LM studio settings, there is a check-box in the Developer section called "When applicable, separate reasoning_content and content in API responses."
By deselect it this, the thinking for all my models can be showed in Open-webui.
But since u r not connecting it to the open webui, i don't know how to solve this situation. But I think the problem might be similar. Hope it can give you some help finding the problem.
@EliEron commented on GitHub (Feb 6, 2025):
R1 not showing thinking tokens is a known issue, and one that tjbck has explicitly stated they don't intend to fix currently.
The gist of the issue is that R1 returns the thinking tokens separately from the content itself using a field called
reasoning_content. Since that deviates from the standard OpenAI spec which Open-WebUi generally follows tjbck does not want to support it.There is a workaround which is to use a pipe function. If you are using OpenRouter then you can use the function found in this github. If you are using the DeepSeek API itself you can use this function. They need different functions since OpenRouter has also gone with a slightly different design for how they deliver thinking tokens.
In either case once configured the function will add a new model to your model list which will act exactly as the normal R1 endpoint but will show the thinking tokens properly.
@spammenotinoz commented on GitHub (Feb 6, 2025):
Thank-you, that function works really well!!
I can't get the thinking to appear with o series via LITELLM or going direct is there a trick?
@EliEron commented on GitHub (Feb 7, 2025):
No, there are no tricks for that.
OpenAI does not supply thinking tokens via their API, and there is no way to enable them. When they launched the o-series of models they stated they would not supply the full thinking output due to worries about various, things including maintaining their competitive edge.
Now that there are other popular deep thinking models that do provide the output I suspect they'll revisit that decision, but for now there is no way to access the thinking tokens.
@boshk0 commented on GitHub (Apr 23, 2025):
I confirm this bug is still present.
Open WebUI 0.6.4
Ollama 0.6.5
Model: qwq:32b-q4_K_M
@EstrianTech commented on GitHub (Apr 23, 2026):
Bug is still present. gemma4
@Yam9032 commented on GitHub (Apr 25, 2026):
Can confirm its still broken using Gemma 4 26B A4B with llama.cpp.