internalsGet Pro

Module 14 · Lesson 3 of 15Pro

Serving a model behind an API

Level
Intermediate
Topic
Deploying ML models
Reading time
18 min

When you finish this page you can

  1. Build a model server that loads its model once at start-up, checks every request against a schema and returns a score with the model version.
  2. Explain why a CPU-heavy predict call belongs in a plain def handler, and why parallel work needs processes rather than threads in Python.
  3. Size the processes, threads and containers for a peak load without starting more threads than the machine has cores.
  4. Plan what the caller does when the model is slow or down: a timeout, a fast refusal and a fallback.

Builds on 2 lessons

Start with lesson 114 min
  1. Serving patterns: batch, online and streaming14 min
  2. Packaging models: formats and containers17 min

Video lesson · coming soon

A 3 ms prediction that took 70 ms

is the online store this course uses as its example. It now takes 500,000 orders a day. Before each order goes through, the checkout service asks a fraud model one question: how likely is this order to be fraud? The answer must come back in under 50 ms.

Our biggest sale ever · Black Friday

Flat 50% Off

Pro

Continue reading

Unlock every course, now and later

  • System Design, live
  • AI Engineering, live
  • Data Engineering, live
  • Machine Learning Engineering, live
  • Inference Engineering, coming soon
  • AI Research, coming soon
  • Performance Engineering, coming soon
  • Agent & Harness Engineering, coming soon
  • LLM Fine-tuning, coming soon
  • LLM Pre-training & Post-training, coming soon
  • Reinforcement Learning, coming soon
  • AI Infrastructure & Platform Engineering, coming soon
  • AI Evaluation & Safety, coming soon
  • Forward Deployed Engineering, coming soon
  • Cloud Computing, coming soon
  • DevOps, coming soon

50% off · Annual and Lifetime

BLACKFRIDAY50Applied at checkout

Choose a plan