Skip to content

mlc-ai/xgrammar

Folders and files

NameName
Last commit message
Last commit date
Mar 17, 2025
Jan 30, 2025
Jan 30, 2025
Mar 14, 2025
Feb 25, 2025
Feb 25, 2025
Mar 12, 2025
Mar 15, 2025
Mar 17, 2025
Dec 5, 2024
Mar 17, 2025
Mar 5, 2025
Jul 3, 2024
Aug 5, 2024
Oct 24, 2024
Jan 30, 2025
Feb 13, 2025
Dec 5, 2024
Feb 25, 2025
Dec 5, 2024
Nov 20, 2024
Mar 17, 2025
Mar 15, 2025

Repository files navigation

XGrammar

Documentation License PyPI PyPI Downloads

Efficient, Flexible and Portable Structured Generation

Get Started | Documentation | Blogpost | Technical Report

News

  • [2025/02] XGrammar has been officially integrated into Modular's MAX
  • [2025/01] XGrammar has been officially integrated into TensorRT-LLM.
  • [2024/12] XGrammar has been officially integrated into vLLM.
  • [2024/12] We presented research talks on XGrammar at CMU Catalyst, Berkeley SkyLab, MIT HANLAB, THU IIIS, SJTU, Ant Group, SGLang Meetup, Qingke AI, Camel AI. The slides can be found here.
  • [2024/11] XGrammar has been officially integrated into SGLang.
  • [2024/11] XGrammar has been officially integrated into MLC-LLM.
  • [2024/11] We officially released XGrammar v0.1.0!

Overview

XGrammar is an open-source library for efficient, flexible, and portable structured generation. It supports general context-free grammar to enable a broad range of structures while bringing careful system optimizations to enable fast executions. XGrammar features a minimal and portable C++ backend that can be easily integrated into multiple environments and frameworks, and is co-designed with the LLM inference engine and enables zero-overhead structured generation in LLM inference.

Get Started

Please visit our documentation to get started with XGrammar.