LLM inference cost is a total-cost measure that captures the infrastructure and operations required to deliver accepted model requests at a defined quality, latency, and availability level. GPU price matters, but model size, precision, prompt and output tokens, batching, KV cache, utilization, replicas, storage, networking, and operations determine how much useful work the environment produces.
The most decision-useful unit is usually cost per accepted request or per million input and output tokens at the required service percentile. Separating fixed capacity from variable workload reveals whether cost is driven by demand, poor utilization, an oversized model, or an operating constraint, including reliability headroom.
Build the Cost Model Around Delivered Work

Start with the complete monthly cost of the serving environment. Include GPU capacity, CPU and memory, storage, network, load balancing, software, monitoring, support, and operations. Then divide by accepted workload units after excluding failed, timed-out, cancelled, or quality-rejected responses according to a documented rule.
Cost per million tokens = total serving cost for the period divided by accepted input and output tokens, multiplied by one million. Keep input and output costs separate when possible because prefill and decode have different compute and memory behavior. Also report cost per request for business workflows where token length varies widely.
Model Size and Precision Set the Resource Floor
Larger models require more weight memory and generally more computation per token. Precision and quantization change memory footprint, bandwidth demand, supported kernels, and sometimes output quality. A lower-bit format can let a model fit on fewer GPUs or leave more room for KV cache, but it should be validated on representative tasks.
Do not compare two models on infrastructure cost alone. A smaller model may require more retries, tools, retrieved context, or human review to reach the same business outcome. The correct comparison holds answer quality and workflow success constant.
Input and Output Tokens Drive Different Work
Long prompts increase prefill work and time to first token. Long outputs extend decode, occupy KV cache, and keep sequences active. Retrieval-augmented generation can reduce what the model must know internally, but poor chunking or excessive context can increase prompt length and serving cost.
Track prompt tokens, cached prompt tokens, generated tokens, request duration, and completion status by use case. Apply model and policy limits where extra context or output does not improve task quality. Token reduction should be evaluated against accuracy and user value, not pursued as a standalone target.
Batching and Concurrency Determine GPU Efficiency
Batching combines work so the GPU can process requests more efficiently. At sufficient demand, it can increase tokens per second and reduce cost per token. However, waiting to form batches can raise queue time, and too many active sequences can increase memory pressure or tail latency.
Find the operating point that meets time-to-first-token and inter-token objectives at expected concurrency. Measure batch size distribution, queue time, active sequences, preemptions, GPU utilization, and tokens per second. Peak benchmark throughput is not economical if production traffic rarely reaches the conditions that produced it.
KV Cache Turns Context and Concurrency Into Capacity
KV-cache memory grows with cached tokens and active sequences, based on the model architecture and cache precision. As context length and concurrency rise, cache can limit batch capacity before compute is fully used. Prefix caching can reduce repeated prefill work, but hit rate and cache lifecycle determine the actual benefit.
Record cache occupancy, evictions, preemptions, and memory headroom. Separate the capacity needed for weights from the capacity needed for traffic. This makes it clear whether another GPU is required to hold the model, support a longer context, increase concurrency, or meet a recovery objective.
Utilization and Replicas Shape Fixed-Capacity Economics
Dedicated infrastructure has a capacity commitment, so low productive utilization raises unit cost. Public cloud can reduce idle commitment for irregular workloads, but unused instances, reservations, storage, and data transfer still affect the bill. In both models, productive tokens or accepted requests are more useful than allocated GPU hours.
Replicas provide traffic capacity and availability, but they can fragment demand. Too many small replicas may form weaker batches. Too few large replicas can create failure concentration and maintenance risk. Model the steady state, peak, one-replica-down condition, and rolling upgrade before deciding replica count.
Include Storage, Networking, and Operations
| Cost layer | Typical driver | Optimization question |
| Model storage | Artifact copies, versions, startup reads, and caches | Which versions need hot access, and how fast must a replica start? |
| RAG data | Vector indexes, source chunks, updates, and retrieval traffic | Does more context improve accepted answer quality? |
| Networking | Client traffic, inter-GPU communication, data transfer, observability | Is the topology limiting useful throughput or adding transfer cost? |
| Operations | Monitoring, upgrades, incidents, capacity planning, support | Which tasks remain internal, and how much engineering time do they consume? |
| Reliability | Spare capacity, replicas, backup, failover, test environments | What service objective justifies the reserved headroom? |
Compare Infrastructure Models With the Same Demand Curve
Public cloud can fit uncertain, short-lived, or regionally distributed demand. Dedicated private infrastructure can fit sustained workloads that need predictable capacity, data control, or a stable cost envelope. A hybrid design can keep predictable production traffic on dedicated capacity and use cloud resources for temporary bursts or experiments.
OneSource Cloud's Private AI Infrastructure supports dedicated GPU, storage, and network design for sustained workloads. Managed AI Infrastructure adds the monitoring, optimization, and lifecycle work that should be included in a complete inference cost model.
FAQ
What is the best unit for comparing LLM inference cost?
Use cost per accepted request for business workflows and separate cost per million input and output tokens for technical analysis. Pair the cost with model quality, latency percentiles, and availability. A low token price is not comparable when requests fail, answers require rework, or service objectives differ.
Does quantization always reduce inference cost?
Quantization can reduce weight memory and improve hardware efficiency, but savings depend on runtime support, kernels, batch behavior, and quality. Validate the task outcome and measure the full serving configuration. A quantized model that needs more retries or fails quality thresholds may not lower business cost.
Why can higher GPU utilization increase latency?
High utilization can indicate efficient work, but it can also mean the system has little headroom. More batching and active sequences may increase queue time or inter-token latency. Optimize for the required latency percentile and accepted throughput, using utilization as an explanatory metric rather than the sole target.
When is dedicated infrastructure economical for inference?
It becomes worth evaluating when demand is sustained, capacity can be shared productively across services, and control or predictability has business value. Compare the complete fixed-capacity cost with realistic public cloud usage, discounts, data transfer, operations, and the cost of required availability headroom.
Summary
Control LLM inference cost by measuring accepted work, right-sizing model and precision, tuning batching and cache, and including reliability and operations. Teams can use a OneSource Cloud AI Cluster Survey to model workload demand, latency objectives, and dedicated capacity.