Skip to content

InsightsAI Infrastructure

Cutting cold-start time for LLM inference pods

Where the minutes go when a new model server starts on Kubernetes, and how OCI image volumes, node-local model caches, streamed weight loading and a persistent compile cache bring them down.

Published October 17, 20268 min read

A web service scales out in seconds. A model server often takes several minutes: the node has to appear, a multi-gigabyte image has to be pulled, tens of gigabytes of weights have to be downloaded and copied into GPU memory, and the inference engine compiles and captures graphs before it accepts its first request. During those minutes the existing replicas take the whole spike, and the autoscaler keeps adding pods that are not ready yet.

Start-up time decides how aggressively you can scale down. If a new replica is ready in thirty seconds, scaling a GPU pool to zero at night is reasonable. If it takes eight minutes, you keep idle GPUs warm. This article takes the start-up path apart and shows what to change at each step, using vLLM as the example engine.

Where the time goes

A cold start is a chain of steps, and only some of them are worth attacking:

node readyimage pullweights to diskweights to GPUcompile and graphsready
fig. 1 — the start-up path of a new inference replica
StepWhat happensMain lever
Node readyThe autoscaler provisions a GPU node, drivers and device plugin startNode image with drivers baked in, a small warm buffer
Image pullThe container runtime downloads the inference engine imageSlim image, pre-pulled on the node image
Weights to diskWeights are downloaded from a model hub or object storageCache on the node, or ship them as an OCI artifact
Weights to GPUFiles are read and copied into GPU memoryStreamed, concurrent loading
Compile and graphsThe engine compiles kernels and captures CUDA graphsPersistent compile cache

Measure before changing anything. Pod events show when scheduling, pulling and container start happened, and vLLM logs how long loading the weights and capturing graphs took. The split differs a lot between a 7B model on a fast local disk and a 70B model fetched over the internet, and the fix differs with it.

Keep weights out of the engine image

Baking weights into the engine image looks convenient: one artifact, one pull. In practice it couples two things that change at different speeds. Every model update rebuilds and re-pushes a huge image, every engine upgrade does the same, and the registry stores a full copy for every combination.

Keep the engine image limited to the runtime, based on a slim CUDA runtime image rather than the development one, and treat the weights as a separate, versioned artifact. The rest of this article assumes that split. For how much GPU memory those weights and the KV cache need in the first place, see Sizing GPUs for LLM inference.

Option 1: weights as an OCI image volume

Kubernetes can mount an OCI image or artifact as a read-only volume. The image volume source was added as alpha in v1.31, became beta and enabled by default in v1.35, and is stable since v1.36. The container runtime on the node must support it, so check your containerd or CRI-O version before relying on it.

This lets you publish weights to the same registry as your images and mount them next to the engine:

weights/Dockerfile
FROM scratch
COPY model/ /
inference deployment (pod spec)
containers:
  - name: vllm
    image: registry.example.com/vllm-runtime:0.11
    args: ["/models/llama", "--served-model-name", "llama"]
    volumeMounts:
      - name: weights
        mountPath: /models/llama
        readOnly: true
    env:
      - name: HF_HUB_OFFLINE
        value: "1"
volumes:
  - name: weights
    image:
      reference: registry.example.com/models/llama@sha256:<digest>
      pullPolicy: IfNotPresent

What you get:

  • A node-level cache for free. Once the artifact is on a node, the next pod on that node mounts it without downloading anything. The runtime's image store is the cache.
  • Versioning by digest. The weights a pod runs are as traceable as its code. The volume is resolved at pod start, and again when the pod is recreated, so a tag can change underneath you; pin the digest.
  • One distribution path. Registry mirrors, pull-through caches and image pre-pulling on the node image all apply to weights too.

What to watch:

  • Pull failures block the pod. If the artifact cannot be pulled, the containers do not start and the kubelet retries with volume backoff. A large artifact on a slow registry is still slow; it is just slow once per node instead of once per pod.
  • Disk on the image filesystem. Weights now live where images live, so kubelet image garbage collection applies to them, and the node's image filesystem must be sized for the models you serve.
  • Registry limits. Very large layers stress registries and proxies. Splitting the weights across several layers, for example one per safetensors shard, keeps each one manageable. Check your registry's limits before publishing a 100 GB artifact.

Option 2: a node-local model cache

If your weights live in object storage or a model hub and you do not want to repackage them, cache them on the node's local NVMe disks instead. The pattern is the same whatever tool implements it: a component downloads the model to a local path on each GPU node in a node group ahead of time, and inference pods mount that path.

KServe ships this as LocalModelCache. It is disabled by default, its resources are v1alpha1, and it needs a LocalModelNodeGroup that defines which nodes cache models and the local persistent volume they use:

