Token vocabulary compression for constrained LLM decoding
Project description
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 7.5x faster than SoTA XGrammar2 alone, and lossless — outputs are byte-identical to the unmodified grammar engine.
pip install "cfgzip[xgrammar]"
Full documentation: https://github.com/mjs227/cfgzip
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file cfgzip-0.1.0.tar.gz.
File metadata
- Download URL: cfgzip-0.1.0.tar.gz
- Upload date:
- Size: 34.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ce8c1c3bc60aecb5c99ad26fe9cc9c41654189ad0963aba8f6edb7da8e14e36a
|
|
| MD5 |
1cc8c954f0d76a06e1abbd612fcab58e
|
|
| BLAKE2b-256 |
b7852ddcfe332a0b22b8c4ff5fa14090abe5ddaa55cf2e2076ba52ac565f1186
|
File details
Details for the file cfgzip-0.1.0-py3-none-any.whl.
File metadata
- Download URL: cfgzip-0.1.0-py3-none-any.whl
- Upload date:
- Size: 32.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d2b4945b725905c936d4c1d84e496e0b20efef0c3ccfe8099ce7031c305d4fc2
|
|
| MD5 |
a671e60d29616f80284ef3badebeb3ef
|
|
| BLAKE2b-256 |
129f08a9f361387cf776aba692419395a85fa8a2df25ef5123030aa656792405
|