Fine-tuning means training a pretrained model further on your own examples. It can help a general-purpose model learn a specialized domain, a new language, or a more consistent way of responding. Think of it as sending the model back to school—not merely giving it instructions for one conversation. section 16.6 section 16.6.1
Table 16.2 Choosing among system prompts, RAG, and fine-tuning
| Approach |
When to use |
Examples |
|---|---|---|
| System prompts |
Changing the AI’s personality or format |
“Be a detective” / “Answer in JSON” |
| RAG |
Adding specific knowledge |
Company docs, research papers |
| Fine-tuning |
Changing the model’s fundamental behavior |
Teaching new languages, specialized domains, consistent style |
Check the simpler options first: use a system prompt to change personality or output format, and RAG to provide documents. Consider fine-tuning when the model’s underlying behavior needs to change. section 16.6.1
Teach a response pattern
A training example can pair “Summarize this customer support ticket in one sentence” with a one-sentence answer. Another can pair a request to explain “vector database” for a beginner with a plain-language answer. The pairs demonstrate both the requests to handle and the answers to produce. section 16.6.3
A practical route from examples to a locally running model is:
- Prepare training examples, often as input/output pairs, and select a base model. Smaller models are generally easier and faster to fine-tune. section 16.6.3
- Train with a framework such as Unsloth, often in a Python notebook with GPU access. Confirm that your model architecture, training method, and export path are supported. section 16.6.4
- Export the trained result as a GGUF file. Put that file and a Modelfile together, make the Modelfile’s FROM path point to the actual GGUF, and preserve the chat template used during training. section 16.6.4
- In that folder, run `ollama create my-custom-model -f Modelfile`, then `ollama run my-custom-model`. Test its responses and refine the examples or training as needed. section 16.6.4 section 16.6.3
Unsloth handles training and GGUF export; Ollama runs the resulting model locally. Unsloth can reduce training time and GPU memory use, but results depend on the model, hardware, and settings. Hosted GPU access and completion time are not guaranteed. section 16.6.4




































