About Jabara
Jabara is a Python library that compresses the checkpoints of a training run: the model weights and the optimizer state. Lossless compression, deltas against an earlier checkpoint, and quantization all sit behind one codec interface.
Written by Tatsuki Okada. Version 0.1.0, under the MIT License. Jabara is not on PyPI yet, so you install it from a clone of the repository.
What Jabara does
Point jabara compress at a checkpoint directory. It replaces each *.safetensors file and optimizer.pt with a .jbr archive, verifies every archive, and only then deletes the originals. It leaves the other files alone. jabara decompress writes the original files back.
It reads a file through a registry of checkpoint formats: safetensors, the torch.save files of Transformers, Accelerate, PyTorch Lightning, DeepSpeed, and Megatron-LM, NumPy .npy and .npz, GGUF, and Keras .keras and HDF5 files. Each format is one class that cuts the tensors out of the file and puts them back, so a lossless archive restores the file byte for byte, and a new format is one more class. The formats reference lists them, with the formats that Jabara does not take and why.
From Python, save_state and load_state in jabara.torch store and restore a PyTorch state, such as the state_dict() of an optimizer. The adapters do the same inside the checkpoint save of a Hugging Face Trainer or a PyTorch Lightning Trainer.
By default every tensor comes back bit for bit, and every read checks a CRC-32 for each chunk. Writing an archive with a lossy codec requires allow_lossy=True, and the archive then records the largest error that the codec introduced.
Who it is for
A checkpoint holds more than the model. With Adam, every weight has two moment tensors of its shape, exp_avg and exp_avg_sq. When all three use one dtype, the optimizer state takes about twice the space of the weights. A run saves such a checkpoint again and again, and a sweep of N runs that each keep K checkpoints stores N × K of them.
Jabara is for checkpoints that you keep and read back later:
- The checkpoints of seed sweeps and hyperparameter searches. Jabara compresses each one on its own. Runs that start from the same pretrained weights can also store their weights as a delta against those weights, but how much that saves has not been measured.
- Long runs on preemptible or time-limited machines, which save often and resume from the archives with every tensor bit for bit.
- Intermediate checkpoints kept for analysis, such as probing or picking the best step afterwards, which get back the exact tensors.
- Runs that someone else resumes, which a release of the weights alone does not allow.
It is not a format to serve a model from. A framework cannot memory-map an archive, so Jabara decodes it before the framework reads it, and saves and loads take longer than without Jabara. Who Jabara is for gives the measured sizes and costs, and Jabara and general-purpose archivers compares it with tar, zip, gzip, and zstd.
Lossless compression, deltas between checkpoints, and quantization are known methods, and Jabara adds no new one. It gives them one interface, so that you use them, compare them on the same tensors, and add your own in the same way. jabara.bench measures each codec it is given on the same tensors: the stored size, the encode and decode time, and whether each tensor decodes to the same bytes.
Lossless is the default because a run should resume as if nothing had happened. A checkpoint that restores approximately cannot promise that, so you choose a lossy codec in code, per tensor, and opt in with allow_lossy=True.
How a checkpoint becomes an archive
jabara compress picks bytegroup-zstd/1 or zstd/1, or xor-delta/1 when you pass --base. You choose a lossy codec from Python. The four codecs shown are half of the built-in ones.- Roles. A state schema names the role of each tensor from its path in the saved state.
OptimizerSchemagivesexp_avgthe roleadam_m,exp_avg_sqthe roleadam_v, andstepthe rolestep. Every tensor of a safetensors file is aweight. - Codecs. An assigner chooses a codec for each tensor. By default, float tensors go to
bytegroup-zstd/1and all other tensors tozstd/1.RoleAssignerchooses by role, so the weights and each kind of optimizer state can use different codecs. A delta codec such asxor-delta/1stores a tensor as its difference from the same tensor of its base, a full archive of an earlier checkpoint. - Chunks. The writer splits each tensor into chunks of 16 MiB by default and codes them on a pool of
threadsthreads. Each chunk carries a CRC-32 of the bytes that a reader must produce. - Archive. One
.jbrfile holds a magic number, the chunks, a JSON index, the length and the CRC-32 of the index, and a closing magic number. The index lists every tensor with its dtype, shape, role, codec, and chunks. A reader starts from the end of the file and rejects a file that it does not understand before it reads a chunk.
The archive format reference gives every field, and the design document fixes the data shapes and module boundaries.
What the repository contains
- The library
- The
jabarapackage for Python 3.10 or newer: the archive writer and reader, eight built-in codecs, the assigners and state schemas, and the PyTorch layer. See the Python API. - The command
jabara compress,decompress,ls,verify,export-weights,bench, andcodecs. See the command-line reference.- Framework adapters
jabara.hf.attachfor the Hugging FaceTrainerandJabaraCheckpointIOfor PyTorch Lightning. Each needs its extra,hforlightning.- The live demo
- The library running in your browser through Pyodide, on a bundled checkpoint or on a safetensors file that you choose. Nothing is uploaded. Open the demo.
- The results viewer
- The reports of
jabara.benchas tables, one for each tensor role: measured reports on the checkpoints of language-model training runs, and one synthetic report from seeded random tensors. Open the results viewer. - Documentation
- A tutorial, how-to guides, explanations, and the reference, in English and 日本語.
- Examples
- Complete scripts in
examples/extend/that add a codec, an assigner, and a state schema. A test runs each one.
What Jabara does not do
- It does not introduce a compression method, and it does not aim to beat other codecs on stored size.
- It does not compress on a GPU. It runs on the CPU inside the training loop, and a save returns once the archive is written.
- The
Traineradapter refuses multi-process training, DeepSpeed, and FSDP. - The Lightning plugin reads and writes local paths only.
- Jabara runs no pickle. The archives of its training adapters hold tensors, plain values, and dicts, lists, and tuples of them, and refuse a custom object. A file that
torch.savewrote is taken apart without being unpickled, and comes back byte for byte. - The codec interface codes one tensor at a time. A method that codes several tensors together, such as one that prunes weights together with their optimizer moments, does not fit it.
jabara benchtimes the codec's share of the work, in memory, not a whole save or load.
The scope page gives the reason for each.
License
The code is under the MIT License. The text font of this site, BIZ UDPGothic, and its code font, JetBrains Mono, are under the SIL Open Font License. The demo downloads the Pyodide runtime from cdn.jsdelivr.net after you press its button.
How to cite Jabara
Cite the repository. Replace COMMIT with the commit you used, because the code still changes.
@misc{okada2026jabara,
author = {Tatsuki Okada},
title = {Jabara: A unified library for compressing {LLM} training checkpoints},
year = {2026},
howpublished = {\url{https://github.com/iamtatsuki05/jabara}},
note = {Version 0.1.0, commit COMMIT}
}Author and links
Jabara is written by Tatsuki Okada, iamtatsuki05 on GitHub. Report a bug or ask a question in the issue tracker.
- Repository: the source, the tests, and the examples.
- Updates: what changed, newest first, also as an RSS feed.
- llms.txt: an index of this site for language models.
- llms-full.txt: the English documentation in one text file.
- sitemap.xml: every page of the site, the documentation included.