localmodelcache.yaml
apiVersion: serving.kserve.io/v1alpha1
kind: LocalModelCache
metadata:
  name: llama-3-8b-instruct
spec:
  sourceModelUri: hf://meta-llama/meta-llama-3-8b-instruct
  modelSize: 10Gi
  nodeGroups:
    - workers

An InferenceService uses the cache when its storageUri matches the cache's sourceModelUri, so keep both in one place in your configuration rather than typing them twice. Check the cache status, which reports copies and per-node download state, before trusting that a model is on every node.

Without KServe, a DaemonSet that syncs models from object storage into a hostPath directory does the same job. Make it idempotent, write to a temporary directory and rename when the download is complete, so a pod never mounts half a model.

Option 3: stream weights straight into the GPU

Caching avoids the download. Streaming makes the remaining read faster. vLLM supports the Run:ai Model Streamer for safetensors weights, which reads tensors with many concurrent threads into a CPU buffer and hands them to the GPU from there. It works from local disk and directly from S3, Google Cloud Storage and Azure Blob Storage:

vllm serve with the streamer
vllm serve s3://models/llama-3-8b-instruct \
  --load-format runai_streamer \
  --model-loader-extra-config '{"concurrency": 16, "memory_limit": 5368709120}'

concurrency sets the number of reader threads, and memory_limit caps the CPU buffer in bytes, which matters if the pod's memory limit is tight. Tune concurrency against the storage you actually have: a local NVMe disk and an S3 bucket in the same region saturate at very different values. For S3-compatible stores, set AWS_ENDPOINT_URL and follow the streamer's settings for path-style addressing.

Streaming from object storage removes the "weights to disk" step altogether, at the cost of reading the full model over the network on every start. It suits pools that scale up rarely but need to be fast when they do. Combined with a node-local copy, it speeds up the read from local disk as well.

Keep the compile cache

Once the weights are loaded, vLLM compiles the model with torch.compile and captures CUDA graphs before it serves anything. The compile artifacts are cached under VLLM_CACHE_ROOT, which defaults to ~/.cache/vllm; on a later start with a matching cache, vLLM skips compilation and loads the artifacts from disk.

In a container, that directory disappears with the pod, so every replica compiles from scratch. Point VLLM_CACHE_ROOT at a persistent location shared by replicas of the same model, or ship a warmed cache next to the weights. The cache key includes vLLM's configuration, the PyTorch configuration and the model code, so a change to engine version, flags or model produces a new entry rather than a wrong one. Expect a slow first start after each upgrade.

--enforce-eager skips CUDA graphs and compilation and starts faster, but usually serves fewer tokens per second. Use it for development pods and rarely used models, not as the fix for a slow production start.

Make start-up visible to Kubernetes

A model server that takes minutes to start needs probes that know it. Use a startupProbe on vLLM's /health endpoint with a generous budget, so the liveness probe does not restart the container halfway through loading:

probes
startupProbe:
  httpGet:
    path: /health
    port: 8000
  periodSeconds: 10
  failureThreshold: 60
readinessProbe:
  httpGet:
    path: /health
    port: 8000
  periodSeconds: 5

Ten minutes of budget covers a cold node; once the optimizations above work, lower it so that a stuck start fails visibly. Liveness, readiness and startup probes done right covers the timing choices in more detail.

Also set HF_HUB_OFFLINE=1 when weights come from a mount. Otherwise an engine may still contact the Hugging Face Hub on start, which adds latency and fails in clusters without internet egress.

Choosing

ApproachRemovesCostsFits
OCI image volumeRepeated downloads per node, ad hoc versioningRepackaging weights, image filesystem spaceTeams already running a registry and pinning by digest
Node-local cacheDownloads at pod startLocal disk per node, a sync component to runFixed GPU node groups serving a known set of models
Streamed loadingMost of the disk and read timeNetwork read on every start, CPU memory bufferPools that scale from zero, models in object storage
Persistent compile cacheCompilation on every startA shared volume, cache churn on upgradesEvery vLLM deployment

They combine: an image volume or a local cache for the weights, streamed reads from that local copy, and a persistent compile cache.

A rollout order that works

  1. Measure a cold start and a warm start per step, from pod events and engine logs.
  2. Split weights out of the engine image and set HF_HUB_OFFLINE.
  3. Move the compile cache to persistent storage; it is the smallest change.
  4. Cache weights on nodes, with image volumes on v1.36 clusters or a local cache elsewhere.
  5. Try the streamer and tune concurrency against your storage.
  6. Tighten the startup probe and lower the warm buffer, then decide how far the pool can scale down.