Metadata-Version: 2.4
Name: cfgzip
Version: 0.2.0
Requires-Dist: torch
Requires-Dist: transformers
Requires-Dist: interegular
Requires-Dist: tqdm
Requires-Dist: psutil
Requires-Dist: pytest ; extra == 'dev'
Requires-Dist: xgrammar ; extra == 'dev'
Requires-Dist: xgrammar ; extra == 'xgrammar'
Provides-Extra: dev
Provides-Extra: xgrammar
License-File: LICENSE
Summary: Token vocabulary compression for constrained LLM decoding
License-Expression: Apache-2.0
Requires-Python: >=3.10
Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM
Project-URL: Homepage, https://github.com/mjs227/cfgzip
Project-URL: Repository, https://github.com/mjs227/cfgzip

# CFGzip

**Lossless token vocabulary compression for fast CFG-constrained decoding.**

CFGzip is an offline pre-computation technique that pairs with a constrained decoding engine (e.g. XGrammar2) to
massively speed up the engine's inference: generation with CFGzip+XGrammar2 is **up to 75x faster** than SoTA
XGrammar2 alone, and **lossless** — outputs are byte-identical to the unmodified grammar engine.

```bash
pip install "cfgzip[xgrammar]"
```

**Full documentation:** https://github.com/mjs227/cfgzip

