Glossary
Safetensors
The safe way to ship model weights. A simple header-plus-bytes format that loads fast, cannot run code when opened, and has become the default on the Hugging Face Hub.
General definition
Safetensors is a file format for storing the tensors that make up a trained model. A file starts with an 8-byte length, then a JSON header listing every tensor with its name, data type, shape and byte offsets, then the raw tensor bytes. There is nothing else in it: no Python objects, no class references, no executable content. That is the whole point. The format was created by Hugging Face in 2022, has had an external security audit, and is now the default for weights published on the Hugging Face Hub.
The format it replaces is Python’s pickle, which PyTorch used for .bin and .pt checkpoint files. Pickle is a serialisation of Python objects, and unpickling can execute arbitrary code, so loading a model file from an untrusted source is equivalent to running an unknown script. Malicious checkpoints carrying hidden payloads have been found on public hubs, and the usual mitigations (file scanners, restricted loading modes) are patches rather than a fix. Safetensors removes the attack surface by making the file pure data.
- Safe loading: a parser reads a header and copies bytes; there is no code path that can be hijacked
- Fast and lazy: files can be memory-mapped and individual tensors read without loading the whole file, which speeds up start-up and sharded multi-GPU loading
- Framework neutral: loaders exist for PyTorch, TensorFlow, JAX, Rust and others, so the same file serves training and inference stacks
- Simple to inspect: the header tells you exactly what a file contains before you trust it
Safetensors usually holds full-precision or half-precision weights (float32, bfloat16, float16), often split across several shard files for large models. GGUF, the format used by llama.cpp and Ollama, is a different single-file format that packages quantized weights together with tokenizer and metadata for CPU and consumer-GPU inference. The typical path is: a model is published in safetensors, a conversion script produces a GGUF at the chosen quantization, and the GGUF is what runs on a laptop. Serving stacks such as vLLM load safetensors directly. In both cases checking a file’s hash against the publisher’s value is still good practice, because a safe format protects against code execution, not against a swapped or tampered model.
In the Ethora ecosystem
Ethora does not load model files itself. The AI service behind the AI SDK sends requests to an OpenAI-compatible endpoint, and the serving layer behind that endpoint, whether Ollama, vLLM or a cloud API, is what reads the weights. The file format therefore matters at the point where your team chooses and installs a model for a self-hosted deployment, not anywhere in the chat or agent code.
For teams running the self-hosted LLM AI agent setup, the practical rule is to pull model weights in safetensors or GGUF from a known publisher, verify checksums, and keep pickle-based checkpoints off production hosts. Those hosts sit inside the same perimeter as the chat server and the message archive, so a compromised model file would be a compromise of a regulated environment, which is exactly the risk this format exists to remove.