Model pay-per-token API spend vs. dedicated vLLM GPU clusters, prompt caching, and 100M-token break-even.
Comparing closed-model APIs against self-hosted open weights comes down to a fundamental economic trade-off: variable pay-per-token pricing versus fixed GPU cluster reservations. A standard llm inference cost calculator helps AI engineering leads determine the exact token volume threshold where self-hosting open-weight models (Llama 3.3, Qwen 2.5) on vLLM becomes cheaper than commercial API calls.
Definition & Core Token Formula
LLM inference cost is the total expenditure required to process input prompts and generate completion tokens. For commercial APIs, it equals input token volume multiplied by input rate plus output token volume multiplied by output rate, minus prompt caching discounts.
Closed APIs charge strictly on consumption. However, pricing is heavily asymmetric:
Self-hosting replaces variable token rates with fixed monthly infrastructure line items:
Low-volume applications lose money on self-hosting, while high-volume applications save dramatically. Because cloud providers bill continuously for reserved GPUs whether they process maximum load or sit idle, early-stage MVPs should always remain on commercial APIs.
| Monthly Volume | Frontier API Bill (Est) | Self-Hosted vLLM (1x H100) | Economic Verdict |
|---|---|---|---|
| 10M Tokens / Mo | $40.00 | $2,867.90 (Compute + Labor) | API is 98% cheaper (GPU idle waste) |
| 50M Tokens / Mo | $200.00 | $2,868.70 | API remains heavily favored |
| ~100M Tokens / Mo | $400.00 – $650.00 | $1,867.70 (Bare Infra) | The Break-Even Transition Zone |
| 250M Tokens / Mo | $1,000.00 | $1,872.70 | vLLM generates parity with bare infra |
| 500M Tokens / Mo | $2,000.00 – $3,200.00 | $1,877.70 (1x H100) | Self-hosting saves 35% to 55% |
Once monthly volume crosses 500 million tokens, a single reserved H100 running vLLM operates at a fraction of commercial API rates. Because a single H100 with FP8 weights can serve up to 1.8 billion tokens per month, software companies capture massive unit margin expansion as they scale.
Renting GPU capacity from specialized clouds (Lambda Labs, RunPod, Vast.ai) costs 35% to 50% less than on-demand hyperscaler instances (AWS EC2, Google Cloud, Azure).
| GPU Hardware Model | VRAM Capacity | Specialized Cloud Rate | Hyperscaler AWS Rate | Recommended Target Workload |
|---|---|---|---|---|
| NVIDIA H100 SXM5 | 80 GB HBM3 | $2.49 / hr ($1,817/mo) | $3.85 / hr ($2,810/mo) | Llama 3.3 70B (FP8 / AWQ) |
| NVIDIA L40S | 48 GB GDDR6 | $0.85 / hr ($620/mo) | $1.21 / hr ($883/mo) | Llama 3.1 8B, Mistral 7B (FP16) |
| NVIDIA A100 (SXM4) | 80 GB HBM2e | $1.99 / hr ($1,452/mo) | $3.27 / hr ($2,387/mo) | DeepSeek-V3 Quantized, Embeddings |
The VRAM Sizing Rule: Ensure your allocated GPU memory comfortably fits model weights plus a dynamic KV cache pool. A 70B parameter model in FP8 quantization requires approximately 72 GB of VRAM. Running on a single 80GB H100 leaves 8 GB for the KV cache, which supports up to 32 concurrent requests with 4K context windows before requiring tensor parallelism across two GPUs.
Commercial APIs have introduced prompt caching to defend their pricing margins against self-hosting. In applications with static system prompts, extensive documentation contexts, or repetitive chat histories, caching dramatically alters the economics.
Cached prompt tokens receive an automatic 50% to 75% rate reduction. In high-context RAG pipelines with 60% cache hit rates, your effective input cost drops from $2.50 to $1.75 per million tokens.
vLLM uses PagedAttention to eliminate memory fragmentation in the KV cache, increasing throughput by up to 4× compared to HuggingFace Transformers. Chunked prefills prevent long prompts from blocking quick completions.
When calculating unit economics for AI products, factor in both prompt cache hit rates and output token lengths. If your application primarily classifies text (short output), commercial APIs remain viable much longer than if your application generates extensive code or technical memos (heavy output).
Self-hosting vLLM on reserved cloud GPUs is cheaper than the OpenAI API only when sustained monthly token volume exceeds 80 million to 150 million tokens for frontier models. Below this threshold, paying fixed monthly cloud GPU rental costs ($1,800 to $2,800/month per H100) results in wasted idle capacity, making OpenAI's pay-per-token model more economical.
Prompt caching delivers a 50% to 75% discount on repeated input tokens across commercial APIs like OpenAI and Anthropic. In high-context applications like document search or coding assistants with 80% cache hit rates, prompt caching cuts the API bill significantly, pushing the self-hosting break-even point from 80M to over 250M tokens per month.
Output token generation is autoregressive and memory-bandwidth bound, requiring the GPU to load full model weights into memory for every single generated token. Input processing is compute-bound and processed in parallel, making input tokens fundamentally cheaper to serve at the hardware level.
In 2026 pricing benchmarks, an NVIDIA H100 PCIe or SXM5 GPU costs between $2.20 and $2.50 per hour ($1,600 to $1,825/month) on specialized GPU clouds like Lambda Labs and RunPod. On hyperscalers like AWS EC2 (p5 instances), on-demand and reserved pricing ranges between $3.80 and $4.50 per hour ($2,775 to $3,285/month) per GPU equivalent.
A single NVIDIA H100 80GB GPU running vLLM with PagedAttention and FP8 quantization can generate between 1,000 and 1,500 output tokens per second sustained across concurrent batches. At 70% average daily utilization, one H100 can serve approximately 1.8 billion tokens per month.
Llama 3.3 70B and Qwen 2.5 72B match GPT-4o performance across standard enterprise extraction, summarization, and customer support workloads. Running these models on a single H100 GPU via vLLM with FP8 quantization provides near-frontier quality at a flat hardware rental cost.
Do not migrate from commercial APIs to self-hosted vLLM clusters until your baseline token volume consistently crosses the 100M monthly token mark. Use our interactive simulator above to model your break-even threshold and hardware reservation costs.
1. Commercial API Pricing Baseline
Frontier rates model standard OpenAI GPT-4o / Anthropic Claude 3.5 Sonnet list pricing ($2.50/1M input, $1.25/1M cached input, $10.00/1M output). Commodity rates model GPT-4o-mini / Haiku ($0.15 input, $0.60 output).
2. Hardware Rental & Throughput
GPU reservation costs reflect 2026 published on-demand hourly rates from Lambda Labs, RunPod, and AWS EC2. Throughput benchmarks assume optimized vLLM PagedAttention continuous batching operating at 70% average daily utilization.