Skip to content

fix(structured-output): validate constraints and unwrap tokenizer adapters - #1603

Open
WANDY666 wants to merge 1 commit into
mainfrom
fix/structured-output-validation
Open

WANDY666 wants to merge 1 commit into
mainfrom
fix/structured-output-validation

Conversation

@WANDY666

Copy link
Copy Markdown
Contributor

Reject oversized UTF-8 JSON schemas with a validation error and require the xgrammar backend when grammar or JSON constraints are requested. Tokenizer wrappers explicitly expose their underlying HF text tokenizer to validation and inference.

This avoids assertion failures, requests that succeed without enforcing their constraints, and xgrammar type-check failures on wrapped tokenizers. Constraints are never silently dropped.

Tests: schema boundaries, backend validation and real xgrammar compilation with wrapped HF tokenizers (19 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