safetensors
Decision gist · record as of 2026-08-14
Yes. Safetensors is a production-ready, actively maintained library with no vulnerabilities, permissive licensing, and broad platform support. It solves a real problem—safe, standardized tensor storage—and is widely adopted in machine learning. Install it if you work with tensor serialization or model checkpoints.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires Python 3.10 or later; compiled extension requires a compatible platform (wheels provided for most common architectures).
- Medium install friction due to compiled wheels; however, prebuilt binaries are available for common platforms including x86_64, ARM, and RISC-V.
- Package is actively maintained with a recent release and no known vulnerabilities.
License · maintenance · safety
permissive license (permissive) — Licensed under Apache Software License (permissive), allowing commercial and private use with minimal restrictions.
last release 2026-06-09 (66 days) · last repo commit 2026-08-04 · 3,851 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 105,773,531 downloads/mo, #327 on PyPI
Alternatives
Verify before relying
pip install safetensors
from safetensors.numpy import save_file, load_file
tensors = {"a": "array_data"}
save_file(tensors, "./model.safetensors")
loaded = load_file("./model.safetensors")- Performance comparison with other tensor serialization formats
- Whether the format supports streaming or partial loading of large models
- Compatibility guarantees across different safetensors versions
- Framework-specific integration details beyond the API shown in examples
What it is and what it does
Safetensors is a tensor serialization library that saves and loads numerical data in a standardized, secure binary format. It provides a Python API with support for multiple tensor frameworks, allowing you to persist tensor data to disk and reload it with type and shape information preserved.
The package is built on a Rust core for performance and safety, and is widely used in machine learning workflows for storing and sharing model checkpoints. It has no runtime dependencies beyond the Python standard library, making it lightweight to integrate into existing projects. The library is actively maintained, production-stable, and carries no known security vulnerabilities.
Use it for
- Save and load model weights during training checkpoints and inference
- Serialize numerical arrays for scientific computing pipelines with guaranteed format stability
- Share pre-trained model weights safely across teams or in public repositories
- Store tensor data in a language-agnostic format for interoperability with non-Python tools
- Replace pickle for tensor serialization to avoid arbitrary code execution risks
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes.
Safetensors is a production-ready, actively maintained library with no vulnerabilities, permissive licensing, and broad platform support. It solves a real problem—safe, standardized tensor storage—and is widely adopted in machine learning. Install it if you work with tensor serialization or model checkpoints.
Install
safetensors on PyPI
Before you install
Medium install friction due to compiled wheels; however, prebuilt binaries are available for common platforms including x86_64, ARM, and RISC-V. Package is actively maintained with a recent release and no known vulnerabilities.
Requires Python 3.10 or later; compiled extension requires a compatible platform (wheels provided for most common architectures).
License in practice
Licensed under Apache Software License (permissive), allowing commercial and private use with minimal restrictions.
Quickstart
pip install safetensors
from safetensors.numpy import save_file, load_file
tensors = {"a": "array_data"}
save_file(tensors, "./model.safetensors")
loaded = load_file("./model.safetensors")
Verify before relying
- Performance comparison with other tensor serialization formats
- Whether the format supports streaming or partial loading of large models
- Compatibility guarantees across different safetensors versions
- Framework-specific integration details beyond the API shown in examples
Package facts
| License | permissive license permissive |
| Python support | Supports the current Python release >=3.10 |
| Install friction | Medium. Platform-specific wheel |
| Runtime dependencies | None |
| Maintenance | Actively maintained 66 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 105,773,531 / month, #327 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Development Status :: 5 - Production/StableIntended Audience :: DevelopersIntended Audience :: EducationIntended Audience :: Science/ResearchLicense :: OSI Approved :: Apache Software LicenseOperating System :: OS IndependentProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Topic :: Scientific/Engineering :: Artificial IntelligenceTyping :: Typed |
Evidence: safetensors-0.8.0-cp310-abi3-macosx_10_12_x86_64.whl; safetensors-0.8.0-cp310-abi3-macosx_11_0_arm64.whl; safetensors-0.8.0-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl; safetensors-0.8.0-cp310-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl; safetensors-0.8.0-cp310-abi3-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl; safetensors-0.8.0-cp310-abi3-manylinux_2_17_s390x.manylinux2014_s390x.whl; safetensors-0.8.0-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl; safetensors-0.8.0-cp310-abi3-manylinux_2_31_riscv64.whl; safetensors-0.8.0-cp310-abi3-manylinux_2_5_i686.manylinux1_i686.whl; safetensors-0.8.0-cp310-abi3-musllinux_1_2_aarch64.whl; safetensors-0.8.0-cp310-abi3-musllinux_1_2_armv7l.whl; safetensors-0.8.0-cp310-abi3-musllinux_1_2_i686.whl; safetensors-0.8.0-cp310-abi3-musllinux_1_2_x86_64.whl; safetensors-0.8.0-cp310-abi3-win32.whl; safetensors-0.8.0-cp310-abi3-win_amd64.whl; safetensors-0.8.0-cp310-abi3-win_arm64.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “tensor serialization format”
- safetensorsSerializes and deserializes tensors to and from a safe, standardized…
- ggufReads and writes binary files in the GGUF (GGML Universal File)…
- tosa-toolsTOSA Tools provides serialization, reference implementation, and…
Give your agent the search over MCP, or paste the wish link into any chat.
More Artificial Intelligence packages
LiteLLM provides a unified Python interface to call 100+ LLM providers (OpenAI, Anthropic, Gemini, Bedrock, Azure, and others) using OpenAI-compatible API format, available as both a Python SDK and a self-hosted AI Gateway proxy server.
Install it if you need to work with multiple LLM providers or want to centralize LLM routing in your organization.
Client library and CLI tool for downloading, uploading, and managing models, datasets, and repositories on the Hugging Face Hub platform.
Install it if you work with Hugging Face Hub models or datasets.
LangChain provides a framework for building agents and LLM-powered applications by composing language models, tools, and memory through a unified API that abstracts over multiple model providers.
hf-xet provides chunk-based deduplication and efficient file transfer for the Hugging Face Hub, enabling faster uploads and downloads of large files with local disk caching.
Tokenizers converts raw text into token sequences for NLP models, with support for training custom vocabularies and using pre-built tokenizers (BPE, WordPiece) optimized for speed via Rust.
Transformers provides a unified framework for loading, fine-tuning, and running state-of-the-art pretrained models across text, vision, audio, video, and multimodal tasks using PyTorch, JAX, or TensorFlow.
Install it if you need to run or train any transformer-based model for NLP, vision, audio, or multimodal tasks.
See also instanttensor · tensorizer · fastsafetensors · compressed-tensors · gguf · torchtyping · tensordict · optimum-quanto · docarray · petastorm