Safetensors

Safetensors is a format for storing AI model weights without executing arbitrary code when a file is loaded.

3 articlesLast mentioned

Safetensors is a file format and open-source library introduced by Hugging Face in 2022 for storing tensors, the numerical arrays used as AI model weights. It is designed to load data without executing arbitrary code from the file.

Loading objects serialized with pickle can execute arbitrary code. Safetensors focuses on storing weight data, whereas ONNX can also represent a model's computational structure.

This entry is based on AIPOST articles and widely known facts. If something is wrong, please send us a correction request.

Articles covering this entry

  • Pre-Training, Fine-Tuning and RL: Where Frontier LLMs Get Their QualityAI Performance ·

    …you get a configuration file, tokenizer assets, serialized weight shards (safetensors files), and a Python class whose forward function routes input through tho…

    Read article
  • Comfy MCP and Claude Code: Repairing Image WorkflowsAI in Practice ·

    …de Code found that the required model was not installed, then downloaded 4x-UltraSharp.safetensors, an approximately 67 MB model-weight file, from Hugging Face.

    Read article
  • AI Security: Web Inputs, RAG Sources, and Model FilesAI Security ·

    Prefer safer model serialization formats such as Safetensors or ONNX instead of sharing pickle files.

    Read article

Found a mistake or missing an entry?

Wiki entries are based on AIPOST articles and widely known facts. If an entry is wrong, send us a correction request and we will check and fix it. Names from new articles are added to the wiki after the article is published.