internalsGet Pro

Machine Learning Engineering · Module 14

Deploying ML models

Lessons
15
Free
0
Reading
~4 h

Your progress

0 / 15 lessons done

Sign in to track

Lessons

  1. Serving patterns: batch, online and streamingA trained model is only useful once its predictions reach the product, and the way they get there decides how fresh they are, what they cost and what happens when something fails. Picking the pattern before writing any serving code saves teams from paying for an online service that a nightly job would have covered, or from showing stale answers that only an online call could fix.14 min
  2. Packaging models: formats and containersA model that scores well offline is useless until another machine can load it and get the same answers. Most failed model deploys break here: a missing module, a library version that differs, or a file nobody should have trusted.17 min
  3. Serving a model behind an APIMost models that answer a user in real time sit behind a small HTTP service. Whether it answers in 5 ms or 500 ms depends less on the model than on when it loads, where predict runs and how many copies share a machine.18 min
  4. Batch prediction pipelinesMost production models never answer a live request: they score a known list of products or customers on a schedule and leave the results in a table. When that job fails halfway, the damage comes from what other systems read next, not from the model.16 min
  5. Real-time features at prediction timeFraud checks, recommendations and pricing often depend on what happened in the last few minutes, which a nightly job can’t know. Getting those values to the model in milliseconds, and the same way training saw them, is a large part of serving a model in production.18 min
  6. Case: PhonePe’s real-time fraud check on transfersEvery payments product must decide whether to stop a transfer while the user waits or flag it afterwards, and where its fraud labels come from. PhonePe’s engineers wrote down how they made both choices at 100 million transactions a day.15 min
  7. Training–serving skew: when production data differsA model that scored well offline can still make bad decisions on its first day in production, with no error anywhere, because the rows it is served differ from the rows it learned from. Finding and preventing that difference is routine work for anyone who ships models.17 min
  8. Model registry and versioningEvery model in production will one day misbehave at a bad moment. Whether the fix takes two minutes or two hours depends on whether the registry can say, at once, which version is serving, what made it and which version served before it.17 min
  9. CI/CD for machine learningMost teams already have CI for their code and a training pipeline for their models. The outages come from the gap between them: a model that reaches production with code it was never tested with.17 min
  10. Testing ML systems: data, model and code checksA model can improve on its held-out score and still get worse at the cases that matter most. Tests of the code, the data and the model’s behaviour catch what one average number hides, before a customer pays for it.17 min
  11. Rolling out models: shadow, canary and A/BEvery model change that reaches real traffic is a bet that offline checks saw everything. Shadow, canary and A/B stages decide whether a wrong bet costs a few dozen customers or a few thousand.16 min
  12. Models on phones and edge devicesSooner or later a product team asks for a prediction that works offline or appears instantly in the app. Moving a model onto devices you don’t control changes how it is sized, shipped, updated and watched.17 min
  13. The cost of serving ML modelsServing is often the biggest running cost of an ML system, and the bill is set by how much capacity you keep switched on, not by how many predictions you make. Engineers who can read that bill cut it where it is large, instead of shrinking a model that was never the expensive part.16 min
  14. Case: Pinterest’s user embeddings served on GPUsAny team that adds a sequence model to ranking meets the same two questions: what can be computed ahead of time, and where the rest should run. Pinterest published how it answered both for its Homefeed and ads.18 min
  15. Design: fraud scoring like Stripe RadarA fraud check sits inside the payment, so every part of serving matters at once: the time limit, fresh features, a written fallback, logged decisions and safe releases. Getting one wrong costs either stolen money or honest customers turned away, often during the busiest hour of the year.28 min

Practise with

No tools or paper guides for this module yet.

Terms this module teaches 2

Open glossary

Dispatch hold

A pause that keeps a paid order from leaving the warehouse until a late check, such as a rescore or a review, has finished.