Inferensys

Glossary

Cold Start

Cold start is the latency incurred when a service, such as a serverless function or model inference endpoint, must be initialized from a dormant state to handle a request.
Developer testing AI inference on mobile phone in hand, laptop with optimization code visible, casual tech review moment.
LLM DEPLOYMENT AND SERVING

What is Cold Start?

Cold start is a critical performance metric in machine learning serving infrastructure, directly impacting user experience and operational costs.

Cold start is the initial latency incurred when a computational resource, such as a serverless function or a model inference endpoint, must be provisioned and initialized from a dormant state to handle its first request. This process includes loading the model's weights into memory, allocating hardware (like a GPU), and executing any required setup code before the first prediction can be served. In LLM deployment, this latency is particularly significant due to the massive size of model parameters that must be transferred from persistent storage.

The delay is a fundamental trade-off in serverless and autoscaling architectures, where resources are scaled to zero to save costs when idle. Mitigation strategies include provisioned concurrency (keeping warm instances ready), using smaller, optimized models, and advanced KV cache preloading. For CTOs and platform engineers, managing cold start latency is essential for meeting Service Level Objectives (SLOs) for response time in user-facing applications.

SYSTEMIC LATENCY SOURCES

Key Causes of Cold Start in LLM Serving

Cold start latency in LLM serving is not a single event but the cumulative delay from several sequential and parallel initialization steps required to load a dormant model into a ready state. Understanding these root causes is critical for architectural optimization.

01

Model Weights Loading

The most significant contributor to cold start is loading the model weights from persistent storage (e.g., network-attached storage, object store) into GPU memory. For a multi-billion parameter model, this involves transferring tens to hundreds of gigabytes. The delay is a function of network bandwidth and storage I/O speed. For example, loading a 70B parameter model in FP16 (~140GB) over a 10 Gbps network incurs a minimum of ~112 seconds of pure data transfer time, not accounting for deserialization overhead.

02

Container Initialization & Dependency Pull

In serverless or containerized environments (e.g., AWS Lambda, Kubernetes), a cold start requires spinning up a new runtime environment. This involves:

  • Pulling the container image from a registry, which can be several gigabytes in size for a full ML stack.
  • Installing system and Python dependencies.
  • Loading the inference framework (e.g., PyTorch, TensorRT-LLM). These steps add substantial overhead before the model loading even begins, especially if images are not pre-cached on the host.
03

Model Compilation & Graph Optimization

For peak performance, frameworks often compile the model's computational graph for the specific hardware. This just-in-time (JIT) compilation is a major cold start factor for optimized runtimes like:

  • TensorRT-LLM: Builds and optimizes an engine for the target GPU.
  • ONNX Runtime: Performs graph optimizations and kernel selection.
  • XLA (used with JAX/PyTorch): Compiles the model for efficient execution. This compilation can take from seconds to minutes, depending on model size and optimization level, but is cached for subsequent warm requests.
04

Distributed Model Parallelism Setup

Large models that exceed the memory of a single GPU must be split using model parallelism techniques like tensor parallelism or pipeline parallelism. Cold start for these models includes:

  • Partitioning and loading weights across multiple GPUs/nodes.
  • Establishing high-speed communication channels (e.g., NCCL) between devices.
  • Synchronizing all processes before serving can begin. The coordination overhead scales with the number of devices and the complexity of the parallelization strategy, adding significant latency.
05

Warm-Up Data Processing & Cache Population

Before the endpoint is ready for production traffic, internal caches and data structures must be initialized. This includes:

  • Populating the KV Cache data structures in memory, setting up the paging mechanism (e.g., vLLM's PagedAttention).
  • Running warm-up inference passes with dummy data to trigger CUDA kernel compilation and memory allocation, ensuring the first real request doesn't pay this cost.
  • Loading tokenizers, vocabulary files, and any auxiliary models (e.g., for embedding generation in RAG setups).
06

Orchestrator & Scaling Controller Lag

In managed serving platforms (e.g., Kubernetes with Kserve, SageMaker), the cold start latency also includes the control plane overhead:

  • Orchestrator decision time: The time for the Horizontal Pod Autoscaler (HPA) or cluster autoscaler to detect need and schedule a new pod.
  • Node provisioning: If no worker nodes with sufficient resources are available, the cloud provider must provision a new virtual machine, which can take minutes.
  • Health check passing: The new pod must start, pass readiness probes, and be added to the service mesh's load balancing pool before receiving traffic.
LLM DEPLOYMENT AND SERVING

How to Mitigate Cold Start Latency

Cold start latency is the delay incurred when an idle service, such as a serverless inference endpoint, must initialize—loading a model into memory—before processing its first request. This latency directly impacts user-perceived performance and operational costs.

Mitigation strategies focus on keeping model instances warm. Provisioned concurrency pre-initializes a set of serverless function instances, while predictive scaling uses traffic patterns to launch instances ahead of demand. For containerized deployments, setting appropriate minimum replica counts in orchestration platforms like Kubernetes prevents full shutdowns. These techniques trade idle compute cost for guaranteed low-latency availability.

Architectural choices also reduce impact. Using smaller, quantized models decreases load time. Implementing a request queue with a keep-alive connection can mask latency for the first user. For multi-tenant systems, model caching in a shared memory pool prevents redundant loads. Ultimately, mitigation balances cost, complexity, and the specific service level objective (SLO) for tail latency.

LLM INFERENCE LATENCY

Cold Start vs. Warm Start: A Comparison

A comparison of the initialization states for a model inference endpoint, focusing on the operational characteristics that impact latency, cost, and user experience.

CharacteristicCold StartWarm Start

Initialization State

Dormant / Not Loaded

Active / Loaded in Memory

Primary Latency Source

Model Loading & Initialization

Inference Computation Only

Typical Latency

Seconds to Tens of Seconds

< 1 Second

Resource State

Zero Allocated Compute

Pre-Allocated Compute (e.g., GPU Memory)

Cost Efficiency (Sporadic Traffic)

High (Pay-per-use)

Low (Idle Resource Cost)

Cost Efficiency (Steady Traffic)

Low (Repeated Initialization Cost)

High (Optimized Utilization)

Predictability

Unpredictable for first request

Consistent, Low Latency

Common Mitigation

Provisioned Concurrency, Keep-Alive Pings

Traffic Management, Auto-scaling Policies

Typical Trigger

First request after inactivity period

Subsequent request within activity window

COLD START

Frequently Asked Questions

Cold start latency is a critical performance consideration when deploying large language models and serverless functions. These questions address its causes, measurement, and mitigation strategies for production systems.

A cold start is the initial latency incurred when a computational service, such as a model inference endpoint or serverless function, must be initialized from a completely dormant state to handle its first request. This process involves loading the model binaries, weights, and dependencies into memory, allocating hardware resources (like GPU memory), and establishing the runtime environment before any inference can occur. For large language models (LLMs), this is particularly impactful due to the time required to load multi-gigabyte parameter files into VRAM. The opposite condition, a warm start, occurs when a request hits an already-initialized and active service instance, resulting in minimal latency.

Key components of a cold start include:

  • Model Loading: Reading the serialized model (e.g., in Safetensors or PyTorch format) from disk or network storage.
  • Memory Allocation: Reserving and populating GPU/CPU memory with model weights and the KV Cache structure.
  • Runtime Initialization: Starting the inference engine (e.g., vLLM, TensorRT-LLM) and any supporting microservices.
  • Connection Establishment: Setting up network listeners and health checks for the inference endpoint.
Prasad Kumkar

About the author

Prasad Kumkar

CEO & MD, Inference Systems

Prasad Kumkar is the CEO & MD of Inference Systems and writes about AI systems architecture, LLM infrastructure, model serving, evaluation, and production deployment. Over 5+ years, he has worked across computer vision models, L5 autonomous vehicle systems, and LLM research, with a focus on taking complex AI ideas into real-world engineering systems.

His work and writing cover AI systems, large language models, AI agents, multimodal systems, autonomous systems, inference optimization, RAG, evaluation, and production AI engineering.