PTWM
Guides

CLI usage

Compress and decompress files with the `ptwm` command-line tool.

The ptwm command compresses and decompresses files. Compressed output uses the .ptwm suffix.

Compress a safetensors model

Tensor-by-tensor compression into a single multi-tensor .ptwm file:

ptwm compress model.safetensors
# produces model.safetensors.ptwm

Compress an arbitrary file

ptwm compress model.bin
# produces model.bin.ptwm

Compress every safetensors file in a directory

ptwm compress /path/to/model/

Each shard gets its own .ptwm file alongside.

Decompress

ptwm decompress model.safetensors.ptwm
# restores model.safetensors

Delta compression

Compress relative to a reference file. The output omits the reference — both compressor and decompressor must have access to it.

ptwm compress model_v2.safetensors --delta model_v1.safetensors

See Delta compression for when this is worth it.

Chain promotion

Promote a chain discovered by explore_chains() into the production table:

ptwm chains promote audit-log.jsonl

This validates the chain and emits a diff for PRODUCTION_CHAINS in python/ptwm/preprocessing/_chains.py. The command stages the diff for review and writes nothing without explicit follow-up.

Help

ptwm compress --help
ptwm decompress --help
ptwm chains --help