mlc-ai/xgrammar
Fast, Flexible and Portable Structured Generation
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.
Stars
1,581
Forks
131
Language
C++
License
Apache-2.0
Category
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.
Related tools
microsoft/multilspy
multilspy is a lsp client library in Python intended to be used to build applications around...
vicentereig/dspy.rb
The Ruby framework for programming—rather than prompting—language models.
hyparam/hyllama
llama.cpp gguf file parser for javascript
llmrb/llm.rb
Ruby toolkit for multiple Large Language Models (LLMs)
feenkcom/gt4llm
A GT package for working with LLMs