Formulas and assumptions

The inference cost calculator is a published model. These are its formulas and its limits, so anyone can check, challenge or reproduce a result.

Exchange rates as of 2026-11-27. Source: European Central Bank euro foreign exchange reference rates, https://www.ecb.europa.eu/stats/eurofxref/eurofxref-daily.xml, retrieved 2026-11-28

Contents

What the model is

The calculator estimates what it costs to serve tokens from a machine you own, and compares that with renting GPUs by the hour or paying a per-token API price. It is a model of cost, not a measurement of anything. Every output follows from the inputs you give it by the formulas below, which are the same formulas the calculator runs, and which are covered by automated tests.

All money is in one currency at a time. When you switch currency, amounts are converted with the exchange rates described at the end of this page.

Symbols

SymbolMeaning
CsC_sServer cost: the complete machine, GPUs included
CgC_gGPU share of the server cost (used only for performance-per-cost figures)
mmDepreciation period in months
ρ\rhoResidual value after mm months, as a fraction of CsC_s
pep_eElectricity price per kWh
WiW_i, WaW_aIdle power and inference power, in watts
uuUtilisation: the share of all hours spent serving, from 0 to 1
FFHosting, networking and maintenance per month
HHHours per month, fixed at 730 (8760/128760 / 12)
DDAggregate output (decode) tokens per second at the stated concurrency
PPAggregate uncached input (prefill) tokens per second
rrInput tokens per output token
hhShare of input tokens served from the prefix cache, 0 to 1
nnConcurrency at which DD and PP were measured

Self-hosting

Time and energy

Busy hours and idle hours in a month:

B=H uH−B=H (1−u)B = H\,u \qquad\qquad H - B = H\,(1-u)

Energy used in a month, in kWh:

E=Wa B+Wi (H−B)1000E = \frac{W_a\,B + W_i\,(H-B)}{1000}

Throughput

Serving one output token also requires processing r(1−h)r(1-h) uncached input tokens. If DD was measured on a workload that already includes prefill, the effective output rate is R=DR = D. Otherwise it is the reciprocal of the time spent per output token on decode plus prefill:

R=11D+r (1−h)PR = \frac{1}{\dfrac{1}{D} + \dfrac{r\,(1-h)}{P}}

The share of busy time spent on prefill is

s=r (1−h)/P1/D+r (1−h)/Ps = \frac{r\,(1-h)/P}{1/D + r\,(1-h)/P}

and the decode speed each of nn concurrent streams sees, assuming an even split, is D/nD/n.

Monthly cost

Md=Cs (1−ρ)mMe=E peMo=Me+FMf=Md+MoM_d = \frac{C_s\,(1-\rho)}{m} \qquad M_e = E\,p_e \qquad M_o = M_e + F \qquad M_f = M_d + M_o

Here MdM_d is straight-line depreciation, MoM_o is operating cost (electricity plus hosting) and MfM_f is the fully loaded monthly cost.

Tokens served per month

To=R B⋅3600Ti=r ToTc=h TiTu=Ti−TcT_o = R\,B\cdot 3600 \qquad T_i = r\,T_o \qquad T_c = h\,T_i \qquad T_u = T_i - T_c

These are output, input, cached input and uncached input tokens.

Cost per million tokens

fully loaded, per million output tokens=MfTo×106\text{fully loaded, per million output tokens} = \frac{M_f}{T_o}\times 10^6 fully loaded, per million total tokens=MfTo+Ti×106\text{fully loaded, per million total tokens} = \frac{M_f}{T_o + T_i}\times 10^6 hardware only=MdTo×106electricity while serving=pe Wa/10003600 R×106\text{hardware only} = \frac{M_d}{T_o}\times 10^6 \qquad \text{electricity while serving} = \frac{p_e\,W_a/1000}{3600\,R}\times 10^6

The electricity-while-serving figure ignores idle time, hosting and depreciation, so it is a floor, not a price.

Splitting the fully loaded cost between input and output by time share gives the allocated costs:

