Skip to content

[Feature]: Enable Partial Guided Decoding / Structured Output Support #16979

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
1 task done
HollowMan6 opened this issue Apr 22, 2025 · 0 comments
Open
1 task done
Labels
feature request New feature or request

Comments

@HollowMan6
Copy link
Contributor

🚀 The feature, motivation and pitch

In some use cases, we don’t need the entire output to strictly follow a defined grammar, but only a specific segment of the generation. It would be great to support partial guided decoding, where structured output is enforced only within defined token boundaries.

For example:

  • Guided decoding begins at <json> and ends at </json>
  • Or for markdown, it starts at ```json and ends at ```

This would make guided decoding more flexible and broadly applicable to tasks where only a partial defined structure is needed (e.g., code generation or agent tool).

Alternatives

Currently, vLLM supports a guided_grammar option that allows context-free grammar-based customization. However, using it for partial guided decoding introduces additional complexity and isn’t as intuitive for cases where a pre-defined structure (such as JSON) is only required in segments of the output.

Additional context

No response

Before submitting a new issue...

  • Make sure you already searched for relevant issues, and asked the chatbot living at the bottom right corner of the documentation page, which can answer lots of frequently asked questions.
@HollowMan6 HollowMan6 added the feature request New feature or request label Apr 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant