Phase 17: Infrastructure & Production

Cold Start Mitigation for Serverless LLMs

A 20 GB model image takes 5-10 minutes (7B) to 20+ minutes (70B) to go from cold to serving. In a true serverless world, that is not a warm-up — it is an outage. Mitigations operate at five layers: pre-seeded node images (Bottlerocket on AWS, dual-volume arch), model streaming (NVIDIA Run:ai Model Streamer, native in vLLM), GPU memory snapshots (Modal checkpoints, up to 10x faster restart), warm pools (minworkers=1), tiered loading (ServerlessLLM's NVMe→DRAM→HBM pipeline, 10-200x latency reduction), and live migration that moves input tokens (KB) rather than KV cache (GB). Modal publishes 2-4s cold starts as a floor; Baseten 5-10s default, sub-second with pre-warming. This lesson teaches you to measure, budget, and stack the five layers. Enumerate the five layers of cold-start mitigation and name one tool or pattern at each layer. Compute total cold-start time as a sum of (node provision) + (weights download) + (weights load into HBM) + (engine init) for a 70B model. Explain why live migration transfers input tokens (KB) not KV cache (GB) and what the penalty is (recomputation). Name the warm-pool trade-off (pay for idle GPU or accept cold-start tail) and the SLA threshold at which minworkers > 0 becomes mandatory. Your serverless LLM endpoint scales to zero overnight. At 8 a.m. traffic spikes. The first request waits while: Karpenter provisions a GPU…

Cold Start Mitigation for Serverless LLMs: A 20 GB model image takes 5-10 minutes (7B) to 20+ minutes (70B) to go from cold to serving. In a true serverless…

This free lesson is part of the AI Engineering from Scratch curriculum. Read the full explanation, run the lesson code, and verify the result in the interactive reader or from the repository source.

Browse the complete course catalog or open this lesson on GitHub.