AI Infrastructure

GPU cost optimization for LLM inference

Where inference money goes and which levers move it: utilisation, batching, quantisation, model size and the build-versus-API decision.

14 September 2026 · 7 min read · Serverconfigs engineering

Inference cost has one dominant driver: how busy you keep an expensive accelerator. Almost everything else is a way to raise that number or to need less of it.

Measure first

You need three numbers before changing anything: GPU utilisation over time, requests and tokens per second, and cost per thousand requests (or per million tokens). Without a unit cost you cannot tell whether a change helped.

The levers

Batching. Serving engines such as vLLM use continuous batching to serve many requests on one GPU. Throughput per dollar often improves dramatically over naive one-request-at-a-time serving.

Quantisation. Lower-precision weights use less memory and can run faster, which may let a model fit on a smaller or fewer GPUs. Test quality on your own evaluation set; the effect varies by model and task.

Model size. Many tasks do not need the largest model. Route simple requests to a smaller model and keep the large one for hard cases. Evaluate with your own data.

Caching. Prefix and prompt caching avoid recomputing identical context. Application-level caches help when the same question repeats.

Right-sizing the hardware. Match GPU memory and bandwidth to the model and context length. The newest accelerator is not always the cheapest per token.

Scheduling and idle time. Scale down when traffic drops, share GPUs between workloads where isolation allows, and schedule training and batch jobs into quiet hours. Idle accelerators are the most expensive kind of idle.

Spot or preemptible capacity for work that tolerates interruption, such as batch inference and fine-tuning.

Build or call an API?

Self-hosting wins when volume is high and steady, latency or data rules require it, or you need a model nobody offers as an API. An API wins when volume is low or spiky, or when the engineering effort outweighs the savings. Build the cost model for both with your real numbers.

Cap it, and enforce the cap

Dashboards do not stop spending. Pair every budget with an enforcement point such as a gateway rate limit.

Our AI infrastructure work covers measurement, serving design and token budgets.

Serverconfigs engineering

Notes from the engineers who run cloud cost, platform and AI enablement work for clients.

Keep reading

Related articles.

Newsletter

Practical notes on cost, platform engineering and AI infrastructure. See the Privacy Policy.

Start here

Find the waste first.

45 minutes with an engineer, a read-only look at your bill and a clear list of what to fix.

45-min call with an engineer · Read-only access · No commitment

Talk to an Engineer Free Cost Assessment