← Browse tools

Inference & serving

XGrammar

An optimized grammar engine intended to sit directly inside model-serving token generation.

Overview

Research summary

XGrammar is a library for enforcing structural constraints during language-model decoding. It compiles and applies grammars for formats such as JSON, regular expressions, and custom context-free languages, producing token masks that inference engines use when selecting the next token. The implementation emphasizes portable, low-overhead integration and provides APIs for several programming languages. It is integrated into multiple serving engines, including vLLM and SGLang. Structural constraints govern output syntax and shape; they do not establish whether the generated content is factually correct.

Repository summary

Stars
Unavailable
Open issues
Unavailable
Last push
Unavailable
Commits, 90 days
Unavailable
Repository activity
Not scored
Version
Unavailable

Recorded catalogue figures. View repository data and provenance →

Classification

Pricing & services

Paid services unknown

Whether the provider offers paid products or services has not been established.

Licence scope

Implementation

Recorded implementation details and interfaces for XGrammar.

Implementation details

C++ structured-generation core with Python and other language APIs

Languages
C++, Python
Repository type
source

Recorded interfaces and capabilities

Licence scope

Repository

Repository snapshots, release information and recorded maintenance signals.

Repository snapshot

mlc-ai/xgrammar ↗

Stars
Unavailable
Open issues
Unavailable
Last push
Unavailable
Commits, 90 days
Unavailable
Repository activity
Not scored
Archived
Not recorded

Repository activity is a snapshot, not a quality or popularity ranking. It combines recent-push freshness (50%), 90-day commits (30%) and issue pressure (20%).

Maintenance and provenance

Catalogue snapshot
2026-10-06

Documentation

Recorded references and research provenance for this entry.

Recorded sources 5

Research metadata

Research date
2026-10-02
Catalogue snapshot
2026-10-06