#8686th of 109 in Model serving

xgrammar

Constrained-decoding library for JSON, regex and grammar-guided LLM output

Releases and problems feed (RSS)

Stars
2k
License
Apache-2.0
Last commit
Nov 2026
Last release
Nov 2026
Language
Python
Stars, last 30 weeks+399
28 Apr 2026: 1,629 stars5 May 2026: 1,662 stars12 May 2026: 1,668 stars19 May 2026: 1,681 stars26 May 2026: 1,689 stars2 Jun 2026: 1,705 stars9 Jun 2026: 1,719 stars16 Jun 2026: 1,731 stars23 Jun 2026: 1,742 stars30 Jun 2026: 1,757 stars7 Jul 2026: 1,763 stars14 Jul 2026: 1,774 stars21 Jul 2026: 1,781 stars28 Jul 2026: 1,792 stars4 Aug 2026: 1,801 stars11 Aug 2026: 1,807 stars18 Aug 2026: 1,814 stars25 Aug 2026: 1,834 stars1 Sept 2026: 1,847 stars8 Sept 2026: 1,862 stars15 Sept 2026: 1,882 stars22 Sept 2026: 1,919 stars29 Sept 2026: 1,936 stars6 Oct 2026: 1,943 stars13 Oct 2026: 1,956 stars20 Oct 2026: 1,966 stars27 Oct 2026: 1,980 stars3 Nov 2026: 1,987 stars10 Nov 2026: 2,003 stars17 Nov 2026: 2,021 stars24 Nov 2026: 2,028 stars

1,629 on 28 Apr 20262,028 on 24 Nov 2026

From GitHub's daily star counts.

Checked on GitHub.

Overview

XGrammar is a library that constrains LLM token generation so output follows a JSON schema, regex or custom context-free grammar. It is used as a structured-output backend in inference engines such as vLLM, SGLang, TensorRT-LLM and MLC-LLM. It installs from PyPI and has Python, C++, JavaScript and Swift APIs.

Who it is for: Engineers building or extending LLM inference engines with structured output

Strengths

  • Supports JSON, regex and general context-free grammars in one engine
  • Integrated into vLLM, SGLang, TensorRT-LLM, MLC-LLM, OpenVINO GenAI and Modular MAX
  • APIs in Python, C++, JavaScript and Swift; runs on Linux, macOS and Windows
  • Hardware coverage includes CPU, NVIDIA, AMD, Apple Silicon and TPU

Weaknesses

  • Library only: no model server or HTTP API of its own
  • Needs an inference engine or tokenizer integration to be useful
  • Rust support is a community binding, not part of this repo
  • Near-zero overhead claim is given without figures in the README

What it needs

  • GPU optional
  • Models: Qwen, Llama, DeepSeek, Phi, Gemma

What changed

From the release notes. No flag means the note does not say so, not that the upgrade is safe.

Known problems

Open now, reported in the last 90 days

Reported, then fixed by a linked change

Titles are the reporters' own words, taken from the project's GitHub issues and ranked by reactions. We have not tried to reproduce any of them.

Also in Model serving

See all 109
Also in Model serving
RankProjectScore
#84ik_llama.cppllama.cpp fork with faster CPU inference and extra quantization types3.4k stars+99 (+3.0%) in 30 daysMIT58 out of 100
#85litservePython framework for writing custom inference servers on FastAPI4k starsApache-2.057 out of 100
#87lightllmPython LLM inference server with token-level KV cache management4.4k starsApache-2.056 out of 100
#88luceboxInference server for AMD R9700 and Ryzen AI MAX+ with speculative decoding3k stars+72 (+2.4%) in 30 daysApache-2.056 out of 100
#89hyperqwenPatched vLLM setup serving Qwen3.8-27B fast on a single 24 GB GPU2.8k stars+576 (+26%) in 30 daysApache-2.056 out of 100