The Inference Cost Stack
GPU amortization, memory bandwidth pricing, energy costs, cloud vs self-hosted TCO — where money actually goes in inference.
Inference is where most AI compute spending goes — and the cost structure is fundamentally different from training. Understanding the cost stack helps make optimization decisions that matter for the business.
1. Where the Money Goes
| Cost component | Share of total | Scales with |
|---|---|---|
| GPU hardware (amortization) | 50-70% | GPU count × depreciation period |
| Energy (power + cooling) | 15-25% | GPU power × PUE × electricity rate |
| Networking | 5-10% | Bandwidth for multi-node, egress |
| Staff (ML + infra engineers) | 5-15% | Team size (often underestimated) |
| Software (licenses, API costs) | 2-5% | Usage-based |
The GPU Dominance
An H100 SXM GPU costs 250,000, or **$31,000 per GPU slot** including system overhead.
Amortized over 3 years:
Add power (700W × 0.09/hr), data center space, networking, staff allocation → ~$2.00-2.50/hour per GPU self-hosted (fully-loaded cost).
Cloud pricing for comparison:
| Provider | GPU | On-demand $/hr | Reserved (1yr) $/hr |
|---|---|---|---|
| AWS (p5.48xlarge) | 8× H100 | ~$98 | ~$65 |
| GCP (a3-highgpu-8g) | 8× H100 | ~$99 | ~$62 |
| CoreWeave | 8× H100 | ~$23 | ~$18 |
| Lambda | 8× H100 | ~$24 | ~$19 |
Self-hosted at ~65-98/hr — 2-3× cheaper to own, but requires upfront capital and operational expertise.
2. Cost per Token
| Configuration | Throughput | GPU cost/hr | Cost/1M output tokens |
|---|---|---|---|
| 70B BF16, TP=4, 4×H100 | 1,500 tok/s | $16 | $2.96 |
| 70B INT4, TP=2, 2×H100 | 2,000 tok/s | $8 | $1.11 |
| 8B INT4, 1×H100 | 5,000 tok/s | $4 | $0.22 |
Quantization halves GPU count AND increases throughput — compound savings.
3. Optimization Levers (Ranked by Impact)
| Lever | Cost reduction | Effort |
|---|---|---|
| Right-size the model (8B instead of 70B) | 5-10× | Low (if quality allows) |
| Quantization (INT4) | 2-4× | Low (PTQ, one-time) |
| Batching optimization | 2-3× | Medium (tuning) |
| Prefix caching | 1.5-2× (for shared prefixes) | Low (config change) |
| Spot/preemptible instances | 2-3× | Medium (fault tolerance needed) |
| PD disaggregation | 1.5-2× | High (architecture change) |
| Custom silicon | 2-5× | High (vendor lock-in risk) |
4. Build vs Buy
| Factor | Self-hosted | Cloud API (OpenAI, Anthropic) |
|---|---|---|
| Upfront cost | High ($250K+ for 8×H100) | Zero |
| Per-token cost | Low ($0.22-3/M tokens) | $0.15-60/M tokens (varies by model) |
| Break-even volume | ~50M tokens/month | Below break-even: cloud cheaper |
| Control | Full | Limited (rate limits, model changes) |
| Ops burden | High | Zero |
For custom silicon options, see Custom Silicon. For multi-model cost optimization, see Multi-Model Serving.
Self-Check
- Calculate GPU amortization cost per hour (self-hosted)
- Calculate cost per million tokens for a given configuration
- Rank optimization levers by cost impact
- Determine build vs buy break-even for a given token volume