Local vs API Cost Calculator
Compare the real cost of running an LLM locally versus calling a hosted API: hardware amortization, electricity, and token pricing — with a break-even point.
Cost assumes 75% input / 25% output tokens. Only models with a same-model hosted API appear here — that's the only apples-to-apples comparison.
Hosted API
$6.6
deepinfra · meta-llama/Meta-Llama-3.1-8B-Instruct · $0.28/mo
- groq: $0.58/mo
Run locally
$480
rtx-3060-12gb · 7.5 GB
- Hardware (reference price): $260
- Amortized hardware: $10.83/mo
- Electricity: $9.18/mo
Verdict
We don't push either answer. Local wins at sustained high volume; for bursty or light usage the API almost always wins. Privacy and offline use are separate reasons to go local that this calculator doesn't price.
Estimates. API prices verified monthly from official pricing pages; hardware prices are manual reference prices; electricity assumes 50% average GPU load. Local speed/quality differences vs hosted APIs are not priced.
How to use this comparator
- Drag the monthly usage slider (1–200M tokens). For reference, a chat exchange is a few hundred to a few thousand tokens; 10M/month is roughly a hundred conversations a day.
- Pick a model.Only open models with a hosted API serving the same weights are listed — that is the only apples-to-apples cost comparison.
- Set amortization months and your electricity price.Defaults are 24 months and $0.15/kWh; adjust to your situation.
- Read the result.The local hardware is chosen automatically: the cheapest setup that holds the model at Q4_K_M with 8K context — single card comfortable, then single card tight, then 2–4 identical cards.
What each side's cost is made of
API side
Monthly cost = usage × (0.75 × input price + 0.25 × output price), assuming a 3:1 input-to-output split. We take the cheapest hosted API serving that model. Unit prices come from our pricing table (verified against official pricing pages on 2026-09-01), in USD per million tokens.
Local side
Monthly cost = hardware amortization + electricity. Hardware uses the used price where available, otherwise MSRP, divided by the amortization months. Electricity = GPU TDP × 50% average load × 720 hours × your rate — a 350W RTX 3090 costs about $19/month at $0.15/kWh, a small share next to amortization.
How to read the break-even point
Break-even = hardware price ÷ (monthly API cost − monthly electricity), in months: how long until running locally starts costing less than the API. Three cases:
- Break-even inside your amortization window — local wins, and once the hardware is paid off you only pay electricity.
- Break-even far beyond it — at your current volume the card never pays for itself; stay on the API.
- "No break-even" — the API bill is lower than the electricity alone. Small models hit this easily: Llama 3.1 8B's cheapest host works out to about $0.0275 per million tokens, so 10M/month costs roughly $0.28 — less than the power a 3060 draws. The break-even is sensitive to API unit price; only pricier models like a hosted 70B bring it down to a realistic number of months.
This is an estimate — known limitations
- Electricity assumes a constant 50% of TDP; real load varies with usage.
- Hardware ignores resale value, repairs and upgrades; used prices are US-market references.
- The API side excludes cached-input discounts, batch pricing and peak/off-peak rates — real bills can be lower.
- Speed differences are not monetized: a single local card and a cloud API can differ by an order of magnitude in tok/s.
- The pricing table is a 2026-09 snapshot. API prices change often — check the provider's current page before any large commitment.
FAQ
- Is it cheaper to run an LLM locally or use an API?
- It depends on volume. At light or bursty usage the API almost always wins. Local starts winning at sustained high volume — a $1,100 used RTX 3090 pays for itself in months only when your API bill would exceed the amortized hardware plus electricity.
- How much does electricity cost for local inference?
- Assuming 50% average GPU load, a 350W card costs about $19/month at $0.15/kWh. Electricity is a small share compared to hardware amortization.
- Why do only some models appear in this calculator?
- We only compare a local model against a hosted API serving the same model — that is the only apples-to-apples comparison. Comparing a local 70B to a frontier closed model would be a quality comparison, not a cost one.
- How is the API token price calculated?
- We take the cheapest hosted API serving that model and weight it 3:1 input-to-output (0.75 × input price + 0.25 × output price). For Llama 3.1 8B, the cheapest host charges $0.02/$0.05 per million tokens, so 10M tokens a month costs about $0.28. Cached-input discounts and peak/off-peak pricing are not included.
Further reading
- CPU Offload: Is Partial GPU Offloading Worth It?The cost and speed trade-off for low-end rigs
- Why Memory Bandwidth Determines LLM Inference SpeedThe decode mechanism and the estimation formula
- How Much VRAM per Billion Parameters?2026 cheat sheet: size the requirement before pricing it
- Best GPU for Local LLMs in 2026Every budget tier, with used-price references