Run it yourself, or pay per token?
A GPU is a fixed cost: you pay for it whether it serves ten requests or ten million. An API is the opposite. Enter your monthly volume, the API you would use and the hardware you would buy, and see both bills side by side, with the volume at which owning starts to pay.
Free · runs in your browser · updated
1 · Your workload and the API
2 · Your hardware
3 · Monthly cost
One machine serves about 1349 output tokens/s across 16 concurrent requests and reads prompts at about 4016 tokens/s (roofline estimates from the inference speed estimator at its default efficiencies). Not counted: your time, redundancy, cache-write surcharges and resale value.
- Speed in detail →inference speed estimator
- GPT-5 mini pricing →model guide
How this is computed +
Local cost
- Throughput from the roofline model: decode tokens/s across the batch (memory bandwidth at 70% of peak, 65% on Apple), and prompt tokens/s from the prefill estimate (compute at 40% MFU; on Macs, without a published FLOPS figure, 10× the decode rate). Each extra card adds 85% of one.
- Seconds per request = output tokens ÷ decode tokens/s + input tokens ÷ prefill tokens/s. Busy hours = requests × seconds per request ÷ 3,600.
- Machines = busy hours ÷ (730 h × max utilization), rounded up. Hardware per month = machines × price ÷ months written off.
- Electricity = (busy hours × load watts + remaining hours × idle watts) ÷ 1,000 × $/kWh, plus other costs per machine.
API cost
Requests × (uncached input × input price + cached input × cache-read price + output × output price), at the list prices in the LLM API cost calculator, including long-context tiers.
Break-even
The smallest monthly volume, from 1,000 to 1 billion requests, at which the local total is below the API's.
Building an AI agent?
When an agent gets worse after an update, the cause is often a router, retriever or judge picking the wrong option, not a lost skill. Selection reliability measures how often that happens, with a confidence interval, and gates the next update.
Questions
Is it cheaper to run an LLM locally than to use an API?
Only at high, steady volume. A $3,000 desktop written off over three years costs about $83 a month before electricity, which buys tens of millions of tokens from a small API model. Owning wins when the hardware is busy most of the day, or when the API you would otherwise use is a large, expensive one.
How many requests can one GPU serve?
It depends on output length and batching. Decode speed is set by memory bandwidth: an RTX 4090 runs an 8B model at Q4 at roughly 100+ tokens per second for one request, and serving many requests at once multiplies total throughput several times over. The calculator estimates capacity from the same roofline model as the inference speed estimator.
What does this leave out?
Your time to run and update the server, redundancy for when it fails, cache-write surcharges on the API side, discounts for batch APIs, and the hardware's resale value. It also compares cost only: an open model and an API model can differ a lot in quality on your task.
Should I include electricity at idle?
Yes, if the machine stays on. The calculator charges load power for the hours it is busy serving your workload and idle power for the rest of the month.
Related
- Free toolLLM inference speed estimator
- Free toolLLM API cost calculator
- Free toolVRAM calculator
- Free toolToken Counter & Context Window CheckerPaste text or load a file to count its tokens, see what sending it costs as input, and check which models it fits in. Nothing leaves your browser.
- Free toolTest-Time Compute Cost EstimatorWhat Best-of-N and self-consistency cost per query, and the accuracy they can buy: oracle coverage and majority vote against the number of samples.
- Free toolAI Eval Sample Size CalculatorHow many eval items you need: the margin of error on one model's accuracy, and the sample size to detect a difference between two models, paired or not.
- Free toolLLM Training Compute CalculatorTraining FLOPs from parameters and tokens (6ND), GPU-hours at a realistic utilization, wall-clock time and cost — or the compute-optimal model for a budget.
- Free toolAgent Tool Count CalculatorHow often an agent picks the wrong tool as its library grows, from published benchmarks: every tool in the prompt, embedding or BM25 shortlists, with the measured range marked.
- Free toolLLM Judge Agreement CalculatorCheck an LLM-as-judge against human labels: Cohen's kappa with a 95% interval, the confusion matrix, sensitivity and specificity, and how many human labels the judge is worth.
- Free toolEU AI Act Risk CheckerAnswer a few questions to see your EU AI Act risk tier, the obligations with their articles, and the deadlines after the 2026 Digital Omnibus.
