[GH-ISSUE #11284] issue: Cannot correctly handle the think tag of qwq model #16171

Closed
opened 2026-04-19 22:10:59 -05:00 by GiteaMirror · 8 comments
Owner

Originally created by @qhjqhj on GitHub (Mar 6, 2025).
Original GitHub issue: https://github.com/open-webui/open-webui/issues/11284

Check Existing Issues

  • I have searched the existing issues and discussions.

Installation Method

Git Clone

Open WebUI Version

0.5.20

Ollama Version (if applicable)

0.5.13

Operating System

windows 11

Browser (if applicable)

No response

Confirmation

  • I have read and followed all instructions in README.md.
  • I am using the latest version of both Open WebUI and Ollama.
  • I have checked the browser console logs.
  • I have checked the Docker container logs.
  • I have listed steps to reproduce the bug in detail.

Expected Behavior

Separate thinking from formal output

Actual Behavior

The content of thinking and the content of formal output cannot be distinguished, and the formal content cannot be output

Steps to Reproduce

  1. run ollama serve
  2. run open-webui serve
  3. Open the browser and select the qwq model
  4. Ask a code-related question, such as "Write the code for the Viterbi algorithm using Python"
    When running the qwq:latest model of Ollama on the backend, the content in the tag is output as normal content, and part of the code output seems to be lost

Logs & Screenshots

Image
Image

Additional Information

No response

Originally created by @qhjqhj on GitHub (Mar 6, 2025). Original GitHub issue: https://github.com/open-webui/open-webui/issues/11284 ### Check Existing Issues - [x] I have searched the existing issues and discussions. ### Installation Method Git Clone ### Open WebUI Version 0.5.20 ### Ollama Version (if applicable) 0.5.13 ### Operating System windows 11 ### Browser (if applicable) _No response_ ### Confirmation - [x] I have read and followed all instructions in `README.md`. - [x] I am using the latest version of **both** Open WebUI and Ollama. - [x] I have checked the browser console logs. - [x] I have checked the Docker container logs. - [x] I have listed steps to reproduce the bug in detail. ### Expected Behavior Separate thinking from formal output ### Actual Behavior The content of thinking and the content of formal output cannot be distinguished, and the formal content cannot be output ### Steps to Reproduce 1. run ollama serve 2. run open-webui serve 3. Open the browser and select the qwq model 4. Ask a code-related question, such as "Write the code for the Viterbi algorithm using Python" When running the qwq:latest model of Ollama on the backend, the content in the <think> tag is output as normal content, and part of the code output seems to be lost ### Logs & Screenshots ![Image](https://github.com/user-attachments/assets/1a074a36-554e-4737-8d0f-f2dcbddfff82) ![Image](https://github.com/user-attachments/assets/81fe239d-ad85-4ba4-931c-4d4cdc8d2ee6) ### Additional Information _No response_
GiteaMirror added the bug label 2026-04-19 22:10:59 -05:00
Author
Owner

@Eidenz commented on GitHub (Mar 6, 2025):

Adding to this, it doesn't even seem to have its normal output in the thinking tag.

On my end, everything in the thinking tag seems to indeed be the thought process, but once it's done it outputs no answer, and openwebui acts as if the model was still thinking.

<!-- gh-comment-id:2703421332 --> @Eidenz commented on GitHub (Mar 6, 2025): Adding to this, it doesn't even seem to have its normal output in the thinking tag. On my end, everything in the thinking tag seems to indeed be the thought process, but once it's done it outputs no answer, and openwebui acts as if the model was still thinking.
Author
Owner

@mihkhub commented on GitHub (Mar 6, 2025):

QwQ-32b thinking tag pair "

<!-- gh-comment-id:2703769661 --> @mihkhub commented on GitHub (Mar 6, 2025): QwQ-32b thinking tag pair "<think> </think>
Author
Owner

@EntropyYue commented on GitHub (Mar 6, 2025):

It seems that the model's thinking output has been stopped before it has finished, please try increasing nun_ctx and num_predict

<!-- gh-comment-id:2703983192 --> @EntropyYue commented on GitHub (Mar 6, 2025): It seems that the model's thinking output has been stopped before it has finished, please try increasing `nun_ctx` and `num_predict`
Author
Owner

@Duxon commented on GitHub (Mar 6, 2025):

How to increase num_ctx (to 131072) in the Open-WebUI settings? I can't find that seeting.

<!-- gh-comment-id:2704088783 --> @Duxon commented on GitHub (Mar 6, 2025): How to increase `num_ctx` (to 131072) in the Open-WebUI settings? I can't find that seeting.
Author
Owner

@EntropyYue commented on GitHub (Mar 6, 2025):

If you are using en-US, it will display as Context Length

<!-- gh-comment-id:2704099849 --> @EntropyYue commented on GitHub (Mar 6, 2025): If you are using en-US, it will display as `Context Length`
Author
Owner

@qhjqhj commented on GitHub (Mar 6, 2025):

It seems that the model's thinking output has been stopped before it has finished, please try increasing nun_ctx and num_predict

I tried it several times, and the total number of tokens generated was different. It seems that the issue is not caused by the maximum length limit.

<!-- gh-comment-id:2704202626 --> @qhjqhj commented on GitHub (Mar 6, 2025): > It seems that the model's thinking output has been stopped before it has finished, please try increasing `nun_ctx` and `num_predict` I tried it several times, and the total number of tokens generated was different. It seems that the issue is not caused by the maximum length limit.
Author
Owner

@bjj commented on GitHub (Mar 6, 2025):

See #11259

<!-- gh-comment-id:2704469701 --> @bjj commented on GitHub (Mar 6, 2025): See #11259
Author
Owner

@EntropyYue commented on GitHub (Mar 6, 2025):

Please provide screenshots of other situations, which will help us better solve the problem

<!-- gh-comment-id:2704599809 --> @EntropyYue commented on GitHub (Mar 6, 2025): Please provide screenshots of other situations, which will help us better solve the problem
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/open-webui#16171