Lab: The scoring service, batch and online
Module 9 · Lab · About 60 minutes · Needs: lessons 1 and 2 of this module, and the Module 8 lab (or nothing: Step 1 rebuilds Modules 1 to 8)
What you are building
Kestrel scores each parcel twice: online, one at a time, when a depot scanner collects it, and in a batch at 06:00 on its promised day, so the warnings go out before the vans leave. The lessons built every piece of that service around stand-in models trained in the notebook. This lab assembles the service Kestrel would deploy, around the real thing: model v2 from artifacts/model.onnx (Module 8 lab), with Module 3's logistic regression as the fallback.
The lab adds service/main.py (the adapter that feeds raw scanner rows to Kestrel's models, the app and the factory a server starts), tests/test_service.py, docs/slo.md, docs/adr/ADR-006-serving-shape.md, and the files that run it outside Colab: service/Dockerfile and docker-compose.yml with the API, Redis and MLflow, written and given as local steps, not run here. No cell calls a hosted model.
Open a new Colab notebook, call it module-09-lab.ipynb, and run each cell in order.