Skip to content

Cherry-pick upstream bugfixes PRs #4718, #4720, #4723, #4740, #4741, #4743, #4749 - #22

Merged
oglok merged 11 commits into
mainfrom
fix/audio-format-and-modality-validation
Jun 29, 2026
Merged

oglok merged 11 commits into
mainfrom
fix/audio-format-and-modality-validation

Conversation

@oglok

@oglok oglok commented Jun 26, 2026 •

Copy link
Copy Markdown

Cherry-pick of upstream vllm-project/vllm-omni PRs vllm-project#4718 vllm-project#4720 vllm-project#4723, vllm-project#4740, vllm-project#4741, vllm-project#4743, vllm-project#4749, adapted for nm-vllm-omni-ent.

oglok and others added 7 commits June 26, 2026 12:02
…turning empty choices

Cherry-pick of upstream vllm-project/vllm-omni PRs vllm-project#4718 and vllm-project#4720,
adapted for nm-vllm-omni-ent.

- Wire up request audio.format to existing encoding infrastructure
  instead of hardcoding WAV. Validate format against supported set.
- Remove AAC from supported formats (unsupported by bundled libsndfile).
- Validate requested output modalities against engine capabilities
  upfront, returning 400 for unsupported modalities instead of silently
  returning empty choices with HTTP 200.
- Validate that modalities is a list of strings.

Closes vllm-project#4716
Closes vllm-project#4719

Signed-off-by: Ricardo Noriega De Soto <rnoriega@redhat.com>
…tions

Add a field_validator for the prompt field on ImageGenerationRequest
that rejects empty and whitespace-only strings with a 400 error.
Previously, empty strings passed Pydantic validation and reached the
diffusion engine, which would generate an image from nothing instead
of returning an error.

Unskip the prompt_empty and prompt_whitespace_only test cases that
were blocked on this fix.

Partial fix for vllm-project#3649

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…ors for /v1/images/generations

