GuideAdvanced
Fine-Tuning and Distillation for LLMs
Fine-tuning a model means changing its weights with your own examples so it does a task in a fixed way without needing a long prompt. Sometimes it is the best decision in the project, and sometimes it is a cost nobody will maintain. This guide teaches you to tell which one is yours, with numbers, and to do it well when it pays: decide against prompting and RAG, prepare the data, evaluate before and after, understand LoRA and QLoRA from the inside, train open weights in the cloud or on a Mac, use providers' fine-tuning knowing what you risk, go beyond SFT with preferences and reinforcement, and distill a large model into a small one. You learn it with **Halyard Energy**, a fictional electric utility that classifies 1.5 million customer messages a month into a JSON label with an intent, a priority and three extracted fields. Today a large model does it with a 653-token prompt. You will build everything that decides whether a small fine-tuned model can replace it: a clean, leak-free dataset from a dirty export, a golden set with audited labels, the evaluation with slices, rare classes, intervals and regressions outside the task, the parameter and memory math of a real model from its `config.json`, the training configurations for TRL + PEFT and for mlx-lm with their preflight, the providers' requests validated without sending them, the preference pairs, a grader that cannot be gamed, and the dataset labeled by the teacher model. The lab runs on any laptop, with no GPU, no model downloads and no API keys. LoRA and distillation are trained for real on numpy toys that finish in seconds; the model answers being evaluated are simulated with fixed error profiles and labeled that way in every lesson, and what is real is the code that evaluates them. Every provider fact, price and version is verified in the official documentation as of October 2026, including what changed the most: several providers have closed or are closing their fine-tuning, and the guide tells you which.
- 64
- lessons
- 8
- modules
- English · Spanish
- available in
- Free
- access
Outcomes
What you'll be able to do
- Decide with judgment and numbers whether a case is solved with prompting, RAG or fine-tuning, including caching and cheap models as alternatives
- Turn a dirty export into a training dataset: PII out, duplicates out, label noise flagged, a per-customer split with no leakage, each stack's formats, and validation before you pay
- Build the evaluation before training: golden set, structured-output metrics, slices, rare classes, paired bootstrap comparison and regressions outside the task
- Explain LoRA and QLoRA, train LoRA on a toy, and compute trainable parameters and memory for a real model
- Prepare open-weights SFT in two modes, cloud with TRL + PEFT and Mac with mlx-lm, with the chat template, loss masking and a preflight
- Know what each managed provider offers today, what it costs and what risks it carries, and build their requests without sending them
- Use preferences (DPO) and reinforcement (graders, GRPO, RFT) when SFT is not enough, without falling into reward hacking
- Distill a large model into a small one and decide, with criteria written beforehand, whether it ships
Before you start
What you need to bring
It's for you if...
- Engineers who already use LLMs from code and have a case where prompting hit its ceiling or costs too much
- Tech leads who have to approve or reject a fine-tuning project and want to know what to ask
- Product ML engineers who will maintain a fine-tuned model and need the whole process, not just the training script
Requirements and materials
- Intermediate Python: functions, dictionaries, JSON, `dataclass`, running a module with `python3 -m`
- Knowing what a token, a system prompt and a structured JSON output are
- Python 3.10 or newer with `numpy`; `tiktoken` and `jinja2` are optional. No GPU, no downloaded models, no API keys
- To train for real, outside the lab and optional: an NVIDIA GPU in the cloud or a Mac with Apple Silicon
Content
The syllabus, module by module
Open any of them to see its lessons.
Common questions
What people usually ask
No limit. It's a free guide: come in whenever you like, as often as you like.
No. Modules run from easier to harder, but you can jump to the one you need. Progress is saved per lesson.
Whatever is needed is listed under “What you need to bring”, above. If nothing is listed there, you can start from zero.
In the WhatsApp group, and every two weeks there's a live with an instructor where questions get worked through.
Start whenever you like
What students say
These reviews are from enrolled students who completed at least 50% of the course. We moderate reviews only on content grounds (spam, offensive language, personal data), never for being critical or negative.
No approved reviews yet.
Be the first to share your experience!