pt-loader
Safe parser-based PyTorch checkpoint converter to safetensors with both Rust and Python APIs.
Features
- Parses torch zip
.ptcheckpoints with strict safety limits. - Converts checkpoints to
model.safetensors+model.yaml. - Inspects checkpoint metadata and tensor summaries.
- Loads tensors directly into Python as NumPy arrays.
Python Usage
Install from source (local repo):
Example:
=
=
=
Rust Usage
use ;
use Path;
let report = inspect_pt?;
let result = convert_pt_to_safetensors?;
Development
Releasing
- Tag a release as
vX.Y.Z. - GitHub Actions workflow
.github/workflows/release.ymlwill:- publish to crates.io using
CRATES_IO_TOKEN - build and publish to PyPI via trusted publishing
- publish to crates.io using