Free | No tracking | Every fact with a source|German and English

Glossary / Models and files

safetensors – explained simply

safetensors is a safe and fast file format for model weights that cannot execute hidden code when loaded.

Also: .safetensors, Safetensors format

Older model formats like .ckpt, .pt, or .bin often rely on Python's pickle mechanism. Pickle can execute arbitrary code when loaded, so a tampered model file could launch malware. safetensors, on the other hand, stores only numbers and metadata.

Hugging Face describes the format as simple, secure, and still fast. It is used by many projects, including transformers, diffusers, ComfyUI, and llama.cpp.

What does that mean for you? If a model is offered both as .safetensors and as .ckpt or .bin, always choose the safetensors file.

Related terms

Errors where that matters

Sources