Repository navigation
[Bugfix] Reject empty logprob_token_ids and fix falsy validation in OpenAI request protocols - #57394
Open
nandan2003 wants to merge 1 commit into
Open
nandan2003 wants to merge 1 commit into
nandan2003 wants to merge 1 commit into
Conversation
nandan2003
requested review from
AndreasKaratzas,
DarkLight1337,
NickLucche,
aarnphm,
chaunceyjiang and
robertgshaw2-redhat
as code owners
September 17, 2026 14:41
nandan2003
force-pushed
the
fix-empty-logprob-token-ids
branch
from
September 17, 2026 14:44
ddcc9a2 to
7bfaace
Compare
Contributor
Author
|
Hi @DarkLight1337 , @aarnphm Could you please check on this PR when you get a chance? I believe its a clean merge. Thanks |
Contributor
|
This pull request has merge conflicts that must be resolved before it can be |
nandan2003
force-pushed
the
fix-empty-logprob-token-ids
branch
from
September 29, 2026 15:49
7bfaace to
05f1e3f
Compare
This was referenced Sep 30, 2026
Contributor
|
This pull request has merge conflicts that must be resolved before it can be |
…cols
When logprob_token_ids was provided as an empty list [], it bypassed
validation due to a boolean truthiness check (if data.get(...)). This
allowed invalid requests with logprob_token_ids=[] and logprobs=False
to pass validation, and coerced [] to None in to_sampling_params().
- Explicitly check data.get("logprob_token_ids") is not None.
- Reject empty lists with VLLMValidationError attributing parameter="logprob_token_ids".
- Defer non-list inputs immediately to let Pydantic handle type checking.
- Set min_length=1 on Field(...) to expose minItems: 1 in OpenAPI schemas.
- Add minimal, fast standalone unit tests.
Fixes vllm-project#49319
Signed-off-by: Nandan Vallamdasu <nandan.vallamdasu@outlook.com>
nandan2003
force-pushed
the
fix-empty-logprob-token-ids
branch
from
October 21, 2026 02:48
05f1e3f to
14724e5
Compare
Contributor
|
This pull request has merge conflicts that must be resolved before it can be |
This branch has not been deployed
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
Fixes #49319. Supersedes stalled PR #49320 by addressing review feedback from @NolenLiang.
In
ChatCompletionRequest,CompletionRequest, andBatchChatCompletionRequest:is not Noneand rejectlogprob_token_ids=[]withVLLMValidationError.list, letting Pydantic handle type errors cleanly without crashing onTypeError.min_length=1toField(...)so the OpenAPI schema reflectsminItems: 1.logprob_token_ids or Noneinto_sampling_params().Test Plan
Added standalone unit tests covering empty lists, non-list inputs, and missing
logprobs:Test Result
logprob_token_ids: []returned 200 OK (silently dropped to null), and non-list inputs like 1 caused a TypeError.Essential Elements of an Effective PR Description Checklist
supported_models.mdandexamplesfor a new model.