API vs Self-hosted LLMs
Rent the best model, or run your own
API providers give you the best models with zero ops. Self-hosting gives you data control, custom fine-tunes, and predictable cost past a break-even volume, usually 10 to 50 million tokens per day.
API LLM
Glossary →Call a hosted model through a provider API (OpenAI, Anthropic, Google, Bedrock). Pay per token, get the frontier model, hand over control of ops. Data leaves your premises unless you use a private-cloud tier.
Best for: Prototyping, low volume, need the best model.
Self-hosted LLM
Glossary →Run an open-weights model (Llama, Mistral, Qwen, DeepSeek) on your own GPUs, whether bare-metal, cloud, or a serving framework like vLLM or TGI. You own the model, the ops, the data path, and the cost curve.
Best for: High volume, data residency, custom fine-tunes.
At a glance
| Dimension | API LLM | Self-hosted LLM |
|---|---|---|
| Model ceiling | Frontier (GPT-5, Claude 4, Gemini 2) | Best open weights |
| Cost profile | Per token, elastic | Per GPU-hour, fixed |
| Data path | Provider (or private tier) | Your VPC or your metal |
| Fine-tuning control | Provider-limited | Unrestricted |
| Ops burden | Minimal | Autoscale, on-call, eval infra |
| Break-even hint | Below ~10M tokens/day | Above 10-50M tokens/day (workload-dependent) |
Key differences
- 1APIs give you the frontier model instantly; self-hosting caps at whatever open weights are strongest
- 2APIs bill per token; self-hosting bills per GPU-hour whether you are busy or idle
- 3APIs send data to the provider; self-hosted stays in your VPC (or on your metal)
- 4Fine-tuning on APIs is provider-mediated; on self-hosted it is unrestricted
- 5APIs push ops onto the provider; self-hosting means autoscaling, on-call, and eval infrastructure are yours
In the interview
- Claiming self-hosting is always cheaper
- Ignoring the ops cost of running your own inference (autoscale, on-call, eval)
- Missing that some providers offer private-cloud tiers for data residency
- Forgetting that fine-tuning on APIs is provider-mediated
How to choose
API by default. Self-host at high volume, strict data residency, or when custom fine-tunes matter.
Common misconceptions
Myth: Self-hosting is always cheaper.
Reality: Below break-even it is much more expensive once you count GPUs, ops, on-call, and eval infrastructure. Break-even shifts with the model and workload.
Myth: APIs can't meet compliance needs.
Reality: Many providers offer private-cloud, no training on your data, and regional tiers. Compliance may be a paperwork exercise, not a self-hosting mandate.
Memory aid
API is renting a plane ticket; self-hosting is buying and operating your own plane.
Can you combine them?
The common pattern is hybrid: use an API for the strongest reasoning-heavy calls, self-host smaller open models for high-volume classification, embeddings, and reranking. Route by cost per successful outcome.
Related topics
Related comparisons
Distillation vs Quantization
Two orthogonal ways to shrink a large language model
Greedy vs Beam Search vs Sampling
Three ways to decode tokens from a language model
Prompt caching vs KV caching
Two ways to stop paying for the same tokens twice