Repository navigation
Conversation
Python's SamplingParams collects every logit_bias key that is not an integer and names all of them in one 400. Rust stopped at the first bad key in HashMap order, so the reported key was arbitrary and the others were hidden. Collect them all and sort them for a stable message. Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Bugen Zhao <i@bugenzhao.com>
…inst the Rust frontend test_chat_logit_bias_multiple_non_integer_keys asserts that the 400 names every invalid key, which the Rust frontend now does. Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Bugen Zhao <i@bugenzhao.com>
6 tasks done
Isotr0py
approved these changes
Oct 23, 2026
Member
Author
|
/ci run |
|
✅ Triggered Buildkite CI #96852 for commit ℹ️ This PR is 1 commit behind upstream |
BugenZhao
added a commit
to BugenZhao/vllm
that referenced
this pull request
Oct 23, 2026
…26-10-22-e2e Resolve the .buildkite/test_areas/rust_frontend.yaml conflict with vllm-project#63313 by keeping this branch's step list and taking vllm-project#63313's removal of -k "not multiple" from the logit bias validation test. Signed-off-by: Bugen Zhao <i@bugenzhao.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DuEV4Temoctig8sAjQHcFP
bantianyue
pushed a commit
to bantianyue/vllm
that referenced
this pull request
Oct 28, 2026
…-project#63313) Signed-off-by: Bugen Zhao <i@bugenzhao.com> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> Co-authored-by: vllm-agent <claw@inferact.ai>
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.
Overview
When several
logit_biaskeys are not token IDs, Python returns one 400 naming all of them. The Rust frontend stops at the first key that fails to parse, and since the request map is aHashMap, which key it reports is arbitrary. This PR reports every invalid key, and enables the Python test that pins it in the Rust frontend CI.Claims
logit_bias: {"bad1": 50.0, "bad2": 20.0}on chat or completions returns one 400 withparam = "logit_bias"naming both keys, in sorted order:logit_bias contains key(s) that are not valid token IDs: ["bad1", "bad2"]. Token IDs must be non-negative integers.test_chat_logit_bias_validation.py::test_chat_logit_bias_multiple_non_integer_keysnow passes under the Rust frontend and runs in the Rust OpenAI Coverage step.Validation
Commands from
.buildkite/scripts/run-rust-frontend-cargo-ci.sh(style-clippyandtest), run from the repo root:utils::tests::convert_logit_bias_reports_all_invalid_keysuses keysbad2,7,bad1and-1and snapshots the error, which names-1,bad1andbad2in sorted order. With the old function it fails, naming only the first key the map yields.convert_logit_bias_converts_valid_keyscovers the success path.vllm-rsbuilt from this branch,VLLM_USE_RUST_FRONTEND=1:pytest entrypoints/openai/chat_completion/test_chat_logit_bias_validation.py: 4 passed.Details
Python's
SamplingParams.from_optionalconverts each key withint(), collects every failure, and raises oneVLLMValidationError(param="logit_bias"). In Rust, string keys exist only in the OpenAI JSON wire format: gRPC carries amap<uint32, float>andvllm-texttakesHashMap<u32, f32>. So the HTTP DTO lowering (convert_logit_biasinrust/src/server/src/utils.rs, shared by chat and completions) is the only consumer of string keys, and the existing function now collects errors instead of returning on the first.Difference kept: a negative key such as
"-1"passes Python'sint()and is then rejected by the vocabulary check with a different message; Rust token IDs areu32, so Rust reports"-1"with the other invalid keys. Both are a 400 withparam = "logit_bias".The second commit drops
-k "not multiple"from the Rust OpenAI Coverage step in.buildkite/test_areas/rust_frontend.yaml.Not a duplicate: no open PR changes Rust
logit_biasvalidation.AI assistance (Claude Code) was used to prepare this change; the human submitter reviewed every changed line.
🤖 Generated with Claude Code
https://claude.ai/code/session_012jJ3QaARmRe3jZJYTfHsCB
Pull Request Checklist
I used vLLM's
/pr-checklistskill. (Mandatory for agents, optional for humans).AI assistance was used during the creation of this PR.
Design Fit: Minimizes impact on core components, reuses existing functionality, and justifies added complexity.
Testing and Validation: Validates the change and ensures any added tests are meaningful and reliable, with CI coverage or documented CI resource constraints and validation performed outside CI.
Code Quality and Style: Keeps code and comments clear and concise, and updates relevant documentation and examples.
Pull Request Contents: Includes a brief summary and relevant links, supports claims with evidence, explains root causes and implementation trade-offs, and follows the contributing guide.