Solving the 15-Minute Cold-Start: Pre-Warmed XLA & Model Graphs on Spot TPUs/GPUs
Author: Justin Mecham — JustOps (justops.io)
Copyright: © 2024–2026 Justin Mecham / JustOps (justops.io). All Rights Reserved.
1. The Idle Cloud AI Billing Problem
Most engineering teams trying to adopt private open-weights LLMs (Qwen3-Coder, Llama-3.3, DeepSeek-R1) fall into one of two expensive traps:
- Always-On Dedicated GPU/TPU Instances ($1,450–$3,800/mo): Leaving an A100, H100, or Cloud TPU node running 24/7 when CI/CD pipelines and developers only run inference for 15–45 minutes per workday wastes over 90% of compute spend.
- Naive Ephemeral Spin-Up (12–18 Minute Cold Starts): Spinning up a Spot TPU or GPU node on-demand saves money, but standard
vLLM/ PyTorch XLA initialization compiles tensor graphs from scratch on every boot—blocking pull request pipelines for 15+ minutes.
2. Pre-Warmed XLA Graph Restoration to /dev/shm
To achieve ~$0.03 per pipeline run with sub-minute readiness, the JustOps architecture decouples graph compilation from ephemeral job execution:
| Cold-Start Bottleneck | Naive Ephemeral Boot | JustOps Pre-Warmed Spot Pipeline |
|---|---|---|
| Compute Provisioning | On-Demand GPU ($3.60+/hr) |
Preemptible / Spot TPU v5e or L4/A100 (60–75% off) |
| XLA / CUDA Graph Init | Recompiled every boot (600–900s) |
Restored from compressed archive into /dev/shm (~4s) |
| Model Weight Load | Pulled over public internet | Streamed from regional VPC bucket / local NVMe cache |
| Post-Run Idle Billing | Manual teardown (prone to leaks) | Dual-layer if: always() + activeDeadlineSeconds ($0.00/hr) |
Key Implementation Mechanics
# Restore pre-compiled XLA cache directly into shared memory RAM disk before launching vLLM
mkdir -p /dev/shm/xla_cache
tar -I zstd -xf /mnt/model-cache/qwen3-32b-tpu-2x2-xla.tar.zst -C /dev/shm/xla_cache
export VLLM_XLA_CACHE_PATH=/dev/shm/xla_cache
exec vllm serve Qwen/Qwen3-32B-AWQ \
--tensor-parallel-size=4 \
--max-model-len=32768 \
--port=8000
Because /dev/shm is backed by host RAM, vLLM bypasses disk I/O contention during graph deserialization and begins serving OpenAI-compatible (/v1/chat/completions) and Anthropic-compatible (/v1/messages) requests immediately.
⚠ [CRITICAL] Shell Command Injection & Unsanitized Path Traversal —
handlers/export.go:48User-supplied query parameter
r.URL.Query().Get("archive")is joined directly to the filesystem path withoutfilepath.Base()and interpolated intoexec.Command("sh", "-c", ...). An authenticated user can escape the export directory or execute arbitrary shell commands inside the container.