# xgrammar — card for AI agents

Structured generation library - enables efficient constrained decoding for LLM outputs.

Category: Prompts, structured output and evals · PyPI package `xgrammar` · latest version 0.2.8 (checked 2026-11-01)
Install: `pip install xgrammar`
License: Apache-2.0 (permissive)

In your own product (generator, app, hosted service): **yes**. Permissive license: ship it inside your own product, closed or open source, and keep its license and copyright notice.

## Numbers (AgentGid data)
- Gid Score: 47.8 (#2242 of all tools, 36 of 78 in its category)
- Used in 1 public projects set up for AI coding agents (0.0%)
- Downloads last week: 1,566,262 (as of 2026-11-24), +18.8% over 4 weeks

## Often used with
aiohttp 100.0%, AnyIO 100.0%, attrs 100.0%, charset-normalizer 100.0%, Click 100.0%, dill 100.0%

## Checked alternatives (same job)
- Instructor: https://agentgid.com/tools/instructor/agent.md

## Links
- AgentGid page: https://agentgid.com/tools/xgrammar/
- Homepage: https://xgrammar.mlc.ai/

---
AgentGid's catalog is curated: every entry was checked against the maker's official pages (registry, repository, license and pricing pages) on the date shown; a license value shows the quote it stands on wherever AgentGid has one. Usage numbers come from AgentGid's own scan of public repositories set up for AI coding agents. Claims by makers are reported, not tested by AgentGid.
