Key takeaways
- GGUF is a file format from llama.cpp that stores model weights and metadata; it supports many quantization types.
- K-quants such as Q4_K_M quantize weights in blocks with per-block scales; I-quants such as IQ4_XS squeeze more quality per bit.
- Q4_K_M is a good default; use Q5 or Q6 for higher quality, Q8 when memory allows.
- Use GGUF for CPU and mixed CPU and GPU inference; GPTQ or AWQ for GPU serving engines.
- Ollama uses GGUF models; import your own with a Modelfile, or use a GUI app for no-command workflows.
GGUF is not itself a quantization method; it is a file format, created by the llama.cpp project, that stores a model's weights and metadata in one file. It supports many quantization types, such as Q4_K_M, Q5_K_M, Q8_0 and the I-quants, which is why "GGUF" is often used loosely to mean a quantized local model. Quantization is central to FineTune Studio's QLoRA training, so this page covers how GGUF quants work, choosing one, GGUF versus GPTQ and AWQ, the best methods, GPU loading, and using GGUF with Ollama.
Is GGUF a quantization method?
No. GGUF, the GPT-Generated Unified Format, is a container format for model tensors plus metadata such as architecture, tokenizer and chat template. Within a GGUF file, tensors can be stored in full precision or in many quantized formats.
GGUF replaced the older GGML format in 2023 and is used by llama.cpp, Ollama, LM Studio and other local AI tools. The quantization happens when converting a model to GGUF with llama.cpp's tools, choosing a type such as Q4_K_M. So the accurate phrasing is "a Q4_K_M quantization stored in GGUF format". Single-file packaging is one reason GGUF became the standard for local models.
How does GGUF quantization work?
llama.cpp quantization splits weights into small blocks and stores each block as low-bit integers plus scale factors, so values can be approximately reconstructed during inference. K-quants use a two-level structure of super-blocks and sub-blocks with their own scales for better accuracy.
The suffixes describe variants: Q4 means roughly 4 bits per weight; "_K" means K-quant; "_S", "_M" and "_L" mean small, medium and large mixes, where more important tensors get higher precision. I-quants, such as IQ4_XS, use more sophisticated encodings and often an importance matrix computed from calibration text to protect influential weights. Lower bits save memory and speed up inference with some quality loss.
Which GGUF quantization should I use?
Q4_K_M is the usual default: a good balance of size, speed and quality for most models. Choose Q5_K_M or Q6_K for better quality if memory allows, Q8_0 for near-original quality, and Q3 or IQ3 variants only when memory is very tight.
Also asked as: which gguf quantization to use
Rules of thumb:
- Pick the highest quality that fits fully in your GPU memory with room for context.
- Larger models at lower bits often beat smaller models at higher bits.
- Very small models suffer more from aggressive quantization.
- Coding and maths are more sensitive than chat; test those tasks specifically.
Always compare two or three quants on your own prompts before settling.
How do Q4_K_M, IQ4_XS and IQ4_NL compare?
All three are roughly 4-bit. Q4_K_M is a K-quant with a medium mix, slightly larger and very widely used. IQ4_XS is an I-quant that is smaller for similar quality, especially with an importance matrix. IQ4_NL uses a non-linear quantization grid and suits some hardware paths.
Also asked as: gguf quantization compared: q4_k_m vs. iq4_xs vs. iq4_nl
In practice, IQ4_XS often gives quality close to Q4_K_M at a smaller size, helpful when you are just short of fitting a model in VRAM. I-quants can be slower on some CPUs and older backends, while K-quants are well optimised everywhere. Differences in output quality are usually small; measure perplexity or task accuracy on your workload if it matters, and choose for speed and fit.
GPTQ vs GGUF vs AWQ: which quantization method is right for me?
Use GGUF for local inference with llama.cpp, Ollama or LM Studio, especially on CPUs, Macs or mixed CPU and GPU setups. Use GPTQ or AWQ for GPU serving with engines such as vLLM or Transformers, where they integrate with fast GPU kernels.
Also asked as: which quantization method is right for you? (gptq vs. gguf vs. awq
GPTQ quantizes weights using second-order information to minimise error; AWQ protects weights tied to large activations; both target GPU inference at around 4 bits. GGUF offers many quantization levels and runs almost anywhere. For a production API on GPUs serving many users, AWQ or GPTQ with vLLM is common; for laptops, desktops and edge devices, GGUF is usually simplest.
What is the best quantization method for LLMs?
There is no single best method; it depends on hardware and use. For GPU serving, AWQ and GPTQ at 4 bits, or FP8 on GPUs that support it, are strong. For local use, GGUF K-quants and I-quants work well. For fine-tuning on limited memory, QLoRA's 4-bit NF4 is standard.
Also asked as: best quantization method llm
Evaluate on your tasks: measure quality on a test set, latency, throughput and memory. Quality loss grows below 4 bits, and multilingual or reasoning tasks can degrade more than benchmarks suggest. In FineTune Studio, the base model loads in 4-bit NF4 for training, while deployment formats are chosen separately for the serving environment.
Can I fully load a GGUF model on the GPU?
Yes. In llama.cpp, offload all layers with the GPU layers option, such as -ngl 99; in Ollama, models load as many layers as fit on the GPU automatically, with settings to adjust. The model must fit in VRAM along with the context cache.
Also asked as: is there any method to fully load the gguf models on gpu
If it does not fit, layers stay on the CPU and generation slows. Options: choose a smaller quant, reduce context length, quantize the KV cache where supported, or use a smaller model. Check memory use with nvidia-smi or Ollama's process status. Full GPU offload gives the biggest speed improvement for local inference, often several times faster than CPU.
Does Ollama use GGUF?
Yes. Ollama runs models in GGUF format under the hood, built on llama.cpp technology. Models you pull from the Ollama library are GGUF files packaged with templates and parameters, and you can import your own GGUF files.
You can also run GGUF models directly from Hugging Face with Ollama by referencing the repository, for supported models. Ollama adds model management, an API, automatic GPU offloading and a simple interface on top of the format. Because it uses GGUF, the same quantization choices apply: tags such as q4_K_M or q8_0 indicate which quant you are pulling.
How do I import a GGUF file into Ollama?
Create a text file named Modelfile with a FROM line pointing to your GGUF file, add the chat template and parameters if needed, then run ollama create to register the model and ollama run to use it.
Also asked as: how to import gguf to ollama
# Modelfile contents: FROM ./my-model-Q4_K_M.gguf
ollama create my-model -f Modelfile
ollama run my-model
If the model's chat template is not detected, copy it from the original model card into the Modelfile's TEMPLATE section, since a wrong template causes poor answers. This is how fine-tuned models, such as QLoRA results exported to GGUF, become local Ollama models.
How can I run local GGUF models without the command line?
Use a graphical app: Ollama's desktop app lets you chat with installed models, LM Studio lets you search, download and run GGUF models from Hugging Face entirely through its interface, and web interfaces such as Open WebUI connect to Ollama in a browser.
Also asked as: how to run local gguf models with ollama — no command line required
LM Studio is especially beginner-friendly: it shows which quantizations fit your hardware, downloads them, and provides a chat window and a local API server. Importing custom GGUF files into Ollama still typically uses a Modelfile, though GUI front ends can help. For students without coding experience, these apps make local, private AI accessible on ordinary laptops.




