fix(vllm_model): handle explicit null metadata in preprocessing#1727
Open
rodboev wants to merge 1 commit into
Open
fix(vllm_model): handle explicit null metadata in preprocessing#1727rodboev wants to merge 1 commit into
rodboev wants to merge 1 commit into
Conversation
Signed-off-by: Rod Boev <rod.boev@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.
responses_api_models/vllm_modelcan still crash on a valid request that explicitly sends"metadata": null, because preprocessing expects a dict and dereferences.get()on aNonevalue. This PR keepsmetadata=Noneon the same code path as omitted metadata by normalizing it to{}before any metadata lookups.This PR fixes that with a narrow adapter-only change:
metadata=Nonein_preprocess_chat_completion_create_params()_preprocess_chat_completion_create_params()directly withmetadata: Noneand asserts it returns withmetadata == {}No request schema changes, no other model adapters, and no dependency updates.
Closes #1096
Checklist
uv run pytest responses_api_models/vllm_model/tests/test_app.py -k "metadata_none or metadata_chat_template_kwargs_override or metadata_extra_body_override" -xuv run pre-commit run --files responses_api_models/vllm_model/app.py responses_api_models/vllm_model/tests/test_app.pyuv run ruff check responses_api_models/vllm_model/app.py responses_api_models/vllm_model/tests/test_app.pyuv run ruff format --check responses_api_models/vllm_model/app.py responses_api_models/vllm_model/tests/test_app.pyThe local validation commands above were attempted on this Windows host, but
uvstops while resolvinguvloopwithRuntimeError: uvloop does not support Windows at the moment. Upstream CI is the source of truth for the full matrix.