Skip to content
Courses/Claude Code + Local AI/GGUF Quantization: Q4, Q5, and Q8

GGUF Quantization: Q4, Q5, and Q8

Quantization is what lets you run large models on ordinary hardware. The key isn't picking "the biggest model," but finding the best balance of quality, memory, and speed for your task.

  • Understand what Q4, Q5, Q8, and the _K_M suffixes mean.
  • Choose a quant level based on VRAM, RAM, and use case: chat, RAG, or coding.
  • Import a GGUF into Ollama with a Modelfile.

Practical rule

  • Q4_K_M: first choice if you're tight on VRAM or want speed.
  • Q5_K_M: sweet spot when you can spend a bit more memory for better quality.
  • Q8_0: close to high quality, but much heavier; use it if the model fits comfortably.

Mental selection chart

Terminal
8 GB VRAM:
  7B/8B in Q4_K_M
  14B only if you're okay running tight or reducing context

12 GB VRAM:
  7B/8B in Q5_K_M or Q8_0
  14B in Q4_K_M

16 GB VRAM:
  14B in Q5_K_M
  30B small in Q4 if context isn't huge

24 GB+ VRAM:
  14B in Q8_0
  30B/32B in Q4_K_M or Q5_K_M

Import a GGUF into Ollama

Ollama lets you import GGUF models with a Modelfile. Create a folder, save the GGUF, and write:

Terminal
FROM ./mi-modelo.Q5_K_M.gguf

PARAMETER temperature 0.2
PARAMETER num_ctx 8192

SYSTEM """
You are a precise technical assistant. If you don't know something, say so.
"""

Then create the model:

Terminal
ollama create mi-modelo-q5 -f Modelfile
ollama run mi-modelo-q5

Quantize yourself with llama.cpp

When starting from a model already converted to high-precision GGUF, llama.cpp lets you create a quantized version.

Terminal
# Generic example; the binary may be called llama-quantize or quantize depending on your build
./llama-quantize modelo-f16.gguf modelo-Q4_K_M.gguf Q4_K_M
./llama-quantize modelo-f16.gguf modelo-Q5_K_M.gguf Q5_K_M
./llama-quantize modelo-f16.gguf modelo-Q8_0.gguf Q8_0
Complete Aulafy mapSee how this lesson fits without leaving your path.

Complete Aulafy map

How all courses connect

This is not a checklist. Start with the foundation, choose an outcome, and go deeper only when your project needs more control.

  1. 1Understand
  2. 2Apply or build
  3. 3Operate with confidence
01

Choose an application

Turn the foundation into a visible outcome: a website, a business improvement, media, or an interactive experience.

Continue into the technical branch when you need to maintain code, data, or infrastructure.

02

Build with code

Prepare your environment, work with coding agents, and run models while keeping control of your projects.

This branch prepares you to design and operate reliable AI systems.

03

Take systems to production

Combine retrieval, agents, evaluation, security, deployment, and model adaptation when the problem requires it.

You do not need every course: choose the component your system needs and return as it grows.

View full catalogue