Lab: Message models evaluated, gated and costed
Module 12 · Lab · About 60 minutes · Needs: lessons 1 to 3 of this module, and the Module 11 lab (or nothing: Step 1 rebuilds Modules 1 to 11). Runs on a CPU; downloads SmolLM2-135M-Instruct (257 MiB)
What you are building
Hannah's team routes about 4,000 customer messages a day by hand (illustrative, Lesson 2). Three kinds of model could do it: Module 4's small transformer, Lesson 1's LoRA adapter on SmolLM2, or a hosted model behind an API. This lab puts all three through one harness: evals/messages_eval.py runs any of them on the same 246 cases, evals/regression.py decides promote, block or refuse, and kestrel/llm.py holds the course's setup cell and ask() guard so a hosted model is one setting away. ADR-009 then records whether Kestrel self-hosts or calls an API.
The owner's rule for this course: no hosted calls. The hosted path runs here with scripted fakes through ask(), objects with a model's invoke method and fixed, labelled behaviour. Their scores test the harness; they are not results from any model.
Open a new Colab notebook, call it module-12-lab.ipynb, and run each cell in order.