Home › Formats › .SafetensorsFull
What is a .Safetensors file?
Safetensors holds the learned numbers of a model and nothing else - no architecture, no code. An eight-byte length, then JSON naming every tensor with its type, shape and byte range, then the raw data. The whole design is that reading it is just reading.
- Did you know
- Hugging Face introduced Safetensors in 2022 specifically to replace pickled PyTorch checkpoints, which cannot be loaded without running whatever the person who saved them chose to put in.
- A safetensors file begins with an 8-byte little-endian length, then a JSON header listing each tensor’s name, shape, dtype and byte offsets.
- Because the weight data sits in one contiguous block, loaders can memory-map it straight from disk without copying it through RAM.
- What Analyser shows you
- Open machine-learning models and read what is actually in them. ONNX models and frozen TensorFlow graphs are drawn as a graph: every operation as a box, every tensor flowing between them as a line, laid out left to right by depth so parallel branches sit side by side. Neither format stores the connections - a node follows another because one of its inputs is one of the other's outputs - so the edges are recovered by matching those names. Alongside the picture: the operation mix that fingerprints the architecture, the input and output shapes (including the dynamic ones a model leaves open), every weight tensor with its shape, and the total parameter count. Weight files are read too - Safetensors and GGUF give up their full tensor list, precision and parameter count, and a GGUF also declares its architecture, context length and quantisation. A PyTorch checkpoint is a Python pickle, which is a program rather than a document, so nothing in it is ever run: the opcodes are read as bytes and every module it would import is listed, with anything a file of numbers has no business touching flagged. Keras models have their layer list read from the architecture JSON.
- Open a .Safetensors file
- Drag a .Safetensors file onto the Analyser home page (or tap to pick one). It opens entirely in your browser - nothing is uploaded, there is no account, and it works offline once installed.