Repository navigation
[Frontend] Omit absent fields from /inference/v1/generate stream chunks - #57264
Merged
DarkLight1337 merged 2 commits intoSep 17, 2026
Merged
Conversation
aoshen02
requested review from
AndreasKaratzas,
BugenZhao,
DarkLight1337,
NickLucche,
aarnphm,
njhill and
robertgshaw2-redhat
as code owners
September 17, 2026 01:06
Follow-up to vllm-project#53187. Python stream chunks serialized absent optional fields as null except for the two prompt-metadata keys, which vllm-project#53187 excluded per-field; the Rust frontend omits every absent field via skip_serializing_none, and the Python final usage chunk already uses exclude_none. Serialize all Python data chunks with exclude_none so the two frontends emit the same JSON and the per-field special case goes away. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Signed-off-by: aoshen02 <aoshen@inferact.ai>
aoshen02
force-pushed
the
generate-stream-null-parity
branch
from
September 17, 2026 01:18
1ddcbce to
98ad990
Compare
DarkLight1337
approved these changes
Sep 17, 2026
DarkLight1337
enabled auto-merge (squash)
September 17, 2026 04:25
Member
|
/ci run |
|
❌ This PR is 16 commits behind upstream |
Member
|
/ci run |
|
✅ Triggered Buildkite CI #89535 for commit |
Contributor
Author
|
Sorry cyrus, it's not ready yet. |
1 task done
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
Follow-up to #53187. Python
/inference/v1/generatestream chunks serialized absent optional fields asnull, except for the two prompt-metadata keys that #53187 excluded per-field. The Rust frontend omits every absent field (skip_serializing_none), and the Python final usage chunk already usesexclude_none=True.Serialize all Python data chunks with
exclude_none=Trueso:usage,logprobs,finish_reason,prompt_token_ids,mm_placeholdersare omitted, notnull);excludespecial case from [Frontend] Return prompt metadata from /inference/v1/generate #53187 goes away;Non-streaming responses are unchanged on both sides. Clients that read
chunk["finish_reason"]on non-final Python chunks must use.get(); the OpenAI-style clients and prime-rl's generate client already do.Why this is not a duplicate
Searched open PRs for
exclude_none,skip_serializing_none,generate streamandtoken_in_token_out. #47933 changes abortfinish_reasonon this path but not serialization; no overlap. Independent of #57265 (empty-chunk skip rule).Test Plan
test_stream_chunks_omit_absent_fields; existing key-absence assertions for the metadata fields unchanged.stream_chunk_omits_absent_fieldsunit test locking the existingskip_serializing_nonecontract.Test Result
Model evaluation is not applicable: wire-format-only change, generated tokens are unchanged.
Developed with AI assistance (Claude Code); the human submitter has reviewed every changed line.
🤖 Generated with Claude Code