Skip to content

[Refactor] Extract StructuredOutputsParams creation logic from Request.to_sampling_params - #49003

Merged
vllm-bot merged 1 commit into
vllm-project:mainfrom
yzong-rh:yzong-rh/structured_output_extraction
Jul 19, 2026
Merged

[Refactor] Extract StructuredOutputsParams creation logic from Request.to_sampling_params#49003
vllm-bot merged 1 commit into
vllm-project:mainfrom
yzong-rh:yzong-rh/structured_output_extraction

Conversation

@yzong-rh

@yzong-rh yzong-rh commented Jul 18, 2026

Copy link
Copy Markdown
Contributor

Purpose

Add extract_structured_outputs() helpers that normalize a request's StructuredOutputsParams before building sampling params.
Facilitate future Parser.adjust_request() implementation of #48116 and #45560 by consolidating the StructuredOutputsParams extraction logic.

Deduplicate the structured-output normalization logic between the Chat Completions and Completions request paths.

Fix missing json_object support for the Responses API by mapping text.format={"type": "json_object"} into structured outputs.
No other behavioral change.

Test Plan

Unit tests:

.venv/bin/python -m pytest \
  tests/entrypoints/openai/responses/test_sampling_params.py \
  tests/entrypoints/openai/responses/test_serving_responses.py \
  tests/entrypoints/openai/chat_completion/test_chat_error.py \
  tests/entrypoints/openai/completion/test_completion_error.py
.venv/bin/python -m pytest \
  tests/entrypoints/openai/responses/test_structured_output.py \
  tests/entrypoints/openai/chat_completion/test_chat.py \
  tests/entrypoints/openai/completion/test_completion.py \
  tests/tool_use/test_chat_completions.py

Test Result

72 passed, 1 xfailed, 19 warnings
95 passed, 9 skipped, 16 warnings

Essential Elements of an Effective PR Description Checklist
  • The purpose of the PR, such as "Fix some issue (link existing issues this PR will resolve)".
  • The test plan, such as providing test command.
  • The test results, such as pasting the results comparison before and after, or e2e results
  • (Optional) The necessary documentation update, such as updating supported_models.md and examples for a new model.

Signed-off-by: Yifan Zong <yzong@redhat.com>
@yzong-rh

Copy link
Copy Markdown
Contributor Author

cc @bbrowning @chaunceyjiang @arpera

@claude claude Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Claude Code Review

This pull request is from a fork — automated review is disabled. A repository maintainer can comment @claude review to run a one-time review.

@DarkLight1337 DarkLight1337 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the cleanup!

@DarkLight1337
DarkLight1337 enabled auto-merge (squash) July 18, 2026 06:31
@github-actions github-actions Bot added the ready ONLY add when PR is ready to merge/full CI is needed label Jul 18, 2026
@yzong-rh

Copy link
Copy Markdown
Contributor Author

Failure likely unrelated.
image

@vllm-bot
vllm-bot merged commit ac5f38a into vllm-project:main Jul 19, 2026
70 of 72 checks passed
ArjunPakhan pushed a commit to ArjunPakhan/vllm that referenced this pull request Jul 21, 2026
…t.to_sampling_params (vllm-project#49003)

Signed-off-by: Yifan Zong <yzong@redhat.com>
aarushjain29 pushed a commit to ROCm/vllm that referenced this pull request Jul 21, 2026
…t.to_sampling_params (vllm-project#49003)

Signed-off-by: Yifan Zong <yzong@redhat.com>
Signed-off-by: aarushjain29 <Aarushi.Jain2@amd.com>
edwinlim0919 pushed a commit to chaeminlim-mb/vllm that referenced this pull request Jul 29, 2026
…t.to_sampling_params (vllm-project#49003)

Signed-off-by: Yifan Zong <yzong@redhat.com>
itej89 pushed a commit to itej89/vllm that referenced this pull request Aug 4, 2026
…t.to_sampling_params (vllm-project#49003)

Signed-off-by: Yifan Zong <yzong@redhat.com>
Signed-off-by: Tej Kiran <kiran.tej@amd.com>
aditi-amd pushed a commit to aditi-amd/vllm that referenced this pull request Aug 4, 2026
…t.to_sampling_params (vllm-project#49003)

Signed-off-by: Yifan Zong <yzong@redhat.com>
Signed-off-by: root <root@smci355-ccs-aus-m02-09.cs-aus.dcgpu>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

frontend ready ONLY add when PR is ready to merge/full CI is needed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants