mlc-ai/xgrammar

Fast, Flexible and Portable Structured Generation

68
/ 100
Established

Implements constrained decoding with context-free grammars (JSON, regex, custom specs) to guarantee 100% structural correctness while achieving near-zero overhead. Supports cross-platform deployment across CPU, NVIDIA/AMD/Apple GPUs, and TPUs with Python, C++, and JavaScript APIs. Integrated as the default structured generation backend in vLLM, SGLang, TensorRT-LLM, and MLC-LLM.

1,581 stars. Actively maintained with 29 commits in the last 30 days.

No Package No Dependents
Maintenance 23 / 25
Adoption 10 / 25
Maturity 16 / 25
Community 19 / 25

How are scores calculated?

Stars

1,581

Forks

131

Language

C++

License

Apache-2.0

Last pushed

Mar 13, 2026

Commits (30d)

29

Get this data via API

curl "https://pt-edge.onrender.com/api/v1/quality/llm-tools/mlc-ai/xgrammar"

Open to everyone — 100 requests/day, no key needed. Get a free key for 1,000/day.