Skip to content
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

Add Xgrammar Support #701

Merged
merged 13 commits into from
Feb 26, 2025
Merged

Add Xgrammar Support #701

merged 13 commits into from
Feb 26, 2025

Conversation

flyinglandlord
Copy link
Contributor

@flyinglandlord flyinglandlord commented Jan 7, 2025

Change:

  • change launch argument from --simple_constraint_mode to --output_constraint_mode, now user can choose the constriant decode backend from ['outlines', 'xgrammar']
  • add XgrammarBackend used for xgrammar constraint decode, maybe we should merge it with SimpleConstraintBackend later?
  • now we adopt the same request body, the same as vLLM with xgrammar(https://docs.vllm.ai/en/stable/serving/openai_compatible_server.html)
    • user can add guided_grammar to pass a EBNF grammar and execute the constraint decode
    • user can add guided_json to pass a standard json schema and do the constraint decode

@hiworldwzj hiworldwzj merged commit c8c892a into ModelTC:main Feb 26, 2025
1 check passed
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.

2 participants