Fine-Tune a Small Language Model as a Job (LoRA, CPU)

Expert · 45 minutes · 5 tasks, checked automatically · 100 points

In this expert-level MLOps lab you will simulate a full LoRA fine-tuning pipeline entirely on CPU inside a Kubernetes cluster. You will create a dedicated namespace and ConfigMap that carries a self-contained Python fine-tuning script using the Hugging Face PEFT/LoRA API against a tiny GPT-2 model. You will then package that script into a Kubernetes Job with appropriate resource limits, monitor its progress via logs, and finally verify the adapter weights were written to a hostPath PersistentVolume. This lab mirrors production MLOps patterns: immutable job specs, config-as-code, volume-backed artifact storage, and declarative resource governance — all without any cloud infrastructure.

What you’ll learn

How this lab works

  1. Start the lab: One click starts a real Kubernetes cluster on your computer (kind), with kubectl ready in a toolbox terminal.
  2. Work through 5 tasks: Each task says what to build or fix. You do it yourself, in a real terminal, with hints when you get stuck.
  3. Check your work: Check my work reads your live cluster and says, task by task, what passed and what to fix.
  4. Finish and keep going: 100 points, your progress saved, and the next lab to try.

What it runs on

What you need

Topics: mlops, lora, fine-tuning, kubernetes-jobs, peft, huggingface, transformers, cpu-training, persistentvolume, configmap

Create a free account to start this lab.

Keep going