-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Feature] reasoning_content
in API for reasoning models like DeepSeek R1
#12468
Comments
For DeepSeek series models, this means we could shift the Current output format:
|
So this does break OpenAI compatibility but I think it is the right time to break it. Do you have suggestion on how to automatically figure out the |
The OpenAI Python library still runs fine, even if we’re kinda messing with the compatibility a bit. I think we could keep it more general since the token might change for different models. I'm diving into the OpenAI server wrappers to raise a basic design proposal here. from openai import OpenAI
client = OpenAI(api_key="", base_url="https://api.deepseek.com")
messages = [{"role": "user", "content": "9.11 and 9.8, which is greater?"}]
response = client.chat.completions.create(
model="deepseek-reasoner",
messages=messages
)
+ reasoning_content = response.choices[0].message.reasoning_content
content = response.choices[0].message.content |
This would also be great to have when we are trying to get structured outputs from content without trying to parse the reasoning output. seconded +1 |
@arunpatala Hi, could you please explain more about the use case? |
Its just to make sure that if we provide JSON schema for the output to follow, we specify the following using OpenAI API:
Just want to make sure the thinking tokens are seperated from the main content and the main content follows the schema. Maybe this is already how it is being implemented. |
Hey @simon-mo, I was thinking it might be cool to create a new abstraction called We could have a specific implementation like And we need to add two CLI arguments to vllm serve deepseek-ai/DeepSeek-R1-Distill-Qwen-1.5B \
--enable-reasoning \
--reasoning-parser deepseek_r1 \ One key insight is that the What do you think? |
I don’t think it will work because the structured output engine, like xgrammar, sets the logits for the reasoning tokens to −∞. As a result, the output from the LLMEngine doesn't include the reasoning content.
Do you have some suggestions about it? |
Here are the proposed changes: #12473 |
This is not available yet, isn't it?
This is the full command I'm launching:
|
Hi, it does not work with v0.7.0. Perhaps you could try using |
I tried using latest before "v0.7.0" and it didn't work either. I think this is still not released. |
Yeah, it's not released yet. You need to use latest code, not latest release. (i.e. you need to use the docker image after 0.7.0) |
🚀 The feature, motivation and pitch
To better support reasoning models like DeepSeek-R1, adding a
reasoning_content
parameter to the API would be great so that users can see the steps in the reasoning process.Ref sgl-project/sglang#3043
Alternatives
No response
Additional context
No response
Before submitting a new issue...
The text was updated successfully, but these errors were encountered: