Library / SDK
Guardrails & StructureInference & Serving
XGrammar
1Fast 2structured 3generation 4for 5inference 6engines.
the six Ws · specification
W1
Who
Built by the MLC AI team.
W2
What
Constrains model output to JSON, grammars, or regex with near-zero overhead.
W3
Where
A C++/Python library inside serving engines.
W4
When
When an LLM must emit schema-valid output.
W5
Why
The default structured-output backend for vLLM and SGLang.
W6
With
A compatible inference engine.
W7
Watch
Apache-2.0, from MLC AI; runs in-process, no credentials.
alternatives
Structured-outputGrammarFast