xgrammar: Structured Generation

JSON →
library 0.1.33 ·python
verified May 20, 2026

xgrammar is a Python library focused on efficient, flexible, and portable structured generation, primarily for Large Language Models (LLMs). It allows defining output constraints using grammars (e.g., JSON schema) to ensure LLM outputs conform to specific formats. It is under active development, with frequent minor releases providing new features and performance improvements.

total hits 15
actors 6 distinct systems
last hit 1d ago Googlebot
GPTBot
6
Script
3
ChatGPT-User
1
Search engines
3

top countries 🇺🇸 United States · 🇩🇪 Germany · 🇨🇦 Canada · 🇮🇳 India