Is a local LLM cheaper than an API?
Per token, easily. Renting a million tokens of Qwen3.8 27B costs 11.5c. Generating the same million on a Mac Studio M5 Max, 64GB costs 1.7c of electricity, 7 times less. The machine costs $3,499, which is 35.9B tokens of that gap, and that number is the whole argument.
Run the numbers on that pairing
Jump to: Where those two figures come from · A million tokens, model by model · The token count holds still. The date moves. · What you use it for moves the line further than what you buy · Where renting still wins
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.04 per million in and $1.25 per million out, that is 3.7c for the input and 7.8c for the output: 11.5c the million.
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 11.5c 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 |
|---|---|---|---|---|
| LFM2.5 2.6BQ4_K_M | 35.9c | 0.21c | 175× | 9.79B tokens |
| Nemotron 3.5 Bolt 74B-A9BIQ2 nobody rents it; priced as Qwen3.6 27B |
35.9c | 0.68c | 53× | 9.92B tokens |
| Qwen3.6 27BQ4_K_M | 35.9c | 1.8c | 20× | 10.2B tokens |
| Muse Glimmer 30BQ4_K_M | 35.6c | 1.7c | 22× | 10.3B 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 |
| Qwen3.8 27BQ4_K_M | 11.5c | 1.7c | 6.6× | 35.9B tokens |
| Gemma 4 31B itQ4_K_M | 11.5c | 2.1c | 5.4× | 37.4B tokens |
| Nanbeige4.3 33BQ4_K_M nobody rents it; priced as Gemma 4 31B it |
11.5c | 2.6c | 4.5× | 39.2B tokens |
| LFM2.5 24B-A2BQ4_K_M | 9.1c | 0.50c | 18× | 40.9B 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 |
| Flint 40B-A2.5BUD-Q4_K_XL nobody rents it; priced as Qwen3.6 35B-A3B |
9.1c | 0.59c | 15× | 41.3B 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.6B tokens |
| Qwen3-Coder 30B-A3BQ4_K_M | 8.3c | 1.2c | 6.8× | 49.3B tokens |
| LFM3 1.7BQ4_K_M nobody rents it; priced as Granite 4.2 8B |
6.6c | 0.14c | 47× | 54.5B tokens |
| Spark-X2.6 1.7BQ4_K_M nobody rents it; priced as Granite 4.2 8B |
6.6c | 0.15c | 45× | 54.5B tokens |
| Ling 3.0 tinyQ4_K_M nobody rents it; priced as Granite 4.2 8B |
6.6c | 0.24c | 28× | 55.3B tokens |
| MiniCPM5 2BQ4_K_M nobody rents it; priced as Granite 4.2 8B |
6.6c | 0.28c | 24× | 55.7B tokens |
| Qwen3.5 4BQ4_K_M nobody rents it; priced as Granite 4.2 8B |
6.6c | 0.35c | 19× | 56.4B tokens |
| Spark-X2.5 4BQ4_K_M nobody rents it; priced as Granite 4.2 8B |
6.6c | 0.36c | 18× | 56.4B tokens |
| Spark-X2.6 4BQ4_K_M nobody rents it; priced as Granite 4.2 8B |
6.6c | 0.45c | 15× | 57.2B tokens |
| Granite 4.2 30BQ4_K_M nobody rents it; priced as GLM-4.7-Flash |
8.2c | 2.4c | 3.3× | 61.1B tokens |
| Laguna XS 2.1Q4_K_M | 6.4c | 0.75c | 8.5× | 62.2B tokens |
| Granite 4.2 8BQ4_K_M | 6.6c | 1.00c | 6.6× | 62.9B tokens |
| Gemma 4 26B-A4BQ4_K_M | 5.3c | 0.80c | 6.7× | 77.5B tokens |
| Nemotron 3.5 Lightning 30B-A3BQ4_K_M | 3.1c | 0.61c | 5.1× | 141B tokens |
| gpt-oss-20bMXFP4 | 2.3c | 0.67c | 3.3× | 222B tokens |
| Gemma 4 E4BQAT Q4_0 nobody rents it; priced as gpt-oss-20b |
2.3c | 0.80c | 2.8× | 242B tokens |
| Devstral Small 2 24BQ4_K_M nobody rents it; priced as gpt-oss-20b |
2.3c | 1.8c | 1.2× | 834B tokens |
Every one of the 34 models here pays the machine back at some point. 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 | 35.9B tokens | 1,967 years |
| 200klight assistant use | 35.9B tokens | 492 years |
| 1Ma moderate coding-assistant day | 35.9B tokens | 98 years |
| 4Mheavy coding with an agent | 35.9B tokens | 25 years |
| 20Magents running most of the day | 35.9B tokens | 4.9 years |
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 those months cost as a bill, with the machine divided over the months you keep it, is on its own page.
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 | 84.6c | 18.4c | 5.29B tokens |
| Translation about as much out as in |
1:1 | 64.5c | 13.8c | 6.91B tokens |
| Chatting and questions short questions, medium answers, a little history carried along |
2:1 | 44.3c | 9.2c | 9.98B tokens |
| Coding assistant code and context in, small edits and explanations out |
4:1 | 28.1c | 5.5c | 15.5B tokens |
| Summarising documents whole documents in, a paragraph out |
10:1 | 14.9c | 2.5c | 28.2B tokens |
| Agentic coding (Claude Code style) whole files and tool results resent on every turn |
15:1default | 11.5c | 1.7c | 35.9B tokens |
| Search over your own documents retrieved passages in, short answers out |
20:1 | 9.7c | 1.3c | 41.9B tokens |
Writing and drafting pays the machine back in 5.29B tokens; search over your own documents needs 41.9B. 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 1,187 machine-and-model pairings this site can price, electricity beats the API on 1,165. The remaining 22 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 492 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.