▶ Sign up free for the video, slides & prompts
The lesson below is open to all. Enter your email once to unlock every video, slide deck, prompt and code example on this device.
Checking…
MLOps: Shipping ML Models · Lesson 10 of 14 · 2 min read · 5 min video
Deploying to the cloud
Containers on managed services, scaling, and keeping costs low.
📄 Download slides (PDF)· free sign-upYour model API runs in a container on your laptop. Now it needs to run somewhere that stays up, scales with traffic and doesn't cost a fortune. Here are the main options, from simplest to most complex.
Option 1: Serverless containers
Services like Google Cloud Run, AWS App Runner and Azure Container Apps take your Docker image and run it for you:
- Scale to zero when there's no traffic, so you pay nothing
- Scale up automatically under load
- HTTPS, logs and rollbacks included
Pick a region close to your users, like asia-south1 (Mumbai), for lower latency.
Option 2: Managed ML platforms
Vertex AI, SageMaker and Azure ML handle training jobs, the model registry, endpoints and monitoring in one place. They're powerful, but more expensive and more tied to one provider.
Option 3: Kubernetes
Full control over scaling, GPUs and networking, but a lot to run. Choose it when you already have a platform team or many services.
Keeping costs down
- Start on serverless with scale to zero and a maximum number of instances
- Use the smallest machine that meets your latency target, and measure it
- Use CPUs for classic ML models. Most don't need a GPU
- Run batch jobs on spot or preemptible machines, which cost much less
- Set a billing alert in the cloud console on day one
Secrets and config
Never put API keys or database passwords in the image. Use the platform's secret manager and environment variables.
In one line
Deploy model containers to serverless services first for easy scaling and low cost, move to managed ML platforms or Kubernetes only when you need them, and set budgets from day one.
Share with a friend