[Refactor][Parser] Migrate chat completion auto-tool/reasoning/plain streaming to parse_delta#39446
Merged
chaunceyjiang merged 2 commits intovllm-project:mainfrom Apr 14, 2026
Merged
Conversation
Contributor
There was a problem hiding this comment.
Code Review
This pull request refactors the chat completion serving logic to use a unified Parser interface, simplifying the handling of streaming deltas for reasoning and tool calls. The changes include initializing a parser class via ParserManager and replacing manual delta extraction logic with parser.parse_delta. Feedback indicates a potential issue where reasoning data might be lost if a single streaming chunk contains both the end of a reasoning block and the start of a tool call, as the reasoning delta could be overwritten.
Collaborator
Author
|
PTAL @chaunceyjiang @aarnphm |
whk-lab
pushed a commit
to whk-lab/vllm
that referenced
this pull request
Apr 23, 2026
…streaming to parse_delta (vllm-project#39446) Signed-off-by: sfeng33 <4florafeng@gmail.com>
avinashsingh77
pushed a commit
to avinashsingh77/vllm
that referenced
this pull request
Apr 27, 2026
…streaming to parse_delta (vllm-project#39446) Signed-off-by: sfeng33 <4florafeng@gmail.com> Signed-off-by: Avinash Singh <avinashsingh.rcoem@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Purpose
Migrate branches in chat_completion_stream_generator (auto tool + reasoning, auto tool only, reasoning only, plain content) with unified Parser.parse_delta() calls.
Test Plan
Verified for chat completion api, there is no behaviour change:
vllm serve Qwen/Qwen3-4B --reasoning-parser qwen3 --tool-call-parser hermes --enable-auto-tool-choicevllm serve Qwen/Qwen3-4B --reasoning-parser qwen3vllm serve Qwen/Qwen3-4B --tool-call-parser hermes --enable-auto-tool-choicevllm serve Qwen/Qwen3-4B