Skip to content

feat: enhanced guided decoding params validation and migration to StructuredOutputsParams#117

Closed
nightflight-dk wants to merge 6 commits intotriton-inference-server:mainfrom
nightflight-dk:feat/enhanced-sampling-validation
Closed

feat: enhanced guided decoding params validation and migration to StructuredOutputsParams#117
nightflight-dk wants to merge 6 commits intotriton-inference-server:mainfrom
nightflight-dk:feat/enhanced-sampling-validation

Conversation

@nightflight-dk
Copy link
Copy Markdown
Contributor

@nightflight-dk nightflight-dk commented Dec 29, 2025

This PR modernizes the backend's handling of structured outputs and introduces strict runtime validation to protect the vLLM engine from malformed requests. It migrates from the deprecated GuidedDecodingParams to StructuredOutputsParams, ensuring compatibility with recent vLLM versions (0.13.0+) while maintaining support for legacy clients.

Key Goals:

  • Protect the Engine: Fail fast on invalid regex or grammar constraints before they reach the engine, preventing potential crashes or wasted compute.
  • Future-Proofing: Align with vLLM's move to StructuredOutputsParams.

Changes:

  • Migration & Compatibility:
    • Replaced GuidedDecodingParams with StructuredOutputsParams.
    • Implemented automatic mapping of legacy guided_decoding parameters to structured_outputs, ensuring seamless operation across vLLM versions (tested on 0.11.2 and 0.13.0).
  • Early Runtime Validation:
    • Regex: Pre-validates patterns using interegular to ensure compilability.
    • Grammar: Validates EBNF grammars using xgrammar to catch syntax errors immediately.
    • Type Safety: Enforces strict type checking for choice, json, and whitespace_pattern fields.
  • Cleanup: Handles the removal of the deprecated backend parameter.

Testing:

  • Verified backward compatibility with guided_decoding requests on vLLM 0.11.2 and 0.13.0.
  • Confirmed that invalid regex and grammar inputs trigger immediate ValueError responses.
  • Validated correct parameter mapping to the vLLM

@nightflight-dk
Copy link
Copy Markdown
Contributor Author

nightflight-dk commented Jan 9, 2026

@yinggeh @mc-nv pls review

@nightflight-dk nightflight-dk changed the title Enhanced guided decoding params validation and migration to StructuredOutputsParams feat: enhanced guided decoding params validation and migration to StructuredOutputsParams Jan 10, 2026
@yinggeh
Copy link
Copy Markdown
Contributor

yinggeh commented Jan 12, 2026

@yinggeh @mc-nv pls review

We will take a look. Thanks @nightflight-dk.

@dzier dzier requested review from whoisj and yinggeh January 20, 2026 22:58
@dzier dzier added the enhancement New feature or request label Jan 20, 2026
@yinggeh
Copy link
Copy Markdown
Contributor

yinggeh commented Feb 11, 2026

vLLM backend is compatible with the latest vLLM version (#109)

For other enhancement:

  1. backward compatibility of requests for legacy clients
  2. pre-check of sampling_params value and type
    Open to objection but we probably won't put effort to maintain something vLLM constantly changes. cc @whoisj

@yinggeh yinggeh closed this Feb 23, 2026
@yinggeh
Copy link
Copy Markdown
Contributor

yinggeh commented Feb 23, 2026

Close due to inactivity

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

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants