Self-hosted AI agents are a specific choice with a specific payback. For most teams, API endpoints win. For the right situations, self-hosting is unambiguously correct.
Three reasons to self-host
Data residency and compliance: data cannot leave your VPC under any contractual terms. Defense, certain financial, certain healthcare workloads.
Cost at very high volume: above roughly 50M tokens/day of steady-state traffic, self-hosting on reserved GPU capacity beats API pricing.
Specific model capability: fine-tuned open-weight model that outperforms frontier APIs on your specific narrow task.
Three reasons not to
Variable load: self-hosting shines on steady-state; GPU costs on variable load are brutal.
Small to medium volume: below 10M tokens/day, API pricing is cheaper end-to-end.
Team without ML-ops maturity: running inference infrastructure is a 2-4 person-year commitment. SMBs almost never have this capacity.
Break-even math (Nov 2026 pricing)
Workload: 1M queries/day, median 3000 input + 500 output tokens. Roughly 100M tokens/day = 3B tokens/month.
Claude 5.5 Sonnet via API: ~₹5-₹8 lakh/month.
Self-hosted Llama 3.3 70B on 4x H100: ~₹8-₹12 lakh/month infrastructure cost (break-even near the bottom, savings above as volume grows).
Self-hosted Qwen 2.5 72B on same infrastructure: comparable; strong quality on Indian-language workloads.
Break-even is at this volume; above 2x this volume self-hosting wins clearly; below 0.5x, API wins clearly.
The stack we recommend
Model: Llama 3.3 70B or Qwen 2.5 72B. Both strong on general tasks; Qwen slightly ahead on Indian languages.
Serving: vLLM for high-throughput; TGI or SGLang if you need specific features. All three are production-grade in 2026.
Infrastructure: 4-8x H100 or H200 on AWS, Azure, or Oracle Cloud. Reserved instances for 40-50% cost reduction versus on-demand.
Routing: same three-tier pattern as hosted models. Cheap open model for Tier 1; self-hosted larger for Tier 2; hosted frontier for Tier 3 exceptions.
Observability: LangFuse self-hosted, so the entire stack is within your VPC.
Operational discipline needed
GPU health monitoring and automated failover. Expect occasional node failures at this hardware class.
Model version management and rolling upgrades.
Load testing against the specific workload at least quarterly.
Cost tracking per workload; self-hosting cost is not free, it is just differently allocated.
Eval harness runs on the self-hosted model exactly the same as on APIs; regressions get caught early.
Key takeaways
- Self-host when compliance, volume economics, or fine-tune advantage demands it; use APIs otherwise.
- Break-even for Llama 3.3 70B vs Claude 5.5 Sonnet API is near 1M queries/day at typical workload shape.
- Operational burden is real: 2-4 person-years of ongoing capacity.
- Mixed stacks are common: self-hosted for bulk, hosted frontier for edge cases.
Frequently asked
For narrow, classification-heavy or extraction-heavy workloads, 8B models are the right call. Infrastructure cost drops dramatically; quality is acceptable on bounded tasks. We use them for Tier 1 in several deployments.
Worth evaluating. Oracle has competitive GPU pricing for reserved capacity through 2026. AWS and Azure remain the defaults for ecosystem integration; Oracle wins on pure cost if you can absorb the ecosystem gap.
Yes meaningfully. Round-trip latency from your VPC to a model on the same VPC is 20-80ms versus 200-500ms to a hosted API. For voice and real-time use cases this matters.
LoRA fine-tunes on open-weight models are the practical pattern. 2000-10000 example LoRA fine-tune gets you domain adaptation at reasonable cost. Fine-tunes are portable across hosting infrastructure.