Skip to content

[Misc] Provide a DeepSeek ReasoningParser with thinking enabled by default#33221

Merged
DarkLight1337 merged 4 commits intovllm-project:mainfrom
chaunceyjiang:DeepSeekV3ReasoningWithThinkingParser
Jan 28, 2026
Merged

[Misc] Provide a DeepSeek ReasoningParser with thinking enabled by default#33221
DarkLight1337 merged 4 commits intovllm-project:mainfrom
chaunceyjiang:DeepSeekV3ReasoningWithThinkingParser

Conversation

@chaunceyjiang
Copy link
Copy Markdown
Collaborator

@chaunceyjiang chaunceyjiang commented Jan 28, 2026

Purpose

Provide a DeepSeek ReasoningParser with thinking enabled by default.

Avoid a large amount of duplicated code.

Test Plan

Test Result


Essential Elements of an Effective PR Description Checklist
  • The purpose of the PR, such as "Fix some issue (link existing issues this PR will resolve)".
  • The test plan, such as providing test command.
  • The test results, such as pasting the results comparison before and after, or e2e results
  • (Optional) The necessary documentation update, such as updating supported_models.md and examples for a new model.
  • (Optional) Release notes update. If your change is user facing, please update the release notes draft in the Google Doc.

…fault

Signed-off-by: chaunceyjiang <chaunceyjiang@gmail.com>
@mergify mergify bot added the deepseek Related to DeepSeek models label Jan 28, 2026
…fault

Signed-off-by: chaunceyjiang <chaunceyjiang@gmail.com>
Copy link
Copy Markdown
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 is a solid refactoring effort. It introduces a new DeepSeekV3ReasoningWithThinkingParser to consolidate logic for models that require 'thinking' to be enabled by default, such as glm45, holo2, and kimi_k2. This change effectively reduces code duplication by removing three redundant parser files. The implementation correctly maintains the intended behavior while improving the codebase's maintainability. The changes are well-executed and I don't see any issues.

@chaunceyjiang chaunceyjiang mentioned this pull request Jan 28, 2026
5 tasks
@chaunceyjiang chaunceyjiang added the ready ONLY add when PR is ready to merge/full CI is needed label Jan 28, 2026
@chaunceyjiang
Copy link
Copy Markdown
Collaborator Author

/cc @DarkLight1337 PTAL.

@DarkLight1337 DarkLight1337 merged commit 8e5e40d into vllm-project:main Jan 28, 2026
40 checks passed
@chaunceyjiang chaunceyjiang deleted the DeepSeekV3ReasoningWithThinkingParser branch January 28, 2026 14:18
apd10 pushed a commit to apd10/vllm that referenced this pull request Jan 31, 2026
…fault (vllm-project#33221)

Signed-off-by: chaunceyjiang <chaunceyjiang@gmail.com>
PiratePai pushed a commit to PiratePai/epd_shm that referenced this pull request Feb 3, 2026
…fault (vllm-project#33221)

Signed-off-by: chaunceyjiang <chaunceyjiang@gmail.com>
Signed-off-by: PiratePai <416932041@qq.com>
Signed-off-by: Pai <416932041@qq.com>
ItzDEXX pushed a commit to ItzDEXX/vllm that referenced this pull request Feb 19, 2026
…fault (vllm-project#33221)

Signed-off-by: chaunceyjiang <chaunceyjiang@gmail.com>
he-yufeng added a commit to he-yufeng/vllm that referenced this pull request Mar 14, 2026
GLM4 MoE (vllm-project#37023):
PR vllm-project#33221 replaced the dedicated Glm4MoeModelReasoningParser with the
generic DeepSeekV3ReasoningWithThinkingParser, which delegates to R1.
R1 treats tagless text as reasoning, but GLM4 injects <think> via the
chat template, so tagless output means the model chose not to reason.
Add Glm4MoeReasoningParser that returns (None, content) when </think>
is absent, matching the expected semantics.

SeedOSS (vllm-project#37022):
The streaming path in BaseThinkingReasoningParser returns content for
tagless text, but SeedOSS (like R1) may not emit the start token. Add
the same R1-style streaming override so tagless streaming text is
correctly classified as reasoning.

Fixes vllm-project#37023, fixes vllm-project#37022

Signed-off-by: Yufeng He <40085740+he-yufeng@users.noreply.github.com>
he-yufeng added a commit to he-yufeng/vllm that referenced this pull request Mar 15, 2026
GLM4 MoE (vllm-project#37023):
PR vllm-project#33221 replaced the dedicated Glm4MoeModelReasoningParser with the
generic DeepSeekV3ReasoningWithThinkingParser, which delegates to R1.
R1 treats tagless text as reasoning, but GLM4 injects <think> via the
chat template, so tagless output means the model chose not to reason.
Add Glm4MoeReasoningParser that returns (None, content) when </think>
is absent, matching the expected semantics. Empty reasoning (<think></think>)
is normalized to None.

SeedOSS (vllm-project#37022):
The streaming path in BaseThinkingReasoningParser returns content for
tagless text, but SeedOSS (like R1) may not emit the start token. Add
the same R1-style streaming override so tagless streaming text is
correctly classified as reasoning.

Fixes vllm-project#37023, fixes vllm-project#37022

Signed-off-by: Yufeng He <40085740+he-yufeng@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

deepseek Related to DeepSeek models 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.

2 participants