# GGUF

- **Canonical URL:** https://getaimath.com/dictionary/gguf/
- **Topics:** [Quantization & Model Compression](https://getaimath.com/dictionary/category/quantization-and-model-compression/), [Local AI & Open-Weight Models](https://getaimath.com/dictionary/category/local-ai-and-open-weight-models/)
- **Also called:** GGUF Model
- **Last updated:** 2026-11-25

## What is GGUF?

**In one sentence:** GGUF is a file format for storing AI models, especially quantized ones, made for llama.cpp and tools like Ollama and LM Studio.

A GGUF file packs a model's weights, tokenizer and settings into one file. It supports many quantization levels, from 2-bit to 8-bit and full precision. It replaced the older GGML format.

![Quantization: Vacuum-Packing a Giant AI into a Carry-On Bag — Simple cartoon showing a huge 16 GB AI model with long fussy decimals (3.14159265) squeezed by a vacuum-seal press into a compact 4 GB model with rounded numbers (3.1) that fits on a laptop.](https://getaimath.com/diagrams/quantization-and-model-compression.png)
*Napkin Diagram (Quantization & Model Compression): By rounding long fussy decimals to neat short numbers, quantization shrinks a model about 4× with only a small loss in smarts.*

## What is an example of GGUF?

"llama-3-8b-instruct.Q4_K_M.gguf" is a GGUF file for a 4-bit Llama 3 model.

## Why does GGUF matter?

GGUF is the most popular format for running models on your own computer.

## GGUF vs. Safetensors

Safetensors is the standard safe format for sharing model weights on Hugging Face and serving them on GPUs, while GGUF packs (usually quantized) weights plus tokenizer and settings into one file built for local tools like llama.cpp and Ollama.

| Dimension | GGUF | [Safetensors](https://getaimath.com/dictionary/safetensors/) |
| --- | --- | --- |
| Primary ecosystem | llama.cpp, Ollama, LM Studio (local devices) | PyTorch, vLLM, Hugging Face (training & servers) |
| Packaging | Single self-contained file (weights + metadata) | Weight shards alongside config/tokenizer JSONs |
| Security | Memory-mappable binary format (no arbitrary code) | Zero-copy safe format replacing unsafe pickle files |

## Related Concepts

- [2-bit Quantization](https://getaimath.com/dictionary/2-bit-quantization/): 2-bit quantization stores each weight in about 2 bits, making models extremely small but often noticeably worse.
- [GGML](https://getaimath.com/dictionary/ggml/): GGML is a machine learning library written in C for running models efficiently on regular computers, and also the name of its older file format.
- [Model Hub](https://getaimath.com/dictionary/model-hub/): A model hub is a website or platform that hosts many AI models for people to discover and download.
- [Safetensors](https://getaimath.com/dictionary/safetensors/): Safetensors is a safe, fast file format for storing model weights, created by Hugging Face.
- [4-bit Quantization](https://getaimath.com/dictionary/4-bit-quantization/): 4-bit quantization stores each weight in about 4 bits, shrinking a 16-bit model to roughly a quarter of its size.
- [GPTQ](https://getaimath.com/dictionary/gptq/): GPTQ is a method for quantizing models to 4 bits or fewer after training, while carefully keeping quality high.

---
Source: The AI Math Dictionary (https://getaimath.com/dictionary/gguf/)
