AI file formats
Formats for trained AI models and the files that travel with them. Model weights are large arrays of numbers called tensors; some formats hold only those, others also describe the network so another program can run it. Training saves checkpoints, which can carry the optimiser state as well. Adapters such as LoRA hold a small set of extra weights that change a base model without replacing it. Beside the weights sit small text files: the tokenizer, which turns text into the numbers a language model reads, and the config, which gives the model’s architecture and sizes.
Formats
.BIN
GGML model fileThe model format of ggml and whisper.cpp from before GGUF.
.CKPT
Model checkpointA training snapshot: weights, optimiser state and step counts.
.ENGINE
TensorRT engineA model compiled by TensorRT for one NVIDIA GPU and TensorRT version.
.GGUF
GGUF model fileA language model for llama.cpp: metadata and quantised weights.
.JSON
Hugging Face model configconfig.json: a model’s architecture and sizes, read before the weights.
.JSON
Hugging Face tokenizertokenizer.json: a language model’s vocabulary and tokenising rules.
.KERAS
Keras modelA whole Keras model: JSON config and HDF5 weights in a ZIP archive.
.MLMODEL
Core ML modelA model for apps on Apple devices, as a Protocol Buffers message.
.ONNX
Open Neural Network ExchangeA neural network’s graph and weights in one Protocol Buffers message.
.PB
TensorFlow SavedModelA TensorFlow model folder: saved_model.pb graph, variables and assets.
.PT
PyTorch modelTensors saved by torch.save: a pickle and raw data in a ZIP archive.
.SAFETENSORS
LoRA adapterSmall low-rank A and B matrices that adjust a base model’s layers.
.SAFETENSORS
SafetensorsModel weights after a JSON header, safe to load with no code.
.TFLITE
TensorFlow Lite modelA model for phones and small devices, as one FlatBuffers file.