[GH-ISSUE #13343] feat: A toggle for assuming the initial model output is reasoning inside <think> tags. #32419

Closed
opened 2026-04-25 06:20:07 -05:00 by GiteaMirror · 2 comments
Owner

Originally created by @zwvx on GitHub (Apr 30, 2025).
Original GitHub issue: https://github.com/open-webui/open-webui/issues/13343

Check Existing Issues

  • I have searched the existing issues and discussions.

Problem Description

Models with prompt chat templates that already prepend the <think> tag can make it ambiguous whether the model is actually using reasoning or not. Therefore, Open-WebUI might assume that the completion does not contain reasoning within the <think> tags.

This problem mostly affects third-party API services hosting open-source models. If individuals use local LLMs, they can just edit the chat template inside tokenizer_config.json.

This is a chat template that already prepends the tag:

{% if add_generation_prompt and not ns.is_tool %}{{'<|Assistant|><think>\\n'}}{% endif %}

And the chat output can be misinterpreted like this (treating the reasoning as the start of the actual chat):

Reasoning....
</think>

Actual chat....

Desired Solution you'd like

Add a toggle option (maybe a simple checkbox or similar) to indicate whether the model's output is expected to start with reasoning inside <think> tags.

I'm aware this behavior can be handled using a Function Script, a simpler, built-in way to manage this would be very helpful.

Alternatives Considered

This problem can be fixed temporarily using a Function Script. Additionally, this issue is perhaps unique to only certain models, like the DeepSeek-R1 variants.

Another alternative fix would be to let users use existing plug-in, add-on, or Function Script to modify (or "monkey-patch") the API request handling and make this issue as wontfix.

Additional Context

https://huggingface.co/deepseek-ai/DeepSeek-R1/blob/main/tokenizer_config.json

Originally created by @zwvx on GitHub (Apr 30, 2025). Original GitHub issue: https://github.com/open-webui/open-webui/issues/13343 ### Check Existing Issues - [x] I have searched the existing issues and discussions. ### Problem Description Models with prompt chat templates that already prepend the `<think>` tag can make it ambiguous whether the model is actually using reasoning or not. Therefore, Open-WebUI might assume that the completion does not contain reasoning within the `<think>` tags. This problem mostly affects third-party API services hosting open-source models. If individuals use local LLMs, they can just edit the chat template inside `tokenizer_config.json`. This is a chat template that already prepends the tag: ```Jinja2 {% if add_generation_prompt and not ns.is_tool %}{{'<|Assistant|><think>\\n'}}{% endif %} ``` And the chat output can be misinterpreted like this (treating the reasoning as the start of the actual chat): ``` Reasoning.... </think> Actual chat.... ``` ### Desired Solution you'd like Add a toggle option (maybe a simple checkbox or similar) to indicate whether the model's output is expected to start with reasoning inside `<think>` tags. I'm aware this behavior can be handled using a Function Script, a simpler, built-in way to manage this would be very helpful. ### Alternatives Considered This problem can be fixed temporarily using a Function Script. Additionally, this issue is perhaps unique to only certain models, like the DeepSeek-R1 variants. Another alternative fix would be to let users use existing plug-in, add-on, or Function Script to modify (or "monkey-patch") the API request handling and make this issue as `wontfix`. ### Additional Context [https://huggingface.co/deepseek-ai/DeepSeek-R1/blob/main/tokenizer_config.json](https://huggingface.co/deepseek-ai/DeepSeek-R1/blob/main/tokenizer_config.json)
Author
Owner

@dhn9132 commented on GitHub (Apr 30, 2025):

Now Ali has launched qwen3, the whole series are hybrid reasoning models, I think it is necessary to develop a deep thinking selection button in the chat interface of open-webui

<!-- gh-comment-id:2841185995 --> @dhn9132 commented on GitHub (Apr 30, 2025): Now Ali has launched qwen3, the whole series are hybrid reasoning models, I think it is necessary to develop a deep thinking selection button in the chat interface of open-webui
Author
Owner

@tjbck commented on GitHub (Apr 30, 2025):

#13314

<!-- gh-comment-id:2841328075 --> @tjbck commented on GitHub (Apr 30, 2025): #13314
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/open-webui#32419