Lesson 8.13core8 h

Project: fine-tune a small LLM with LoRA and ship a chat app

From dataset to QLoRA training to evaluation to a deployed chat interface

This capstone turns the phase into skills you can show: you will choose a model and license, build and clean an SFT dataset, run a QLoRA fine-tune on a free GPU, evaluate it honestly against a well-prompted baseline with a judge, quantize and serve it, and put a chat UI in front of it. Every step is a lesson from this phase applied for real — 8.2 Fine-tuning and PEFT for training, 8.5 Decoding and sampling for decoding, 8.7 Evaluating LLMs for evaluation — and the result is a portfolio piece for 11.3 Portfolio project ladder.

You'll be able to

  • Select a base model, size and license appropriate to a task and a free GPU budget
  • Build, clean and format an SFT dataset with the correct chat template and splits
  • Run and monitor a QLoRA fine-tune and merge the adapter
  • Evaluate the fine-tuned model against a prompted baseline with deterministic checks and a position-debiased judge
  • Quantize, serve and deploy the model behind a streaming chat interface with a write-up

Key ideas

  1. Choose a narrow task where fine-tuning beats prompting (format, persona, skill), not fact injection.
  2. Dataset quality decides the outcome: 500–3,000 cleaned examples, correct chat template, loss masking, leak-free splits, golden test set written first.
  3. QLoRA with r = 16, α = 32, LR 2e-4, 1–3 epochs on all projections is a sound starting point on a free 16 GB GPU.
Show 4 more key ideas
  1. Evaluate against a well-prompted baseline with deterministic checks plus a position-debiased judge, and run a regression check for forgetting.
  2. Merge, quantize (GGUF/Ollama or vLLM), verify evals survive quantization, and publish a model card.
  3. Ship a streaming chat UI with disclaimers, feedback logging and basic guardrails; deploy to Spaces or a VM.
  4. The write-up with intervals, failures and costs is what makes the project portfolio-grade.

Suggested path through this lesson