[GH-ISSUE #8875] 在ollama上运行时, 怎么才能让它不返回<think>标签 ? When running on ollama, how can I make it not return the < think > tag? #52264

Closed
opened 2026-04-28 22:45:29 -05:00 by GiteaMirror · 5 comments
Owner

Originally created by @ruochen-yyb on GitHub (Feb 6, 2025).
Original GitHub issue: https://github.com/ollama/ollama/issues/8875

Originally created by @ruochen-yyb on GitHub (Feb 6, 2025). Original GitHub issue: https://github.com/ollama/ollama/issues/8875
GiteaMirror added the question label 2026-04-28 22:45:29 -05:00
Author
Owner

@Samge0 commented on GitHub (Feb 6, 2025):

You are probably using the DeepSeek-R1 model. The tag seems to be part of the output from the DeepSeek model itself, rather than something controlled by Ollama. To avoid this tag in the output, you can try customizing the Ollama model by adding a prompt that guides the model to avoid generating the tag

<!-- gh-comment-id:2639185915 --> @Samge0 commented on GitHub (Feb 6, 2025): You are probably using the DeepSeek-R1 model. The <think> tag seems to be part of the output from the DeepSeek model itself, rather than something controlled by Ollama. To avoid this tag in the output, you can try customizing the Ollama model by adding a prompt that guides the model to avoid generating the <think> tag
Author
Owner

@ruochen-yyb commented on GitHub (Feb 6, 2025):

Vllm can be realized by specifying parameters --enable-reasoning, how long can ollama be?

<!-- gh-comment-id:2639230854 --> @ruochen-yyb commented on GitHub (Feb 6, 2025): Vllm can be realized by specifying parameters --enable-reasoning, how long can ollama be?
Author
Owner

@rick-github commented on GitHub (Feb 6, 2025):

Use a different client. For example, open-webui hides the think tag behind a spinner.

<!-- gh-comment-id:2639364828 --> @rick-github commented on GitHub (Feb 6, 2025): Use a different client. For example, open-webui hides the `think` tag behind a spinner.
Author
Owner

@jmorganca commented on GitHub (Feb 6, 2025):

Hi @ruochen-yyb as mentioned by others, the tags are output by the model. ollama run doesn't yet hide these at the moment, but others tools or clients may

<!-- gh-comment-id:2641060064 --> @jmorganca commented on GitHub (Feb 6, 2025): Hi @ruochen-yyb as mentioned by others, the <think> tags are output by the model. `ollama run` doesn't yet hide these at the moment, but others tools or clients may
Author
Owner

@titusTong commented on GitHub (Mar 19, 2025):

使用parse-reasoning包在前端处理一下。
Use the parse-reasoning package to process it on the front end.
npm install parse-reasoning

<!-- gh-comment-id:2736002746 --> @titusTong commented on GitHub (Mar 19, 2025): 使用parse-reasoning包在前端处理一下。 Use the parse-reasoning package to process it on the front end. npm install parse-reasoning
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/ollama#52264