Support `<think />` tags from R1
Before submitting your bug report
- [ ] I believe this is a bug. I'll try to join the Continue Discord for questions
- [ ] I'm not able to find an open issue that reports the same bug
- [ ] I've seen the troubleshooting guide on the Continue Docs
Relevant environment info
Description
DeepSeek-R1 model produces <think /> tags that we can parse and render in a nicer UI than the default Think... text that we use for reasoning models like o1 that don't expose their reasoning steps.
Example implementation from chat.deepseek.com
To reproduce
No response
Log output
Is this already being worked on, to remove the think from the chat window, (show hide) also make sure its not being sent back into the regular context window for follow up messages?
https://github.com/continuedev/continue/pull/3840 Waiting for review
@germankrause I'm using the current pre-release 0.9.259 with OpenRouter:
{
"title": "DeepSeek R1",
"provider": "openai",
"model": "deepseek/deepseek-r1",
"apiKey": <API_KEY>,
"completionOptions": {},
"apiBase": "https://openrouter.ai/api/v1"
},
Which works great! The output is super useful.
However, the reasoning output is not displayed. It seems that OpenRouter needs include_reasoning be set to true, or it will just skip the <think/> output: https://openrouter.ai/announcements/reasoning-tokens-for-thinking-models
Just wanted to flag this in case it's useful at this point.
Thanks for the heads up here @manmal ! Created an issue for that here: https://github.com/continuedev/continue/issues/3946
I'm using the current pre-release 0.9.259 with deepseek official api, the reasoning output is still not displayed
How do I achieve this with OpenAI-compatible API provided by Ollama plus a custom DeepSeek-based model?
- I have imported a DeepSeek-distilled Qwen model (from HuggingFace) into Ollama,
- and then served the model using Ollama's OpenAI-compatible API.
With the latest Continue, and my configuration:
{
"title": "DeepSeek-R1 Distill Qwen 7B fp16",
"provider": "openai",
"model": "ollama-ds-r1-distill-qwen-7b",
"apiBase": "http://10.103.245.111:21434/v1",
"apiKey": "ollama"
}
This is what I've got:
https://github.com/user-attachments/assets/87573e10-e81c-4ec5-a268-fac1810a0a5a
I believe this is caused by the lack of <think>/n in the prompt, or something extra added to the prompt. Running the model directly with ollama run yields amazing results, but not on Continue.
I'd be great if there is a way to customize prompts for any models. Any pointers?
Try it:
{
"models": [
{
"title": "DeepSeek R1",
"provider": "openai",
"model": "deepseek-r1",
"apiKey": "",
"apiBase": "",
"useLegacyCompletionsEndpoint": false,
"systemMessage": "# 角色定义\nrole: \"AI Assistant (DeepSeek-R1-Enhanced)\"\nauthor: \"DeepSeek\"\ndescription: >\n 通用型智能助手,通过结构化思考流程提供可靠服务。\n# 输出规范\noutput_schema:\n thinking_section: # 强制思考段落\n required: true\n tags: \"<think>\\\\n嗯{thinkContent}</think>{finalContent}\"\n content_rules:\n - 使用Markdown格式\n - 内容有效性验证:\n rules:\n - rule: \"non_empty\" # 非空验证规则"
}
]
}
This will make Deepseek start its answers with <think>, but will cause the default replies to be in Chinese. Translate systemMessage to your default language to change this.
I find that editing code or code completion takes the
{
"title": "DeepSeek-R1",
"model": "DeepSeek-R1",
"apiKey": "xxxxx",
"provider": "deepseek",
"apiBase": "https://{HOST}/v1"
},
This is the OpenAI-compatible interface I deployed with vllm
我想知道现在的渲染是如何处理think内容的,我使用groq的api是可以有"Thought for x.x. s",但我使用deepseek/siliconflow api却不可以。deepseek/siliconflow 都是将<think></think> 独立成单独的单独的 reasoning_content 字段。我不知道是否是这样处理的?
translate :
I want to know how the current rendering handles think content. When I use Groq's API, I can get "Thought for x.x. s" outputs, but this doesn't work when I use the DeepSeek/SiliconFlow API. Both DeepSeek and SiliconFlow seem to place <think></think> content in separate reasoning_content fields. I'm not sure if this is how they actually handle it?
This issue hasn't been updated in 90 days and will be closed after an additional 10 days without activity. If it's still important, please leave a comment and share any new information that would help us address the issue.
reasoning not displayed on pycharm for deep seek r1 , is it only implemented in vs code ?
I find that editing code or code completion takes the tag with it, how do I get rid of the tag.
{ "title": "DeepSeek-R1", "model": "DeepSeek-R1", "apiKey": "xxxxx", "provider": "deepseek", "apiBase": "https://{HOST}/v1" },This is the OpenAI-compatible interface I deployed with vllm
I have the same problem and I'm using Openai Compatible qwen3
This issue hasn't been updated in 90 days and will be closed after an additional 10 days without activity. If it's still important, please leave a comment and share any new information that would help us address the issue.
This issue was closed because it wasn't updated for 10 days after being marked stale. If it's still important, please reopen + comment and we'll gladly take another look!