input=Mf sTi×106output (decode)=Mf (1−s)To×106\text{input} = \frac{M_f\,s}{T_i}\times 10^6 \qquad \text{output (decode)} = \frac{M_f\,(1-s)}{T_o}\times 10^6

Efficiency figures

RCs/1000 output tokens per second per 1,000 of server costRWa output tokens per second per watt\frac{R}{C_s/1000}\ \text{output tokens per second per 1,000 of server cost} \qquad \frac{R}{W_a}\ \text{output tokens per second per watt} (Wa/1000) (106/R)3600 kWh per million output tokens\frac{(W_a/1000)\,(10^6/R)}{3600}\ \text{kWh per million output tokens}

Alternatives

Per-token API

The same monthly volume priced at an API’s input, cached-input and output rates (qinq_{in}, qcq_c, qoutq_{out} per million tokens):

Mapi=Tu qin+Tc qc+To qout106M_{api} = \frac{T_u\,q_{in} + T_c\,q_c + T_o\,q_{out}}{10^6}

Rented GPUs

With gg GPUs at an hourly price cc per GPU, always-on billing charges every hour and busy-hours-only billing charges only the hours spent serving:

Mrent=g c H(always-on)Mrent=g c B(busy hours only)M_{rent} = g\,c\,H \quad\text{(always-on)} \qquad M_{rent} = g\,c\,B \quad\text{(busy hours only)}

Comparing

Break-even utilisation

Each option’s monthly cost is a straight line in utilisation, a+b ua + b\,u. For self-hosting, with MdM_d and the energy terms above:

aself=Md+F+Wi H pe1000bself=(Wa−Wi) H pe1000a_{self} = M_d + F + \frac{W_i\,H\,p_e}{1000} \qquad b_{self} = \frac{(W_a - W_i)\,H\,p_e}{1000}

For the API, aapi=0a_{api} = 0 and bapib_{api} is the API cost of the volume served at full utilisation. The two lines cross at

u∗=aalt−aselfbself−baltu^{*} = \frac{a_{alt} - a_{self}}{b_{self} - b_{alt}}

The calculator reports a crossover only if u∗u^{*} lies between 0 and 100 per cent. Otherwise one option is cheaper at every utilisation, and it says which.

Payback

payback in months=CsMalt−Mo\text{payback in months} = \frac{C_s}{M_{alt} - M_o}

shown only when Malt>MoM_{alt} > M_o. It ignores resale value, interest and any change in prices.

Total cost of ownership

Over NN months, self-hosting costs the depreciation consumed plus operating cost:

TCO(N)=(Cs−V(N))+N MoV(N)=Cs−Cs (1−ρ) min⁡ ⁣(Nm, 1)\text{TCO}(N) = \bigl(C_s - V(N)\bigr) + N\,M_o \qquad V(N) = C_s - C_s\,(1-\rho)\,\min\!\left(\frac{N}{m},\,1\right)

where V(N)V(N) is the straight-line book value. The alternatives cost N MaltN\,M_{alt}.

What the model leaves out

  • Throughput is an input. Use measured figures with their evidence labels, such as those on the benchmark pages, at a concurrency that matches your workload. A preliminary result gives a preliminary cost.
  • No tax, financing or insurance, no staff time, and no replacement of failed parts.
  • Power is two numbers, idle and inference. Real draw varies with load, and data-centre overheads such as cooling are not modelled unless you include them in the figures you enter.
  • Straight-line depreciation to a residual value you choose. Used GPU prices can move quickly.
  • API and rental prices are inputs you type. The calculator does not fetch live prices. Check them at the source on the day you decide.
  • Quality is not priced. Two systems that serve the same number of tokens may not serve the same quality, and tokenisers differ between models.
  • Utilisation is assumed constant, with no peaks, queueing or latency targets.

Exchange rates

Amounts are converted using the reference rates published by the European Central Bank, with the rate date shown beside every conversion. The conversion from currency aa to currency bb uses rates quoted against the euro:

xb=xa⋅rbrax_b = x_a\cdot\frac{r_b}{r_a}

Rates are a fixed snapshot in the site data and are refreshed by hand, so they can be several days old. They are for orientation: do not use them for invoicing or accounting.