# safetensors/safetensors

Simple, safe way to store and distribute tensors

Repository: https://github.com/safetensors/safetensors
Canonical: https://ross.abutalabs.com/products/safetensors
Homepage: https://huggingface.co/docs/safetensors
Language: Rust
License: Apache-2.0
License Family: permissive
Last push: 2026-08-26T16:40:18+00:00

## Health v2 (maintenance only)
Score: 91/100 (v2, computed 2026-09-02T17:46:02.011165+00:00)
- activity 99, release rhythm 75, longevity 100
- inputs: {"age_days": 1441, "days_push": 7, "days_rel": 85, "gap_med": 48, "n_releases_24m": 10}
- flags: none
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 3876, forks 354 (observed 2026-08-28T04:08:27.903688+00:00)

## What it is
Safetensors is a simple, secure file format and library for storing and distributing tensors, designed as a fast zero-copy alternative to pickle-based weight storage. It provides bindings for Python (PyTorch, TensorFlow, JAX, NumPy) and a native Rust implementation.

## Use cases
- save model weights without pickle security risks
- load pytorch model checkpoints fast with zero-copy mmap
- convert pickle .bin weights to safetensors format
- read tensor metadata like shapes and dtypes via HTTP range requests
- share model weights safely on the hugging face hub
- load only part of a large tensor for multi-GPU sharding

## When to choose
- you need to store or distribute neural network weights securely
- you want faster checkpoint loading than pickle-based .bin files
- you work in the Hugging Face ecosystem with Transformers or Diffusers
- you need lazy or partial loading of large tensors

## When to avoid
- you need to serialize arbitrary Python objects or non-tensor data
- you require a format with built-in compression
- you need full model architecture serialization rather than just tensors

## Facets
- artifact type: library
- maturity: stable
- function: serialization, machine-learning, deep-learning, developer-tools
- domain: machine-learning, deep-learning, large-language-models, developer-tools, files
- platform: cross-platform, python, rust, cli
- tags: tensors, model-weights, zero-copy, pickle-alternative, hugging-face, file-format, pytorch, tensorflow, jax, mmap

## Member repositories
- safetensors/safetensors (main) score 91

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:08:27.903688+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-29T18:25:45.467330+00:00, confidence not recorded.
  - readme: https://github.com/safetensors/safetensors (fetched 2026-08-28T04:08:27.903688+00:00, sha 233fca709e37)
  - homepage: https://huggingface.co/docs/safetensors (fetched 2026-08-29T09:19:59.636573+00:00, sha 7fa2c18b9c26)
  - site_page: https://huggingface.co/docs/safetensors/metadata_parsing (fetched 2026-08-29T09:19:59.653863+00:00, sha 5314e96b6508)
  - site_page: https://huggingface.co/docs (fetched 2026-08-29T09:19:59.645599+00:00, sha bdec26667b98)
  - site_page: https://huggingface.co/docs/safetensors/speed (fetched 2026-08-29T09:19:59.650097+00:00, sha 61cd81a32889)
  - site_page: https://huggingface.co/docs/safetensors/torch_shared_tensors (fetched 2026-08-29T09:19:59.651992+00:00, sha 4b5e83a1ef14)
  - site_page: https://huggingface.co/docs/safetensors/convert-weights (fetched 2026-08-29T09:19:59.655952+00:00, sha 28b914d276c3)
  - site_page: https://huggingface.co/docs/safetensors/api/torch (fetched 2026-08-29T09:19:59.657761+00:00, sha 2b027f49be6b)
  - site_page: https://huggingface.co/docs/safetensors/api/tensorflow (fetched 2026-08-29T09:19:59.659606+00:00, sha 0ca305d33ee3)
  - site_page: https://huggingface.co/pricing (fetched 2026-08-29T09:19:59.647780+00:00, sha de6b7a178be5)
- Data as of 2026-08-30T08:39:29.467469+00:00.
