keepcalculator

06 Numbers and Powers

GGUF vs EXL2: Which Local LLM Format Should You Use?

Card No. 06·20639 · Updated · Standard formula, shown below

GGUF and EXL2 are the two dominant file formats for running large language models locally, and the right choice depends on your hardware and workflow. Use GGUF if you have an NVIDIA, AMD, or Apple Silicon GPU with limited VRAM, or if you want maximum compatibility with tools like llama.cpp and Ollama; use EXL2 if you have a modern NVIDIA GPU with ample VRAM and want the fastest inference speeds with the best memory efficiency.

Background: Why Format Matters

When you download an open-source model like Llama 3 or Mistral, you typically get the full-precision weights (often 16-bit or 32-bit floats). These files are huge—a 7-billion-parameter model can exceed 14 GB—and too large for most consumer GPUs. Quantization reduces the precision of those weights (e.g., from 16-bit to 4-bit), shrinking the file size and VRAM footprint while sacrificing a small amount of accuracy. The format determines how those quantized weights are packed, stored, and executed.

GGUF (GPT-Generated Unified Format) was introduced by the llama.cpp project as a successor to GGML. It is a container format that stores the model weights along with tokenizer data and metadata in a single file. EXL2 is the quantization format used by the ExLlamaV2 library, designed specifically for NVIDIA GPUs with CUDA. Both achieve 4-bit or 5-bit quantization, but they differ in how they handle memory, speed, and compatibility.

How GGUF Works

GGUF files are designed to be CPU-friendly and work across a wide range of hardware. The llama.cpp library, which powers tools like Ollama and LM Studio, uses GGUF to run models on CPU, Apple Silicon (via Metal), AMD GPUs (via Vulkan or ROCm), and NVIDIA GPUs (via CUDA). The format supports a technique called “memory mapping� (mmap), which allows the operating system to load parts of the model on demand, reducing initial load time and enabling partial offloading to GPU.

GGUF supports multiple quantization levels, from 2-bit to 8-bit, with common ones like Q4_K_M and Q5_K_M. The “K� variants use a mixed quantization scheme that preserves important tensors at higher precision, giving better quality per bit. Because GGUF is a container, it also stores the tokenizer and special tokens, so you don’t need separate files.

How EXL2 Works

EXL2 is the native format for ExLlamaV2, a high-performance inference library for NVIDIA GPUs. It uses a per-layer quantization that can mix different bit widths (e.g., 4.25 bits per weight) to achieve a target average. This allows fine-grained control over the trade-off between size and quality. For example, you can create an EXL2 model with an average of 4.5 bits, which might be smaller than a 5-bit GGUF but more accurate than a 4-bit GGUF.

ExLlamaV2 is written in CUDA and optimized for NVIDIA GPUs, so it can utilize tensor parallelism (splitting the model across multiple GPUs) and Flash Attention for faster inference. It also supports a “streaming� mode that loads layers on the fly, but it generally requires the entire model to fit in VRAM for best performance. Unlike GGUF, EXL2 does not support CPU inference—it is strictly GPU-only.

Comparing Speed, Size, and Quality

The most significant difference is speed. On an NVIDIA GPU, EXL2 typically outperforms GGUF by a noticeable margin—often 20-50% faster in tokens per second—because ExLlamaV2 is a purpose-built CUDA kernel, while llama.cpp’s CUDA backend is less optimized. However, on Apple Silicon or AMD GPUs, GGUF is the only viable option, as EXL2 does not run on those platforms.

In terms of file size, both formats can compress a 7B model to around 4-5 GB at 4-bit quantization. EXL2 offers slightly better quality per byte because of its mixed-bit approach, but the difference is often imperceptible in casual use. For a 13B model, EXL2 at 4-bit might be around 8 GB, while GGUF Q4_K_M is about 8.1 GB—nearly identical.