Addresses additional validation gaps from issue vllm-project#3649:
- Add seed range constraint (0 to 2^32-1)
- Add output_format validator restricting to png/jpeg/webp
- Add negative_prompt/system_prompt empty string rejection (Nick's review feedback)
- Unskip seed_negative, seed_above_uint32, output_format_invalid tests

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…/wakeup requests

Reject empty stage_ids lists (min_length=1) and negative sleep levels
(ge=0) at the entrypoint level. Unskip sleep_empty_stage_ids,
sleep_negative_level, and wakeup_empty_stage_ids tests.

Partial fix for vllm-project#3649.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: Shaun Walsh <shaunwalsh24@gmail.com>
…erence_steps validators for /v1/audio/generate

- Reject empty/whitespace input prompts
- Constrain audio_length to gt=0
- Constrain guidance_scale to gt=0, le=1000
- Constrain num_inference_steps to ge=1, le=1000
- Unskip all 8 issue vllm-project#3649 tests and update error expectations
  to match entrypoint-level Pydantic validation

Partial fix for vllm-project#3649.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: Shaun Walsh <shaunwalsh24@gmail.com>
…completions

ChatCompletionRequest is imported from upstream vllm and cannot have
Pydantic validators added directly. Validate at the handler level by
checking the raw JSON body before dispatch:
- Reject modalities containing non-string elements (e.g. [123])
- Reject logprobs with non-boolean values (Pydantic v2 coerces "yes"
  to True instead of returning 400)

Unskip modalities_list_bad_element and logprobs_wrong_type tests.

Partial fix for vllm-project#3649.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: Shaun Walsh <shaunwalsh24@gmail.com>
vllm-project#3649)

Add missing request validators for /v1/audio/speech, /v1/audio/speech/batch,
and /v1/audio/voices endpoints that previously allowed invalid inputs to reach
the engine, causing garbage output, 500s, or subprocess crashes.

Pydantic-level validators (protocol/audio.py):
- OpenAICreateSpeechRequest: reject empty/whitespace voice
- SpeechBatchItem: reject empty input, empty voice, overlong instructions,
  out-of-range max_new_tokens, invalid ref_audio URI scheme
- BatchSpeechRequest: same field validators as SpeechBatchItem

Serving-level validators (serving_speech.py):
- _pre_validate_batch: validate voice against supported speakers (CustomVoice
  task only), empty/unknown language, whitespace-only ref_text for Base task —
  raises ValueError for HTTP 400 instead of embedding errors in per-item results
- upload_voice: validate consent (empty, path separators, length), ref_text
  length, speaker_description length

Unskips 26 test cases in test_invalid_audio_speech.py.

Upstream: vllm-project#4749

Signed-off-by: Shaun Walsh <shawalsh@redhat.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: Shaun Walsh <shaunwalsh24@gmail.com>
@Shaun-Walsh

Shaun-Walsh commented Jun 26, 2026 •

Copy link
Copy Markdown

Cherry-picks for all 5 upstream PRs covering issue #3649 — 47 missing request validators across 6 endpoint groups.

Upstream PR Endpoint Tests unskipped
#4723 /v1/images/generations 3
#4740 /v1/omni/sleep + /v1/omni/wakeup 3
#4741 /v1/audio/generate 8
#4743 /v1/chat/completions 2
#4749 /v1/audio/speech + batch + voices 26

All changes are entrypoint-level pydantic validators and serving-level checks — no new imports, no architectural changes. Should be safe across the code freeze.

Sync with upstream PR vllm-project#4720 review feedback: single-stage diffusion
engines that advertise output_modalities=["image"] must also accept
modalities=["text"] for img2text/text2text. Add regression tests for
modality validation.

Signed-off-by: Ricardo Noriega De Soto <rnoriega@redhat.com>
@oglok oglok changed the title Cherry-pick upstream bugfixes PRs #4718 and #4720 Cherry-pick upstream bugfixes PRs #4718, #4720, #4723, #4740, #4741, #4743, #4749 Jun 29, 2026
…sts, update docs

Sync with upstream PR vllm-project#4718 review feedback, adapted for nm-vllm-omni-ent:

- Add SUPPORTED_AUDIO_FORMATS, SUPPORTED_CHAT_AUDIO_FORMATS, and
  DEFAULT_AUDIO_FORMAT constants in protocol/audio.py. Remove aac from
  all Literal types and supported_formats dict.
- Extract _resolve_audio_format() helper in serving_chat.py shared
  between _create_audio_choice and _create_diffusion_chat_completion.
- Add unit tests for audio format conversion and validation.
- Update docs to remove aac from supported output format lists.

Signed-off-by: Ricardo Noriega De Soto <rnoriega@redhat.com>
@oglok
oglok force-pushed the fix/audio-format-and-modality-validation branch from 714634a to 4f9aa28 Compare June 29, 2026 11:06
@NickCao

NickCao commented Jun 29, 2026

Copy link
Copy Markdown
Ruff (F821)
Check failure: Ruff (F821)
tests/dfx/reliability/invalid_param_test/test_invalid_audio_speech.py:656:19: F821 Undefined name `_SKIP_ISSUE_3649`

The upstream TTS commit removed the definition since upstream has no
remaining references. The nm fork has 10 additional voice upload test
params that still use this skip marker. Restores the constant to fix
Ruff F821.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: Shaun Walsh <shaunwalsh24@gmail.com>
@Shaun-Walsh

Copy link
Copy Markdown

Fixed in c347d9a — the upstream TTS commit removed the _SKIP_ISSUE_3649 definition since upstream has no remaining references, but the nm fork has 10 additional voice upload test params that still use it. Restored the constant.

@NickCao

NickCao commented Jun 29, 2026

Copy link
Copy Markdown

Also vllm.entrypoints.openai.protocol is not present in vllm 0.23.0?

ChatCompletionRequest moved to vllm.entrypoints.openai.chat_completion.protocol
ErrorResponse moved to vllm.entrypoints.openai.engine.protocol

Signed-off-by: Ricardo Noriega De Soto <rnoriega@redhat.com>
@oglok
oglok merged commit cd1e269 into main Jun 29, 2026
2 of 3 checks passed
dougbtv added a commit that referenced this pull request Aug 5, 2026
Remove the pydantic output_format validator that restricted image
generation to {"png", "jpeg", "webp"}, blocking "jpg" and causing
accept-sync failures. Upstream vllm-omni has no such restriction;
invalid formats soft-fallback downstream.

Also remove the output_format_invalid test case (no validator to test)
and fix an undefined _SKIP_ISSUE_3649 reference on the seed test.

Originally introduced in 25c01b5 via PR #22 (2026-06-29).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
dougbtv added a commit that referenced this pull request Aug 5, 2026
…ng validators

Remove midstream-only pydantic constraints that diverge from upstream:
- OmniSleepRequest/OmniWakeupRequest: drop min_length=1 on stage_ids
  (upstream treats empty list as a no-op, not a 422)
- SpeechBatchItem: drop validate_input_not_empty (upstream allows empty
  input strings without rejecting at the protocol layer)

Originally introduced in carries e45d9d1 and db85f25 (PR #22 family,
issue vllm-project#3649). Accept-sync tests expect upstream behavior.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants