Part 2: The Pipeline, Proven — Gemma 3 1B
Chapters 04–06: Build a repeatable data → train → fuse → serve pipeline on a 1B model, and prove it works with a toy task where failure is unambiguous.
TUTOR WITH THEFOCUS.AI
Copy this prompt into Claude, ChatGPT, or any external AI assistant. It points the assistant to the course instructions and links it to your student profile to track your progress and customize observations.
You are not enrolled yet. Enroll to generate a Student ID to track lesson completions and store learning notes.
Part 2: The Pipeline, Proven
Gemma 3 1B · “always answer in JSON” · ~1 day
Part 5’s flywheel spins this pipeline hundreds of times. Every defect you leave in it now gets multiplied. So we build it on a model small enough that the whole loop runs in minutes, and prove it with a behavior so trivial that success and failure are unambiguous.
Tutoring: concept → check → install/smoke-test mlx-lm → generate data from a script → train only after checks in Chapter 05.
| Chapter | What You’ll Do |
|---|---|
| 04 · The Toy Task | Set up mlx-lm and generate a chat-format JSONL dataset for a trivially checkable behavior |
| 05 · Train and Check | Run mlx_lm.lora, overfit-check, then fail-and-fix loss masking with a canary before adapter vs. merged |
| 06 · Serve and Automate | Serve via the OpenAI-compatible API and wrap the whole loop in a Makefile |
What You’ll Have After Part 2
mlx-lmtraining working on your machine- A fine-tuned Gemma 3 1B that always answers in JSON
- The overfit sanity check as a permanent habit
- A hard-won understanding of loss masking — induce the bug with a canary, fix with
--mask-prompt, never trust “one generate” alone - A
Makefilewheremake data && make train && make serveruns from clean in under fifteen minutes