Is a local LLM cheaper than an API?
Per token, easily. Renting a million tokens of Qwen3.8 27B costs 45.6c. Generating the same million on a Mac Studio M5 Max, 64GB costs 1.7c of electricity, 26 times less. The machine costs $3,499, which is 7.97B tokens of that gap, and that number is the whole argument.
Run the numbers on that pairing
Where those two figures come from
A million tokens at 15:1 is 937,500 you send and 62,500 the model writes back. The API bills both. At $0.32 per million in and $2.50 per million out, that is 30.0c for the input and 15.6c for the output: 45.6c the million. Most of the bill is the context you send, not the answer you get.
At home you pay for the electricity the machine draws while it writes those 62,500 tokens. At 24.7 tok/s that is 2,525 seconds, about 42 minutes of generation; at 145 W it draws 0.102 kWh; at $0.17 per kWh that is 1.7c.
The input is counted in the million but costs no generation time here, because prompt processing runs far faster than generation. It is not free, so read the electricity figure as a floor rather than a final number. The 145 W is a stand-in: nobody has put a meter on this machine, and its own page says what the figure borrows. Double it and a million tokens still costs 3.5c to generate against 45.6c to rent. Electricity is at United States prices (US EIA).
A million tokens, model by model
Every model a Mac Studio M5 Max, 64GB holds at 32k context, priced both ways. The last column is what matters: how many tokens have to go through the machine before the gap has covered the $3,499.
| Model | Rented | Generated | Cheaper by | Pays the machine back at |
|---|---|---|---|---|
| Qwen3.8 27BQ4_K_M | 45.6c | 1.7c | 26× | 7.97B tokens |
| Qwen3.6 27BQ4_K_M | 40.6c | 1.8c | 23× | 9B tokens |
| Muse Glimmer 30BQ4_K_M | 35.0c | 1.7c | 21× | 10.5B tokens |
| Ministral 3 14BQ4_K_M | 20.0c | 1.3c | 16× | 18.7B tokens |
| Ministral 3 8BQ4_K_M | 15.0c | 0.91c | 17× | 24.8B tokens |
| Ornith 1.5 35B-A3BQ4_K_M nobody rents it; priced as Qwen3.6 35B-A3B |
9.1c | 0.58c | 16× | 41.2B tokens |
| Qwen3.6 35B-A3BQ4_K_M | 9.1c | 0.58c | 15× | 41.3B tokens |
| KAT-Coder V2.5 Dev 35B-A3BQ4_K_M nobody rents it; priced as Qwen3.6 35B-A3B |
9.1c | 0.59c | 15× | 41.3B tokens |
| Gemma 4 31B itQ4_K_M | 10.6c | 2.4c | 4.4× | 42.9B tokens |
| Nemotron 3.5 Lightning 30B-A3BQ4_K_M | 8.8c | 0.61c | 14× | 43B tokens |
| Qwen3.5 9BQ4_K_M | 8.3c | 0.63c | 13× | 45.5B tokens |
| Ornith 1.5 9BQ4_K_M nobody rents it; priced as Qwen3.5 9B |
8.3c | 0.64c | 13× | 45.6B tokens |
| Gemma 4 12BQ4_K_M nobody rents it; priced as Qwen3.5 9B |
8.3c | 0.74c | 11× | 46.2B tokens |
| GLM-4.7-FlashQ4_K_M | 8.2c | 0.82c | 10× | 47.3B tokens |
| Qwen3-Coder 30B-A3BQ4_K_M | 8.3c | 1.2c | 6.8× | 49.7B tokens |
| MiniCPM5 2BQ4_K_M nobody rents it; priced as Granite 4.2 8B |
7.2c | 0.28c | 26× | 50.6B tokens |
| Qwen3.5 4BQ4_K_M nobody rents it; priced as Granite 4.2 8B |
7.2c | 0.35c | 20× | 51.2B tokens |
| Spark-X2.5 4BQ4_K_M nobody rents it; priced as Granite 4.2 8B |
7.2c | 0.36c | 20× | 51.2B tokens |
| Ling 3.0 tinyQ4_K_M nobody rents it; priced as Granite 4.2 8B |
7.2c | 0.56c | 13× | 52.8B tokens |
| Granite 4.2 8BQ4_K_M | 7.2c | 1.00c | 7.2× | 56.5B tokens |
| Granite 4.2 30BQ4_K_M nobody rents it; priced as GLM-4.7-Flash |
8.2c | 2.4c | 3.4× | 60.6B tokens |
| Laguna XS 2.1Q4_K_M | 6.4c | 0.75c | 8.5× | 62.2B tokens |
| Gemma 4 26B-A4BQ4_K_M | 5.3c | 0.80c | 6.7× | 77.5B tokens |
| gpt-oss-20bMXFP4 | 2.5c | 0.67c | 3.7× | 191B tokens |
| Gemma 4 E4BQAT Q4_0 nobody rents it; priced as gpt-oss-20b |
2.5c | 0.80c | 3.1× | 206B tokens |
| Devstral Small 2 24BQ4_K_M nobody rents it; priced as gpt-oss-20b |
2.5c | 1.8c | 1.4× | 523B tokens |
| LFM2.5 2.6BQ4_K_M | nothing | 0.21c | renting is cheaper | never |
26 of the 27 models here pay the machine back at some point. LFM2.5 2.6B does not, because it is listed free by the cheapest host on the date checked, and a free endpoint cannot be beaten on price. A model nobody rents is priced as its closest hosted match and the row says so.
The token count holds still. The date moves.
Break-even on this site is usually a number of months, and months depend on how hard you work the machine. Counted in tokens it does not: the saving on each million is the same at any level of use, so the count that covers $3,499 is the same too. Here is Qwen3.8 27B on a Mac Studio M5 Max, 64GB at the five levels the calculator names.
| A day's use | Tokens to break even | How long that takes |
|---|---|---|
| 50ka few chats a day | 7.97B tokens | 436 years |
| 200klight assistant use | 7.97B tokens | 109 years |
| 1Ma moderate coding-assistant day | 7.97B tokens | 22 years |
| 4Mheavy coding with an agent | 7.97B tokens | 5.5 years |
| 20Magents running most of the day | 7.97B tokens | 13 months |
That is the case for buying, and the case against it, in one table. The machine is cheap per token and expensive to own, so the only thing that makes it pay is volume you actually have.
What you use it for moves the line further than what you buy
The mix matters because the two sides bill it differently. The API charges for every token you send; the machine spends its time and its watts on the tokens it writes. So work that sends a lot and writes a little is the cheapest to rent, and the slowest to justify a machine.
| What you do with it | Mix | Rented | Generated | Pays the machine back at |
|---|---|---|---|---|
| Writing and drafting a short brief in, long text out |
0.5:1 | $1.77 | 18.4c | 2.2B tokens |
| Translation about as much out as in |
1:1 | $1.41 | 13.8c | 2.75B tokens |
| Chatting and questions short questions, medium answers, a little history carried along |
2:1 | $1.05 | 9.2c | 3.67B tokens |
| Coding assistant code and context in, small edits and explanations out |
4:1 | 75.6c | 5.5c | 4.99B tokens |
| Summarising documents whole documents in, a paragraph out |
10:1 | 51.8c | 2.5c | 7.1B tokens |
| Agentic coding (Claude Code style) whole files and tool results resent on every turn |
15:1default | 45.6c | 1.7c | 7.97B tokens |
| Search over your own documents retrieved passages in, short answers out |
20:1 | 42.4c | 1.3c | 8.52B tokens |
Writing and drafting pays the machine back in 2.2B tokens; search over your own documents needs 8.52B. Buying the hardware changes less than that. Across the 30 current machines that run Qwen3.8 27B at 32k, a million tokens costs between 1.6c and 4.3c to generate. Their prices run from $1,269 to $18,000.
Each row is a mix the calculator offers, and the one marked default is what every other figure on this site is priced at: whole files and tool results resent on every turn, which is why it sends the most.
Where renting still wins
Of the 949 machine-and-model pairings this site can price, electricity beats the API on 892. On 37 the model is listed free by the cheapest host, so there is nothing to beat. The remaining 20 are all one model, Devstral Small 2 24B. Nobody rents it, so it is priced as gpt-oss-20b, which moves 3.6B parameters for every token against this one's 24B. It is dense, so it is slow on every machine that holds it, and the price it borrows is one a far lighter model sets.
Renting also wins any time you would not have used the machine. A pay-back counted in billions of tokens is not a prediction that you will reach them: at 200k tokens a day, light assistant use, the count arrives in 109 years, which is a long way of saying never. The reasons to buy that survive that table are the ones this arithmetic does not price: your data staying on your desk, no rate limit, no outage, and a model that still runs when the endpoint is retired.
Every figure is Qwen3.8 27B at Q4_K_M unless the row names another model, at 32k context, 15:1 input to output, $0.17 per kWh, and today's API prices held flat. Rental prices have not held flat: they have fallen steeply and repeatedly for a given level of capability (Epoch AI). The calculator can decay them 40% a year, and switching that on pushes every count on this page out. The speed above is worked out from memory bandwidth rather than measured, and each machine page says which of the two it has. To change any of this, open the calculator, or see what pays back soonest at each level of use.