A high-performance LZW compression library built for [zip2zip](https://arxiv.org/abs/2506.01084).
Project description
zip2zip-compression
zip2zip: Inference-Time Adaptive Vocabularies for Language Models via Token Compression
Saibo Geng, Nathan Ranchin, Yunzhen Yao, Maxime Peyrard, Chris Wendler, Michael Gastpar, Robert West
Paper: https://arxiv.org/abs/2506.01084
About
This package provides a high-performance LZW compression library with Python bindings. It is designed to be used as part of the zip2zip project, where it provides efficient, high-performance compression capabilities.
We developed a new variant of the Lempel-Ziv-Welch (LZW) compression algorithm that doesn't need perfectly encoded input to decode. This allows the algorithm to decode (or decompress) generated sequences from a Large Language Model (LLM) without the need to store the entire compression codebook.
Installation
From PyPI
pip install zip2zip-compression
From source (Rust required)
Make sure you have the Rust toolchain installed.
pip install maturin
maturin build --release
Documentation
See the docs folder for more information:
Example Usage
You can find usage examples in the example folder.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distributions
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 zip2zip_compression-0.3.3-cp312-cp312-win_amd64.whl.
File metadata
- Download URL: zip2zip_compression-0.3.3-cp312-cp312-win_amd64.whl
- Upload date:
- Size: 307.1 kB
- Tags: CPython 3.12, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3b38ab969566f8cce6287a7acf622562b315e56210567e835e1d0067bef8e419
|
|
| MD5 |
8ed637adecbb6d740a9c64fc691c66a5
|
|
| BLAKE2b-256 |
874a9c189606d744717827bc2c9f543a9846bf673e628fd25347d660f8cdefba
|
File details
Details for the file zip2zip_compression-0.3.3-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.
File metadata
- Download URL: zip2zip_compression-0.3.3-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 406.5 kB
- Tags: CPython 3.12, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
37a7955a63fee927ff19c3ff4c8f97aac5d99dd91e401946ad87d5af0e57116c
|
|
| MD5 |
b27c938459279fd53f283b9fc5e4b409
|
|
| BLAKE2b-256 |
285ec936d77fde5cff29933d8a2ace835799dc5c726d415e5aecb17c3305efb6
|
File details
Details for the file zip2zip_compression-0.3.3-cp312-cp312-macosx_11_0_arm64.whl.
File metadata
- Download URL: zip2zip_compression-0.3.3-cp312-cp312-macosx_11_0_arm64.whl
- Upload date:
- Size: 355.6 kB
- Tags: CPython 3.12, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2c883aecf98705f34eb591c69b2bbbba62c2e9811332bcf95db5a00f3dc15e6b
|
|
| MD5 |
8c7807380052992274d52464ee879334
|
|
| BLAKE2b-256 |
291119cfee21b37a5cf47ff3a1b3d202d8ad28bef6f44d07a2d9dbc36d49eedc
|
File details
Details for the file zip2zip_compression-0.3.3-cp311-cp311-win_amd64.whl.
File metadata
- Download URL: zip2zip_compression-0.3.3-cp311-cp311-win_amd64.whl
- Upload date:
- Size: 307.3 kB
- Tags: CPython 3.11, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2fd95403b72b5fe93541c3b753e96b843b3ec467f948029026c8efd1844dfb12
|
|
| MD5 |
cab69d7f9b4e9bea07ebc2b782db92d0
|
|
| BLAKE2b-256 |
2bfbb214dbe69b1cfb18b75281289bbc2741421d8d758c487ba9a2585b259c36
|
File details
Details for the file zip2zip_compression-0.3.3-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.
File metadata
- Download URL: zip2zip_compression-0.3.3-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 406.6 kB
- Tags: CPython 3.11, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8e392285e1bba9b8b146c2aee39e74f58980291950a6ba7eecaace16225bf34f
|
|
| MD5 |
62197c78c99cf85a9b721061ef8ade05
|
|
| BLAKE2b-256 |
5de3400a5add3f43d69986be320a48ef8389e8ad03405e403d94f851b78a72c9
|
File details
Details for the file zip2zip_compression-0.3.3-cp311-cp311-macosx_11_0_arm64.whl.
File metadata
- Download URL: zip2zip_compression-0.3.3-cp311-cp311-macosx_11_0_arm64.whl
- Upload date:
- Size: 359.6 kB
- Tags: CPython 3.11, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e39dd37a08fae0f69c58f9a0d72c5e7be50a19c5ab497929bd52fe0523ebf47f
|
|
| MD5 |
4270aef756469fb2d003161591027630
|
|
| BLAKE2b-256 |
1c5425afe16dafa56051dd082eecdc286e55a129e2c988222fb9841200243ee0
|
File details
Details for the file zip2zip_compression-0.3.3-cp310-cp310-win_amd64.whl.
File metadata
- Download URL: zip2zip_compression-0.3.3-cp310-cp310-win_amd64.whl
- Upload date:
- Size: 307.0 kB
- Tags: CPython 3.10, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
117d3d09bf4bf1df35bf4c50e631dd97a0df4722203510215e71f543614d0c22
|
|
| MD5 |
23865d1936a4167695a68885c28ed83a
|
|
| BLAKE2b-256 |
61f0323911f9f70505194ce3547b59c4288b0a51e6f29e4f6384493049f8d481
|
File details
Details for the file zip2zip_compression-0.3.3-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.
File metadata
- Download URL: zip2zip_compression-0.3.3-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 406.5 kB
- Tags: CPython 3.10, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ee58816cf37400a18e6376c02fd72c4391e3a0d7534f414a81d00c91f1c2a94b
|
|
| MD5 |
60d1d022bfb728552649949dfc319416
|
|
| BLAKE2b-256 |
1f34437c7924ed0135197387bdcb0d1ac737c058df0a50832b8ed4d84bc4eb60
|
File details
Details for the file zip2zip_compression-0.3.3-cp310-cp310-macosx_11_0_arm64.whl.
File metadata
- Download URL: zip2zip_compression-0.3.3-cp310-cp310-macosx_11_0_arm64.whl
- Upload date:
- Size: 359.4 kB
- Tags: CPython 3.10, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7809ce5c0aee0d5a5276b018669f54ec25be18f8340c408a2545ec527d2a603d
|
|
| MD5 |
f71574441fc055b11870196cfa2f88f6
|
|
| BLAKE2b-256 |
030ab8153cc894554ba4347fb71995cdd167bcc8d5fb1021110766e5f7332c61
|
File details
Details for the file zip2zip_compression-0.3.3-cp39-cp39-win_amd64.whl.
File metadata
- Download URL: zip2zip_compression-0.3.3-cp39-cp39-win_amd64.whl
- Upload date:
- Size: 308.1 kB
- Tags: CPython 3.9, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e9278da15841816a2d9e4fb797292f232f1107a3a473c313807212423af32ee7
|
|
| MD5 |
2e769a9dcd6499d62377d79ebc81034b
|
|
| BLAKE2b-256 |
b3150d629c3db5a903b10500f6973187aff5aa4a2b1bc56983ba7d509ded33f2
|
File details
Details for the file zip2zip_compression-0.3.3-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.
File metadata
- Download URL: zip2zip_compression-0.3.3-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 407.0 kB
- Tags: CPython 3.9, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d87faaf7c3b8974a65ad39eab2d74fb7c56ab5ec2586b77ce8b63287df14f2ce
|
|
| MD5 |
b5d52e91b686ef1f418010ffa52f755f
|
|
| BLAKE2b-256 |
33d3ab137dedd160d562f2d90dd7d0d17907f11e28ac8d33526b656460bc3fb6
|
File details
Details for the file zip2zip_compression-0.3.3-cp39-cp39-macosx_11_0_arm64.whl.
File metadata
- Download URL: zip2zip_compression-0.3.3-cp39-cp39-macosx_11_0_arm64.whl
- Upload date:
- Size: 360.2 kB
- Tags: CPython 3.9, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
dc6e45c12e5eccd299f4ac2b9ca8c6f4e38778f812dd74267421dfbb7025b5eb
|
|
| MD5 |
b555c294eb19fb02734076b531d994e3
|
|
| BLAKE2b-256 |
1afcca11eb9579fd8435e096f901706c7a9d8dcefa2a8278444bf593c7bf34a6
|
File details
Details for the file zip2zip_compression-0.3.3-cp38-cp38-win_amd64.whl.
File metadata
- Download URL: zip2zip_compression-0.3.3-cp38-cp38-win_amd64.whl
- Upload date:
- Size: 308.4 kB
- Tags: CPython 3.8, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
645c26304082850c68a2a5fab2713b601ef5944f7208af4564d208791ed7ab0f
|
|
| MD5 |
13234efda2b57812534148838db9a26f
|
|
| BLAKE2b-256 |
7c760c0a00c831d04e5632b1d0e0078d84e06e478b7283b07cd740a6e37a910a
|
File details
Details for the file zip2zip_compression-0.3.3-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.
File metadata
- Download URL: zip2zip_compression-0.3.3-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 407.0 kB
- Tags: CPython 3.8, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
10a7d9381fd0902f22bc72f1520da564d5e06dc7ac20c9851c773fad659942bd
|
|
| MD5 |
c8089e8fa2272e9309f802b6e4cd13b1
|
|
| BLAKE2b-256 |
c3c973b629f03b8c38cfafa01cf185d5f58c96d53772d0d1fc0dae84eb1df1cb
|
File details
Details for the file zip2zip_compression-0.3.3-cp38-cp38-macosx_11_0_arm64.whl.
File metadata
- Download URL: zip2zip_compression-0.3.3-cp38-cp38-macosx_11_0_arm64.whl
- Upload date:
- Size: 359.9 kB
- Tags: CPython 3.8, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8a60d0c8b06f6902a6d93caa61e5840363e080fb296cee15a0cd7dc8ba710b1d
|
|
| MD5 |
1c64c47572559c5c36b1913f8a30c831
|
|
| BLAKE2b-256 |
de58efb058c53039eec24ead3e01e98236b5371d00cc738470c65af9306ee75f
|