Quality-wise, both are comparable at the same bit rate. A 4-bit GGUF and a 4-bit EXL2 will produce similar outputs, though EXL2 can squeeze more quality out of the same file size by allocating more bits to important layers.

Choosing the Right Format for Your Hardware

The decision hinges on your GPU and how you plan to run the model.

  • NVIDIA GPU with 8 GB+ VRAM: EXL2 is the best choice if you want maximum speed and can fit the entire model in VRAM. For a 7B model, a 4-bit EXL2 file is about 4 GB, so it fits comfortably. If you have 12 GB or more, you can run 13B models at 4-bit.
  • Apple Silicon (M1/M2/M3): GGUF is the only option. Use llama.cpp or Ollama, which are well-optimized for Metal. A 7B model at 4-bit runs at usable speeds (20-40 tokens/s).
  • AMD GPU (Windows/Linux): GGUF with Vulkan or ROCm. Some users report success with EXL2 via ROCm, but it’s less mature. Stick with GGUF for reliability.
  • CPU-only: GGUF is the only choice. Expect slow speeds (a few tokens per second) but it works.

If you have a GPU with less than 6 GB VRAM, you may need to offload some layers to CPU. GGUF handles this gracefully, while EXL2 will either crash or become very slow. In that case, GGUF is the safer bet.

Common Problems and Misconceptions

One common misconception is that GGUF is “worse� than EXL2 because it’s slower. In reality, GGUF is a more versatile format that trades a bit of speed for compatibility. Another misconception is that you can convert any GGUF to EXL2 easily. While tools exist to convert, they require the original FP16 model, not the quantized GGUF. So if you download a GGUF file, you cannot turn it into EXL2 without finding the original weights.

A frequent problem with EXL2 is running out of VRAM. If the model doesn’t fit, the inference fails or becomes extremely slow due to swapping. With GGUF, you can set a “GPU layers� parameter to offload only part of the model, which often works better on lower-VRAM cards. Another issue is that EXL2 files are not compatible with llama.cpp-based tools, so if you switch to Ollama, you’ll need to download a GGUF version.

Practical Recommendations

For most users, GGUF is the safer default because it works everywhere. If you have a high-end NVIDIA GPU (RTX 3090/4090 or better) and want the fastest possible inference for local chat or coding, EXL2 is worth the extra setup. Many users end up keeping both formats for different models—GGUF for quick tests and EXL2 for daily use on their main GPU.

Frequently Asked Questions

Can I run EXL2 on an AMD GPU?

Officially, ExLlamaV2 is CUDA-only. Some users have gotten it working on AMD via ROCm or Vulkan wrappers, but it’s not stable. Use GGUF instead.

Which format gives better quality: GGUF Q4_K_M or EXL2 4-bit?

They are very close. EXL2’s mixed-bit approach can preserve more precision in critical tensors, so it may be slightly better, but the difference is rarely noticeable in practice.

Can I convert GGUF to EXL2?

Not directly. You need the original FP16 model. Conversion tools like convert.py from ExLlamaV2 take the FP16 weights and quantize to EXL2. You cannot convert a quantized GGUF back to full precision.

Why is EXL2 faster than GGUF on my NVIDIA GPU?

ExLlamaV2 uses custom CUDA kernels that are more optimized than llama.cpp’s CUDA backend. It also supports Flash Attention, which speeds up inference for long contexts.

Does GGUF support multi-GPU setups?

Yes, llama.cpp can split a model across multiple GPUs, but it’s not as efficient as EXL2’s tensor parallelism. For multi-GPU, EXL2 is generally better.

Which format should I use for a 70B model?

If you have enough VRAM (e.g., two 24 GB GPUs), EXL2 at 4-bit gives the best speed. If you have a single GPU with 24 GB, a 4-bit GGUF with offloading might work, but expect slower speeds.

Related

Method: the standard formula for this calculation, rounded as each result states. See how the calculators work or report an error.

More cards in this drawer

The whole Numbers and Powers drawer →