Bookmarks

GGUF — GGUF format

A binary file format that stores a model’s weights and everything needed to load it: llama.cpp and other GGML-based runtimes read the model from a single file.

Also: GGUF file, GGUF model, llama.cpp model format

checked 18 Nov

All terms

GGUF was designed for fast loading and easy reading: a single file holds both the weights and the metadata, so users do not need to look for a tokenizer or settings separately. A model is usually trained in PyTorch and then converted to GGUF to run on your own computer.

What is in the file and why it is convenient

PropertyWhat it means
Single filethe model is easy to share and load, and no external files are required
Key–value metadatanew information can be added to the file without breaking compatibility with older models
mmap compatibilitythe file can be mapped into memory rather than read in full
Completenesseverything needed for loading is already inside, so the user does not have to set anything by hand

The format replaced GGML, GGMF and GGJT. The main difference from GGJT is that hyperparameters are stored as typed metadata rather than as a list of unnamed values.

How to read a file name

The specification suggests a name of the form “base — size — fine-tune — version — encoding — type — shard”. For example, Grok-100B-v1.0-Q4_0-00003-of-00009.gguf means the Grok model, 100 billion parameters, version 1.0, Q4_0 quantisation, shard three of nine. A label such as Q4_K_M or Q8_0 in the name shows how the weights are compressed: the fewer the bits, the smaller the file and the more quality may drop. The specification notes that real-world names vary widely and cannot be reliably parsed automatically.

Where the format comes from

GGUF is described in the GGML project and supported by llama.cpp: models in this format are also run by other GGML-based programs.

Sources

the term is written from these pages

Verified 18 Nov

Not to be confused with

what it is mixed up with and how it differs

  • safetensors format

    safetensors stores only tensors, whereas GGUF is designed for GGML and llama.cpp and carries standard metadata and the tokenizer vocabulary along with the weights.

  • quantisation

    Quantisation compresses the weights, whereas GGUF is the container in which the compressed weights are stored.

In depth in the references

where the topic is covered in detail