mirror of
https://github.com/open-webui/open-webui.git
synced 2026-05-07 03:18:23 -05:00
[GH-ISSUE #13343] feat: A toggle for assuming the initial model output is reasoning inside <think> tags. #16890
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 @zwvx on GitHub (Apr 30, 2025).
Original GitHub issue: https://github.com/open-webui/open-webui/issues/13343
Check Existing Issues
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:
And the chat output can be misinterpreted like this (treating the reasoning as the start of the 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
@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
@tjbck commented on GitHub (Apr 30, 2025):
#13314