awesome-repositories.com
Blog
MCP
awesome-repositories.com

Discover the best open-source repositories with AI-powered search.

ExploreCurated searchesOpen-source alternativesSelf-hosted softwareBlogSitemap
ProjectMCP serverAboutHow we rankPress
LegalPrivacyTerms
© 2026 Bringes Technology SRL·VAT RO45896025·hello@awesome-repositories.com
·
huggingface avatar

huggingface/safetensors

0
View on GitHub↗
3,777 stars·328 forks·Rust·Apache-2.0·8 viewshuggingface.co/docs/safetensors↗

Safetensors

Safetensors is a secure tensor serialization format and library designed for storing and distributing model weights. Its primary purpose is to provide a safe file format for machine learning tensors that prevents the execution of arbitrary or malicious code during the deserialization process.

The project is distinguished by its use of zero-copy memory mapping, which reads data from disk directly into memory to minimize overhead. It enables cross-framework compatibility, allowing tensor data to be serialized and deserialized across different machine learning libraries.

The system covers high-level capabilities for tensor metadata management, using a header-based approach to parse shapes and auxiliary information without loading the full data array. It also supports efficient tensor slicing by calculating byte offsets to load only specific portions of a tensor into memory.

Features

  • Safe Tensor Formats - Provides a secure serialization format for neural network weights that prevents arbitrary code execution during loading.
  • Universal Model Weight Distribution - Stores tensor data in a universal format that ensures compatibility across different machine learning libraries.
  • Machine Learning Model Formats - Implements a portable file format for model weights that eliminates security risks associated with code execution.
  • Secure Weight Formats - Saves model weights in a secure format that prevents malicious code execution during the loading process.
  • Zero-Copy Weight Loaders - Employs memory mapping and zero-copy mechanisms to import model weights with maximum efficiency.
  • Tensor Libraries - Provides a library for serializing and deserializing tensor data across disparate machine learning environments.
  • Zero-Copy Memory Mappings - Maps file contents directly into memory addresses to eliminate redundant data copying between disk and application.
  • Zero-Copy Deserialization - Reads serialized tensors using zero-copy deserialization to minimize memory usage and increase processing speed.
  • Binary Execution Restrictions - Ensures tensors are stored as raw byte arrays to prevent the execution of arbitrary code during deserialization.
  • Framework-Agnostic Formats - Provides a standardized binary layout enabling tensor data to be read across different machine learning libraries.
  • Tensor Data Mapping - Enables loading of tensor data structures across different machine learning frameworks for environment compatibility.
  • Tensor-Metadata Bundles - Extracts descriptive tensor information and shapes without loading the entire data array into system memory.
  • Tensor - Implements a JSON header at the start of files to allow reading tensor shapes without loading all data.
  • Byte Sequence Storage - Organizes tensor data in contiguous byte sequences to ensure compatibility with low-level memory access.
  • Tensor Slicing - Calculates byte offsets to extract specific portions of a tensor directly from a file.
  • Data Storage Systems - Stores and distributes tensors safely and efficiently.

Star history

Star history chart for huggingface/safetensorsStar history chart for huggingface/safetensors

AI search

Explore more awesome repositories

Describe what you need in plain English — the AI ranks thousands of curated open-source projects by relevance.

Start searching with AI

Open-source alternatives to Safetensors

Similar open-source projects, ranked by how many features they share with Safetensors.
  • rkyv/rkyvrkyv avatar

    rkyv/rkyv

    4,267View on GitHub↗

    rkyv is a zero-copy deserialization framework for Rust that provides a binary serialization format for memory-mappable data archives. It allows complex data structures to be mapped to bytes and accessed directly from a buffer without allocating new memory or copying data. The project enables the serialization of polymorphic types and trait objects, maintaining their dynamic behavior and structure within the binary form. It utilizes relative-pointer addressing and byte-aligned structure packing to ensure data remains valid regardless of where it is loaded in memory. The framework covers high-

    Rustrustserializationzero-copy
    View on GitHub↗4,267
  • torch/torch7torch avatar

    torch/torch7

    9,127View on GitHub↗

    Torch7 is a scientific computing environment and tensor computation library used for deep learning research and numerical analysis. It functions as a Lua-based framework for training neural networks and learning agents, providing a toolkit for implementing architectures and training through reinforcement learning algorithms. The project is distinguished by its tight integration with C, utilizing a binding layer to map high-level scripting to low-level C structures for direct memory access. It supports hardware-accelerated computation by offloading linear algebra and convolution operations to

    C
    View on GitHub↗9,127
  • zserge/jsmnzserge avatar

    zserge/jsmn

    4,065View on GitHub↗

    jsmn is a lightweight JSON parser library written in C. It provides zero-copy tokenization and incremental parsing designed for use in embedded systems and memory-constrained environments. The library identifies structural JSON elements by providing offsets into the original string rather than allocating new memory for data. It uses a single-pass scanning method and requires static-buffer allocation, meaning the caller provides the memory for tokens to avoid dynamic allocation during the parsing process. The parser supports incremental streaming, allowing it to process JSON data in chunks fr

    Cjson-datajson-stringparsing
    View on GitHub↗4,065
  • arogozhnikov/einopsarogozhnikov avatar

    arogozhnikov/einops

    9,398View on GitHub↗

    Einops is a tensor manipulation library that provides a framework-agnostic interface for reshaping, Einstein summation, and multi-dimensional array operations. It serves as an abstraction layer that works across NumPy, PyTorch, TensorFlow, and JAX, allowing for tensor transformations without changing the API. The library distinguishes itself through a declarative notation system that uses readable string patterns to describe tensor rearrangements and reductions. This approach includes an extended Einstein summation interface that supports multi-letter axis names and a named dimension mapping

    Pythoncupydeep-learningeinops
    View on GitHub↗9,398
See all 30 alternatives to Safetensors→

Frequently asked questions

What does huggingface/safetensors do?

Safetensors is a secure tensor serialization format and library designed for storing and distributing model weights. Its primary purpose is to provide a safe file format for machine learning tensors that prevents the execution of arbitrary or malicious code during the deserialization process.

What are the main features of huggingface/safetensors?

The main features of huggingface/safetensors are: Safe Tensor Formats, Universal Model Weight Distribution, Machine Learning Model Formats, Secure Weight Formats, Zero-Copy Weight Loaders, Tensor Libraries, Zero-Copy Memory Mappings, Zero-Copy Deserialization.

What are some open-source alternatives to huggingface/safetensors?

Open-source alternatives to huggingface/safetensors include: rkyv/rkyv — rkyv is a zero-copy deserialization framework for Rust that provides a binary serialization format for memory-mappable… torch/torch7 — Torch7 is a scientific computing environment and tensor computation library used for deep learning research and… zserge/jsmn — jsmn is a lightweight JSON parser library written in C. It provides zero-copy tokenization and incremental parsing… lanpa/tensorboard-pytorch — This project is a machine learning experiment tracker and event file generator that enables the recording of scalars,… arogozhnikov/einops — Einops is a tensor manipulation library that provides a framework-agnostic interface for reshaping, Einstein… facebookresearch/flashlight — Flashlight is a C++ machine learning library and deep learning framework designed for building and training neural…