You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The Thinking indicator never shows up if using the Deepseek API or OpenRouter (via OpenAI compatibility):
Config:
{
"name": "deepseek-ai/DeepSeek-R1",
"modelUrl": "https://huggingface.co/deepseek-ai/DeepSeek-R1-Distill-Qwen-32B",
"websiteUrl": "https://deepseek.com/",
"logoUrl": "https://huggingface.co/datasets/huggingchat/models-logo/resolve/main/deepseek-logo.png",
"description": "The first reasoning model from DeepSeek. Outperforms OpenAI GPT-4-o1 on multiple benchmarks.",
"reasoning": {
"type": "tokens",
"beginToken": "<think>",
"endToken": "</think>"
},
"promptExamples": [
{
"title": "Rs in strawberry",
"prompt": "how many R in strawberry?"
},
{
"title": "Larger number",
"prompt": "9.11 or 9.9 which number is larger?"
},
{
"title": "Measuring 6 liters",
"prompt": "I have a 6- and a 12-liter jug. I want to measure exactly 6 liters."
}
],
"endpoints": [
{
"type": "openai",
"baseURL": "https://openrouter.ai/api/v1",
"apiKey": "<API KEY REMOVED>"
}
]
},
The problem is DeekSeek API returns the reasoning in a separate reasoning_content field in the response.
As far as I can tell, none of the three existing methods will work to read this extra field in the response.
tokens
summary
regex
Example streaming response:
from openai import OpenAI
client = OpenAI(api_key="<DeepSeek API Key>", base_url="https://api.deepseek.com")
# Round 1
messages = [{"role": "user", "content": "9.11 and 9.8, which is greater?"}]
response = client.chat.completions.create(
model="deepseek-reasoner",
messages=messages,
stream=True
)
reasoning_content = ""
content = ""
for chunk in response:
if chunk.choices[0].delta.reasoning_content:
reasoning_content += chunk.choices[0].delta.reasoning_content # This is where the reasoning content is
else:
content += chunk.choices[0].delta.content
Please add support for DeepSeek API and OpenRouter API by adding an additional parameter to parse an extra field in the response for reasoning.
The text was updated successfully, but these errors were encountered:
Hi thanks for opening this! Yeah this is not ideal since the way we currently handle reasoning is directly on the token stream (find begin/end tokens, things like that) which is endpoint agonistic but this would require endpoint specific-code.
Not yet sure what the best way to tackle this is, I'm open to suggestions!
The Thinking indicator never shows up if using the Deepseek API or OpenRouter (via OpenAI compatibility):
Config:
The problem is DeekSeek API returns the reasoning in a separate
reasoning_content
field in the response.As far as I can tell, none of the three existing methods will work to read this extra field in the response.
Example streaming response:
Please add support for DeepSeek API and OpenRouter API by adding an additional parameter to parse an extra field in the response for reasoning.
The text was updated successfully, but these errors were encountered: