TheFocus.AI TheFocus.AI
Part 2: The Pipeline, Proven — Gemma 3 1B

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

Agent Integration

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.

Please tutor me in this lesson using the following context. First, read the instructions at: https://courses.thefocus.ai/llms.txt My Student ID is: <none> The lesson markdown source is at: https://courses.thefocus.ai/fine-tune-local-agent/02-the-pipeline/04-the-toy-task.md

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.

ChapterWhat You’ll Do
04 · The Toy TaskSet up mlx-lm and generate a chat-format JSONL dataset for a trivially checkable behavior
05 · Train and CheckRun mlx_lm.lora and pass the three checks — overfit sanity, loss masking, adapter vs. merged
06 · Serve and AutomateServe via the OpenAI-compatible API and wrap the whole loop in a Makefile

What You’ll Have After Part 2

  • mlx-lm training 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 — the single highest-leverage concept in the course
  • A Makefile where make data && make train && make serve runs from clean in under fifteen minutes

Chapter 04 →