LLM Inference Cost Optimization: Run AI Inference for Less Cast AI benchmark testing shows that continuous batching at batch size 8 reduces Llama 3.1 70B inference cost on a single H100 from approximately $0.60-$0.80 per million tokens to $0.15-$0.25 per million tokens, a 3-4x reduction with no additional hardware. The figures are based on Llama 3.1 70B FP8 on an H100 80GB SXM5 with vLLM 0.5+, 512-token prompt plus 256-token completion, and H100 spot pricing at approximately $2-4/hr on AWS eu-west-1 (2025). Cast AI's 2026 State of Kubernetes Optimization Report finds average GPU utilization across production Kubernetes fleets is only 5%, with the best-performing cluster (a 136-node H200 deployment) reaching 49%. Running Llama 3.1 70B on a single H100 in single-stream mode costs approximately $0.60-$0.80 per million tokens . Continuous batching at batch size 8 reduces that to $0.15-$0.25 per million tokens – a 3-4x reduction with no additional hardware. These figures come from Cast AI benchmark testing: Llama 3.1 70B FP8 on an H100 80GB SXM5, vLLM 0.5+, 512-token prompt + 256-token completion, H100 spot pricing at approximately $2-4/hr on AWS eu-west-1 2025 . The GPU did not get faster. You stopped leaving it idle between requests. One caveat: this cost reduction applies to shorter context lengths, up to around 2K tokens. For longer contexts, the KV cache competes with weight memory and reduces the effective batch size you can sustain. That gap captures the core llm inference cost problem. According to Cast AI’s 2026 State of Kubernetes Optimization Report https://cast.ai/reports/state-of-kubernetes-optimization/ , average GPU utilization across production Kubernetes fleets sits at 5% . The best-performing cluster in that dataset, a 136-node H200 deployment, reached 49%. Most teams are nowhere near it. The short answer: LLM inference cost optimization reduces the cost of serving large language models on Kubernetes by raising GPU efficiency through sharing and batching, right-sizing GPU requests, and autoscaling inference endpoints to match demand, including scale-to-zero when idle. Most inference spend funds idle capacity, not useful work. This post covers five concrete levers you can apply today, with specific tools, metrics, and configuration patterns for each. Lever 1: GPU Sharing with MIG and Time-Slicing A single A100 80GB GPU can host multiple independent inference workloads simultaneously. NVIDIA Multi-Instance GPU MIG carves one physical GPU into hardware-isolated partitions, each with dedicated memory, compute, and L2 cache. This is not virtualization. Each partition behaves like an independent physical device. A100 80GB MIG profiles include: 1g.10gb : 1 slice, 10GB memory. Fits INT4/GPTQ 7B models ~4-5GB or small embedding models. 2g.20gb : 2 slices, 20GB memory. Fits 7B and 13B INT8 models 7B INT8 ~7GB, 13B INT8 ~13GB with KV cache headroom. 3g.40gb : 3 slices, 40GB memory. Fits INT4/AWQ models up to ~30GB with normal KV cache headroom. INT4 70B weights ~35GB approach the partition limit, leaving minimal KV cache space. 7g.80gb : Full GPU. Required for 70B models at AWQ precision ~35GB weights plus KV cache or any FP16/BF16 model above 34B parameters. One critical constraint: each MIG partition runs an independent model instance. Hardware isolation means NVLink and peer-to-peer CUDA communication are disabled between partitions. Tensor parallelism across two MIG slices on the same A100 is architecturally impossible. If your 70B model needs to be split across partitions, use full physical GPUs connected by NVLink instead. For Kubernetes deployments, the nvidia-device-plugin exposes MIG partitions as schedulable resources. A deployment targeting a 3g.40gb partition requests nvidia.com/mig-3g.40gb: 1 in its resource spec. Cast AI’s GPU automation layer reads these labels and provisions the correct node type automatically, without manual instance selection. resources: limits: nvidia.com/mig-3g.40gb: "1" Time-slicing is the alternative when MIG is not available T4, A10G, older Ampere cards without MIG support . Time-slicing multiplexes GPU access at the scheduling level rather than hardware partitioning it. Multiple pods share the same GPU context. Unlike MIG, there is no memory isolation between tenants. Noisy neighbor effects are real. Use time-slicing for development workloads or low-priority batch jobs, not latency-sensitive production inference. Lever 2: Continuous Batching, Speculative Decoding, and Prefix Caching Static batching holds a batch open until it is full, then processes all requests together. This approach made sense for offline workloads. For online inference, it forces short requests to wait for long ones to finish. Throughput suffers and tail latency spikes. Continuous batching solves this by treating generation as a stream of individual iterations. New requests join the batch as soon as a slot opens, rather than waiting for the entire batch to complete. vLLM uses continuous batching by default. The result is 3-5x higher throughput versus static batching at the same hardware budget, with lower P99 latency under mixed-length workloads. Two additional vLLM features compound the gains further. Speculative Decoding Speculative decoding uses a small draft model to propose multiple tokens ahead, which the main model verifies in a single forward pass. Token generation in autoregressive LLMs is memory-bandwidth-bound, not compute-bound. Verifying a batch of draft tokens costs almost the same compute as verifying one. When the draft model’s proposals are correct, you get several tokens per forward pass instead of one. In vLLM, enable it with: --speculative-model