HOME / COMPUTER SCIENCE & DATA / AI INFRASTRUCTURE & LLM ECONOMICS / LLM VENDOR COST COMPARISON – API VS SELF-HOSTED
Computer Science & Data / AI Infrastructure & LLM Economics
LLM Vendor Cost Comparison – API vs Self-Hosted
Vendor prices and self-hosted inputs are fully user-defined assumptions. Defaults are examples only.
API Vendors (2 to 4 rows)
Self-Hosted Inputs
Compare the monthly cost of running the same LLM workload across multiple API vendors versus self-hosting open-source models on GPUs.
Formula
R_m = r * 3600 * h_d * d_m; T = T_p + T_c; tokens_m = R_m * T; per vendor: C_api_j = (tokens_m / 1000) * p_j; self-hosted: capacity = q * N; GPUhours = tokens_m / ((q * N) * 3600); C_self = GPUhours * p_gpu.
Worked Example
requestsPerSecond1
promptTokensPerRequest500
completionTokensPerRequest300
activeHoursPerDay24
activeDaysPerMonth30
apiVendors[object Object],[object Object]
selfHosted[object Object]
Result: requestsPerMonth: 2592000; tokensPerMonth: 2073600000; vendorACost: 20736; vendorBCost: 41472; selfHostedGpuHours: 360; selfHostedCost: 1260For this workload, VendorA costs about 20.7k/month and VendorB about 41.5k/month, while a self-hosted setup that can serve the same load at 400 tokens/sec per GPU would cost roughly 1.3k/month in GPU time at 3.50/hour.
Frequently Asked Questions
What about storage, engineering time, and other self-hosting costs?
This model compares workload-serving cost only; include staffing, storage, and platform operations separately in your full TCO view.
How do I estimate realistic tokens-per-second for my model?
Use measured throughput from your own inference stack and hardware profile, then enter that observed value as the input assumption.
Does this compare quality or only price?
It compares cost only; model quality, latency, and reliability need separate evaluation.