Skip to main content

Jabara

English / 日本語

Jabara compresses training checkpoints: model weights and optimizer state. Lossless compression, deltas against an earlier checkpoint, and quantization all sit behind one codec interface. By default Jabara restores every tensor bit for bit, every read checks a CRC-32, and an archive gets a lossy codec only when you opt in.

The result of the live demo: for a small checkpoint, the stored size of each codec as a bar split into weights, first moment, and second moment, with five lossless codecs marked bit-exact and two lossy codecs marked with their largest error.

Who it is for

Jabara is for checkpoints that you keep and read back later: the checkpoints of seed and hyperparameter sweeps, intermediate checkpoints kept for analysis, and runs that resume after an interruption or that someone else resumes. Saves and loads take longer than without Jabara, and a framework cannot memory-map an archive, so it is not a format to serve a model from. Who Jabara is for gives the measured sizes and costs, and Compress the checkpoints of many runs shows the commands for a finished sweep. Jabara and general-purpose archivers compares it with tar, zip, gzip, and zstd.

What you can do

  • Take many file formats through one registry. jabara compress reads safetensors, torch.save files (without unpickling them), NumPy, GGUF, Keras and HDF5, ONNX, TensorFlow and MindSpore checkpoints, Core ML weight files, and Flax msgpack files, and a lossless archive restores each file byte for byte. A new format is one CheckpointFormat subclass plus the code that finds the tensor bytes in the file, and the built-in format modules are 86 to 290 lines each (Checkpoint file formats).
  • Split an archive by size or by count, and join it back. --part-size 2GB or --parts 4 cuts each archive, and jabara split and jabara join change an archive that exists without encoding it again (Split an archive into parts and join it back).
  • Handle a whole run. --recursive takes every checkpoint directory of a run, and compress --dry-run lists what it would do before it changes anything (Compress the checkpoints of many runs).
  • Store deltas. --delta first codes each later checkpoint against the first one and --delta previous against the one before it, which saves only a few points more and restores slower. --base takes a directory too, and jabara.hf.attach(trainer, delta="first") saves deltas from a Trainer (Delta checkpoints).
  • Read options from a file. --config FILE takes JSON, YAML, or TOML, and --show-config prints the settings without running the command (Run from a config file).
  • Find your way in the command. -h and -H print the short and the full help, jabara man COMMAND shows the manual page, and jabara codecs --long lists each codec with the works it builds on (Command-line reference).
  • Hand it to an agent. The repository ships an agent skill for Claude Code, Codex CLI, GitHub Copilot CLI, Cursor, and Gemini CLI, an AGENTS.md, and a test of the command's contract (Use Jabara from an AI agent).

Install

Jabara needs Python 3.10 or newer. Install it from PyPI into a virtual environment:

$ python -m venv .venv
$ source .venv/bin/activate
$ pip install "jabara[torch]"

In a uv project, run uv add "jabara[torch]" instead.

The extras are torch (PyTorch state, and the tensor names and roles of .pt files), hf (the Hugging Face Trainer adapter), lightning (the PyTorch Lightning plugin), zipnn (the zipnn/1 codec), yaml (YAML config files), and hdf5 (HDF5 and Keras files). See Installation.

Quickstart

Compress a checkpoint directory, check it, and restore it. compress replaces each *.safetensors file and optimizer.pt with a verified .jbr archive and leaves the other files alone. It also takes the files that Accelerate, PyTorch Lightning, DeepSpeed, and Megatron-LM write with torch.save, without unpickling them, TensorFlow data shards, MindSpore .ckpt files, and a Flax model's flax_model.msgpack, and, when you name the file, NumPy .npy and .npz, GGUF, Keras .keras and HDF5 files, ONNX models and their external data, Core ML weight.bin files, and any Flax .msgpack file. Each format is one class in a registry, and a lossless archive restores the file byte for byte (see Checkpoint file formats).

$ jabara compress checkpoint-1000
checkpoint-1000/model.safetensors.jbr: ... -> ... bytes (...% of original)
checkpoint-1000/optimizer.pt.jbr: ... -> ... bytes (...% of original)
$ jabara verify checkpoint-1000
ok checkpoint-1000/model.safetensors.jbr
ok checkpoint-1000/optimizer.pt.jbr
$ jabara decompress checkpoint-1000
checkpoint-1000/model.safetensors
checkpoint-1000/optimizer.pt

Save and load a PyTorch state from Python:

import torch
from jabara.torch import load_state, save_state

model = torch.nn.Linear(16, 16)
optimizer = torch.optim.AdamW(model.parameters())
model(torch.randn(4, 16)).sum().backward()
optimizer.step()

save_state(optimizer.state_dict(), "optimizer.jbr")
optimizer.load_state_dict(load_state("optimizer.jbr"))

The tutorial explains both examples. Every command that has options also reads them from a JSON, YAML, or TOML file with --config FILE; see Run from a config file.

An archive can also be written as several files, parts of at most a given size (jabara compress --part-size 2GiB) or a given number of parts (--parts 4). Every command reads the parts as one archive, and jabara join gives back the archive byte for byte; see Split an archive into parts and join it back.

Codecs

Codec Type Needs a base
bytegroup-zstd/1 lossless no
quant8-linear/1 lossy no
quant8-log/1 lossy no
raw/1 lossless no
sub-delta/1 lossless yes
xor-delta/1 lossless yes
zipnn/1 lossless no
zstd/1 lossless no

A codec that needs a base stores each tensor as its difference from the same tensor in an earlier archive. The codec reference gives the dtypes, the parameters, and the error bounds of the lossy codecs.

Extend Jabara

To extend Jabara, subclass one of these abstract base classes. You change no other code. Each example is a complete script, and a test runs all of them.

Documentation

Read the documentation on the published site. GitHub shows its MyST sources as raw text.

To build the site from the clone, run uv run --group docs sphinx-build -W --keep-going -b html docs docs/_build/html and open docs/_build/html/index.html. docs/README.md gives the Japanese build and explains how the sources are tested.

To work on Jabara, run uv sync in the clone to install the locked dev group, then uv run tox to run the tests, ruff, and mypy.

License

MIT. See LICENSE.

Metadata

Release files for jabara 0.2.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for jabara 0.2.1
File Size Uploaded Provenance Actions
jabara-0.2.1.tar.gz 135.3 kB With provenance Details for jabara-0.2.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for jabara 0.2.1
File Interpreter ABI Platform Actions
jabara-0.2.1-py3-none-any.whl Python 3 none any Details for jabara-0.2.1-py3-none-any.whl

Total release size: 295.5 kB

Release files / jabara-0.2.1.tar.gz

Download URL jabara-0.2.1.tar.gz
Size 135.3 kB
Tags Source
SHA-256 checksum
How to use checksums
f7dfa451efbc5589a23d06aa3aa7b8b411d87bf0b172a46c741487654dad5063
BLAKE2b-256 checksum
How to use checksums
154bc21ecf386ace9c8c0184c05c54850c2839b9cc65d7a039c3bbc78dafc6fe
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Dec 1, 2026.

Transparency log

Release files / jabara-0.2.1-py3-none-any.whl

Download URL jabara-0.2.1-py3-none-any.whl
Size 160.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f3b2474ae75eba5aa51d7fe4e54e5324013897a665913ab3ec70b65c4cf562d4
BLAKE2b-256 checksum
How to use checksums
8d8f91f7fa747806b0eaef519adfcddeb67fa31b881c8d57fca22fb9dabd8c0e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Dec 1, 2026.

Transparency log

Security for jabara 0.2.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for jabara-0.2.1.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Dec 1, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.2.1 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page