QUICK START
One model archive.
Two commands.
Neuralzip compresses text using a model trained on that text. Encoding trains and writes an archive; decoding uses its saved weights to restore the original bytes.
Install once
Python 3.10 or newer is required. Create a virtual environment to keep dependencies separate:
python3 -m venv .venv
source .venv/bin/activateOn Windows PowerShell, use py -m venv .venv and .\.venv\Scripts\Activate.ps1.
Download the Python wheel, or install directly from PyPI:
python -m pip install neuralzipThe installation includes PyTorch, NumPy and the embedded decoding engine. Python defaults to one CPU training thread and one coding worker. Use --device mps or --device cuda to opt into GPU training. Training runs in its own process, releasing its memory before coding.
Encode and decode
neuralzip encode notes.txt
neuralzip decode notes.txt.nzipEncoding creates notes.txt.nzip. Decoding restores the original name, or uses notes.restored.txt if it already exists. Existing files stay safe.
Encoding learns a model, writes a lossless stream and verifies a complete decode before saving. Restored content is always byte-for-byte identical:
neuralzip encode notes.txt
neuralzip decode notes.txt.nzip -o recovered.txtAlways lossless
There is no accuracy or quality setting. Browser training stops automatically when learning stabilizes, not when a timer expires. The arithmetic-coded stream preserves the information needed to restore every byte, even when model predictions are imperfect. A full verification decode must match the original SHA-256 before you receive an archive.
Watch the work
Both the terminal and browser show the current stage, elapsed time and completed chunks. The terminal heartbeat keeps moving during long native operations. Cancel with Ctrl+C in the terminal or the Cancel button in the browser.
Use Python directly
from neuralzip import encode, decode, encode_file, decode_file
archive = encode(b"Keep every byte.")
assert decode(archive) == b"Keep every byte."
path = encode_file("notes.txt")
restored = decode_file(path)Paste text or choose a sample
Under Encode, choose Paste text to type or paste into the editor. The counter measures UTF-8 bytes. Upload an existing text file when its original byte encoding and line endings matter. The Samples tab includes short classics, structured logs and multilingual text.
Watch a model reconstruct a book
Under Decode, upload an archive or choose a title from Book library. Enable Watch reconstruction, then choose Decode archive. Actual decoded chunks appear in order. Pause and resume between chunks, adjust the reveal speed, or follow the latest text. The full output is verified before the download becomes available.
What is inside?
A .nzip archive contains model weights, an arithmetic-coded stream, settings and the original SHA-256 checksum. The stream carries the information needed to correct the model's uncertainty. Restored bytes are checked before saving. There is no gzip encoding option or automatic conventional fallback.
Very short or difficult text can produce a larger model archive. You still receive the actual model archive, with its real size reported.
File sizes and runtime
| Operation | Size and behavior |
|---|---|
| Browser encoding | Files over 1 MB show time and memory guidance; larger files are allowed |
| Python encoding and decoding | 16 MiB |
The browser selects a smaller neural model for short inputs and keeps a lightweight preset for books. Python uses a larger four-layer preset. Browser learning checks samples spanning the file and includes refinement using the saved weight precision. Encoding and verification always process every original byte. Archives are compatible across both decoders. Browser jobs have no two-minute timeout or fixed 1 MB cutoff. Browser memory, buffer capacity and the archive’s chunk-address space still impose technical limits. Python 0.3.1 retains its 16 MiB bound. Large browser archives can therefore exceed that Python decoder’s supported size.
Read the archive specification