Skip to content

Add think chunk #21333

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

Merged
merged 13 commits into from
Jul 24, 2025
Merged

Add think chunk #21333

merged 13 commits into from
Jul 24, 2025

Conversation

juliendenize
Copy link
Contributor

@juliendenize juliendenize requested a review from aarnphm as a code owner July 21, 2025 21:15
Copy link

👋 Hi! Thank you for contributing to the vLLM project.

💬 Join our developer Slack at https://slack.vllm.ai to discuss your PR in #pr-reviews, coordinate on features in #feat- channels, or join special interest groups in #sig- channels.

Just a reminder: PRs would not trigger full CI run by default. Instead, it would only run fastcheck CI which starts running only a small and essential subset of CI tests to quickly catch errors. You can run other CI tests on top of those by going to your fastcheck build on Buildkite UI (linked in the PR checks section) and unblock them. If you do not have permission to unblock, ping simon-mo or khluu to add you in our Buildkite org.

Once the PR is approved and ready to go, your PR reviewer(s) can run CI to test the changes comprehensively before merging.

To run CI, PR reviewers can either: Add ready label to the PR or enable auto-merge.

🚀

@mergify mergify bot added deepseek Related to DeepSeek models frontend labels Jul 21, 2025
Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces support for a 'think' content chunk, which seems to be used for representing reasoning steps from models like Mistral. The changes involve updating chat utilities to recognize and parse this new content type, and modifying the DeepSeekR1ReasoningParser to handle special tokens from Mistral's tokenizer.

I have raised a high-severity concern regarding the modification of DeepSeekR1ReasoningParser. Adding Mistral-specific logic to a class named and registered for DeepSeek models is a design flaw that will impact maintainability and clarity. I've recommended creating a separate parser for Mistral to keep the components clean and decoupled.

@juliendenize juliendenize force-pushed the add_think_chunk branch 2 times, most recently from 1ad0d70 to df19b71 Compare July 23, 2025 09:30
@@ -56,29 +57,44 @@ def run_reasoning_extraction(

def run_reasoning_extraction_nonstreaming(
reasoning_parser: ReasoningParser,
model_output: list[str],
model_output: Union[list[str], list[int]],
Copy link
Member

@DarkLight1337 DarkLight1337 Jul 23, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't really like how we have combined paths when the inputs are actually not valid for all tokenizers. Perhaps @aarnphm has a better idea of how to refactor this. Since @aarnphm is OOO lately, I'm fine with this for now

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added utils just for mistral so that it removes the Union, @aarnphm might have another idea but at least this avoids changing previous code.

@mgoin mgoin added the ready ONLY add when PR is ready to merge/full CI is needed label Jul 23, 2025
Copy link

mergify bot commented Jul 23, 2025

This pull request has merge conflicts that must be resolved before it can be
merged. Please rebase the PR, @juliendenize.

https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/syncing-a-fork

@mergify mergify bot added the needs-rebase label Jul 23, 2025
juliendenize and others added 7 commits July 23, 2025 23:01
Signed-off-by: Julien Denize <[email protected]>
Signed-off-by: Julien Denize <[email protected]>
Signed-off-by: Julien Denize <[email protected]>
Signed-off-by: Julien Denize <[email protected]>
Signed-off-by: Julien Denize <[email protected]>
Signed-off-by: Julien Denize <[email protected]>
Signed-off-by: Julien Denize <[email protected]>
Signed-off-by: Julien Denize <[email protected]>
Signed-off-by: Julien Denize <[email protected]>
Signed-off-by: Julien Denize <[email protected]>
Signed-off-by: Julien Denize <[email protected]>
Signed-off-by: Julien Denize <[email protected]>
Signed-off-by: Julien Denize <[email protected]>
@mergify mergify bot removed the needs-rebase label Jul 23, 2025
@simon-mo simon-mo added this to the v0.10.0 milestone Jul 23, 2025
@DarkLight1337 DarkLight1337 enabled auto-merge (squash) July 24, 2025 03:23
@simon-mo simon-mo disabled auto-merge July 24, 2025 04:51
@simon-mo simon-mo merged commit 6d8d0a2 into vllm-project:main Jul 24, 2025
97 of 98 checks passed
DW934 pushed a commit to DW934/vllm that referenced this pull request Jul 28, 2025
Signed-off-by: Julien Denize <[email protected]>
Signed-off-by: 董巍 <[email protected]>
avigny pushed a commit to avigny/vllm that referenced this pull request Jul 31, 2025
Signed-off-by: Julien Denize <[email protected]>
Signed-off-by: avigny <[email protected]>
wenscarl pushed a commit to wenscarl/vllm that referenced this pull request Aug 4, 2025
Signed-off-by: Julien Denize <[email protected]>
Signed-off-by: shuw <[email protected]>
x22x22 pushed a commit to x22x22/vllm that referenced this pull request Aug 5, 2025
Signed-off-by: Julien Denize <[email protected]>
Signed-off-by: x22x22 <[email protected]>
Pradyun92 pushed a commit to Pradyun92/vllm that referenced this pull request Aug 6, 2025
npanpaliya pushed a commit to odh-on-pz/vllm-upstream that referenced this pull request Aug 6, 2025
jinzhen-lin pushed a commit to jinzhen-lin/vllm that referenced this pull request Aug 9, 2025
Signed-off-by: Julien Denize <[email protected]>
Signed-off-by: Jinzhen Lin <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ci/build deepseek Related to DeepSeek models frontend ready ONLY add when PR is ready to merge/full CI is needed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants