GGUF is a file format used to run quantized models on consumer hardware. In a local fine-tuning workflow, it packages the trained weights and tokenizer so Ollama can load the result. GGUF is not the training tool: a tool such as Unsloth trains and exports the model; Ollama serves it locally. section 16.6.2 section 16.6.4 section 17.7.1
Quantization compresses a model so it needs less memory. For scale, a 7B model’s weights may take about 28 GB at 32-bit precision, versus roughly 4–5 GB in a 4-bit quantized file. Running it also needs memory for context and runtime overhead. More compression can reduce answer quality, particularly on subtle reasoning or specialized tasks. section 16.6.2
A practical route from your examples to a local model is:
- Prepare input/output examples, choose a base model, and fine-tune it with a framework such as Unsloth. section 16.6.3
- Export the trained result as a quantized GGUF file. Check that your model architecture, training method, and GGUF export are supported. section 16.6.4
- Point a Modelfile at the exported file, create the model with `ollama create`, then run and test it with Ollama. section 16.6.3 section 17.7.1
Choosing a quantization level
Tags such as `q4_K_M` and `q5_0` identify quantization levels. A lower number generally means a smaller memory requirement but lower quality. For quick tests, `q2_K` is very small; `q4_0` balances size and quality; `q5_0` needs more RAM for higher quality. Use `ollama show gemma3:4b` to inspect a model’s quantization. section 16.6.2
model.save_pretrained_gguf("my_model", tokenizer, quantization_method="q4_k_m")
This Unsloth export call saves a GGUF model using the `q4_k_m` quantization setting. section 16.6.4
cat << 'EOF' > Modelfile FROM ./my_finetuned_model.gguf SYSTEM "You are a specialized assistant trained on my domain data." PARAMETER temperature 0.7 PARAMETER num_ctx 4096 EOF
This Modelfile points `FROM` at a local GGUF file and sets the system prompt and parameters Ollama will use. section 17.7.1


