Safetensors Joins the PyTorch Foundation

Safetensors Joins the PyTorch Foundation

Safetensors has joined the PyTorch Foundation as a foundation-hosted project under the Linux Foundation. This transition moves the project's trademark, repository, and governance to a vendor-neutral home, ensuring that the development of the model weight storage format is driven by the broader machine learning community rather than a single company.

Technical Architecture of Safetensors

Safetensors is a serialization format designed to replace pickle-based formats by eliminating the risk of arbitrary code execution during model loading. The format is built on a simple architecture consisting of two primary components:

  • JSON Header: A metadata section with a hard limit of 100MB that describes the tensor metadata.
  • Raw Tensor Data: The actual weight data following the header, which allows for zero-copy loading (mapping tensors directly from disk) and lazy loading (reading individual weights without deserializing the entire checkpoint).

Governance and Community Transition

By joining the PyTorch Foundation, Safetensors moves from being a Hugging Face project to a community-governed project. While Hugging Face maintainers Luc and Daniel remain on the Technical Steering Committee and continue to lead day-to-day operations, the project now formally belongs to the Linux Foundation.

For contributors, the path to becoming a maintainer is now formally documented in the repository's GOVERNANCE.md and MAINTAINERS.md files. This shift provides a stable, long-term foundation for organizations building on top of the format.

Impact on Users and Contributors

There are no breaking changes for existing users. The format, APIs, and Hugging Face Hub integration remain identical, and all models currently stored in Safetensors format will continue to function as they do now.

Future Roadmap and Integration

Safetensors is working toward several key technical enhancements to improve performance and compatibility across the ML ecosystem:

PyTorch Core Integration

The project is collaborating with the PyTorch team to integrate Safetensors within PyTorch core as a serialization system for torch models.

Hardware Acceleration and Parallelism

The roadmap includes the development of device-aware loading and saving, enabling tensors to load directly onto accelerators such as CUDA and ROCm without requiring CPU staging. Additionally, first-class APIs for Tensor Parallel and Pipeline Parallel loading are being developed to ensure each rank or pipeline stage only loads the necessary weights.

Quantization Support

Safetensors will formalize support for evolving quantization formats, including:

  • FP8
  • Block-quantized formats (such as GPTQ and AWQ)
  • Sub-byte integer types

Sources