-
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
[Core] choice-based structured output with xgrammar #12632
base: main
Are you sure you want to change the base?
Conversation
Signed-off-by: Russell Bryant <rbryant@redhat.com>
This commit adds support for using xgrammar with a set of choices. This can be converted to an EBNF grammar pretty easily, which xgrammar can work from. This drops a case where we were falling back to outlines. Part of issue vllm-project#12131 Signed-off-by: Russell Bryant <rbryant@redhat.com>
👋 Hi! Thank you for contributing to the vLLM project. Once the PR is approved and ready to go, your PR reviewer(s) can run CI to test the changes comprehensively before merging. To run CI, PR reviewers can do one of these:
🚀 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM given green CI, thank you!
tokenizer_hash=tokenizer_hash, | ||
max_threads=max_threads, | ||
tokenizer_data=tokenizer_data, | ||
) | ||
else: | ||
raise ValueError( | ||
"Currently only support JSON and EBNF grammar mode for xgrammar" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should add choice here as well
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @russellb!
Co-authored-by: Nick Hill <nhill@redhat.com> Signed-off-by: Russell Bryant <rbryant@redhat.com>
960b475
to
91e0b5c
Compare
part of issue #12131
commit beba609
Author: Russell Bryant rbryant@redhat.com
Date: Thu Jan 30 10:50:43 2025 -0500
commit 4b694af
Author: Russell Bryant rbryant@redhat.com
Date: Thu Jan 30 12:38:25 2025 -0500