Skip to main content

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

cfgzip-0.1.0.tar.gz (34.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

cfgzip-0.1.0-py3-none-any.whl (32.9 kB view details)

Uploaded Python 3

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

Hashes for cfgzip-0.1.0.tar.gz
Algorithm Hash digest
SHA256 ce8c1c3bc60aecb5c99ad26fe9cc9c41654189ad0963aba8f6edb7da8e14e36a
MD5 1cc8c954f0d76a06e1abbd612fcab58e
BLAKE2b-256 b7852ddcfe332a0b22b8c4ff5fa14090abe5ddaa55cf2e2076ba52ac565f1186

See more details on using hashes here.

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

Hashes for cfgzip-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d2b4945b725905c936d4c1d84e496e0b20efef0c3ccfe8099ce7031c305d4fc2
MD5 a671e60d29616f80284ef3badebeb3ef
BLAKE2b-256 129f08a9f361387cf776aba692419395a85fa8a2df25ef5123030aa656792405

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page