Skip to content

fix(vlm): return invalid media input as HTTP 400 - #31944

Closed
mickqian wants to merge 1 commit into
sgl-project:mainfrom
mickqian:codex/vlm-invalid-media-400
Closed

mickqian wants to merge 1 commit into
sgl-project:mainfrom
mickqian:codex/vlm-invalid-media-400

Conversation

@mickqian

@mickqian mickqian commented Jul 21, 2026

Copy link
Copy Markdown
Collaborator

Motivation

Invalid client-supplied multimodal data (for example malformed base64 image bytes) is classified as ValueError by _load_single_item, but both fast and legacy loaders wrap it in RuntimeError. The OpenAI serving layer therefore returns HTTP 500 instead of HTTP 400.

Changes

  • Preserve ValueError through both multimodal loading paths.
  • Keep unexpected loader failures as RuntimeError/HTTP 500.
  • Add a CPU regression test for the fast loader.

Validation

  • test_base_processor_image_decode.py, Kimi processor tests, and OpenAI serving-chat unit tests: 101 passed + 15 subtests on NVIDIA B300.
  • Real Kimi-K3 TP8/GB300 protocol probe before this patch reproduced malformed base64 image as HTTP 500; post-patch validation at Kimi PR head bac10440f on real Kimi-K3 weights, NVIDIA GB300 TP8, returned HTTP 400. The complete protocol/error matrix passed 5/5, and the server log contained 0 Traceback, 0 ERROR.

CI States

Latest PR Test (Base): ❌ Run #29830822824
Latest PR Test (Extra): ❌ Run #29830822508

@gemini-code-assist

Copy link
Copy Markdown
Contributor

Warning

You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again!

@mickqian

Copy link
Copy Markdown
Collaborator Author

/tag-and-rerun-ci

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant