Repository navigation
fix(local-vlm): apply json schema guided decoding - #545
Open
rikkurea-boop wants to merge 2 commits into
Open
rikkurea-boop wants to merge 2 commits into
rikkurea-boop wants to merge 2 commits into
Conversation
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.
Summary
Apply caller-provided JSON schemas to the Local VLM single-image generation path so structured-output requests reach the actual vLLM runtime configuration.
Problem
LocalVLMServing_vllm.generate_from_input()acceptsjson_schema, but the value is not forwarded to the single-image path.As a result:
generate_from_input(json_schema=...)→
generate_from_input_one_image()→
llm.generate(...)still uses the default
self.sampling_params, so the requested guided-decoding schema is lost before runtime generation.Fix
Forward
json_schemainto the single-image path.When a schema is provided:
GuidedDecodingParams(json=json_schema);SamplingParams;When no schema is supplied, continue reusing the original
self.sampling_paramsobject.Tests
The regression exercises the real public:
LocalVLMServing_vllm.generate_from_input()through the real single-image implementation and observes the sampling parameters passed to
llm.generate().Pre-fix, the engine receives the default sampling object even when a schema is supplied.
Post-fix:
sampling_params.guided_decoding.json == caller_schemaThe regression also verifies:
Heavy vLLM runtime components are stubbed only below the defect boundary with explicit compatible interfaces.
Validation
py_compile: passed;git diff --check: passed.Scope
Only these paths are changed:
dataflow/serving/local_model_vlm_serving.pytest/cpu_only/test_local_vlm_json_schema_runtime.pyNo P09.07, P11, G6, P09.05, or unrelated serving changes are included.