Self-hosted LLM versus API is a comparison of who operates the weights and what you pay to keep them answering. It is not a privacy trophy and it is not a token-price screenshot. A shared API, a dedicated endpoint and a machine you run are three different contracts. This page gives the break-even method, the residency nuance, and the hybrid pattern that uses both without pretending they are the same thing.
By Shen Pandi, Towards AGI. Updated 27 November 2026.
Three contracts, not two slogans
The search query says self-hosted LLM versus API, as if there were two products. In a design review there are at least three. A shared API: the vendor runs a multi-tenant service and you pay for tokens. A dedicated endpoint: the vendor still runs the weights, but the contract names isolation, a region, staff access, or a commit. Self-hosting: your operator loads the weights on hardware you can name, in a cloud account or a room. The deployment essay walks the shapes, including private cloud and air-gap. This page is the decision between paying someone to run the model and running it.
Open weights are what make self-hosting possible. They are not what make it lawful or cheap. A closed model has no self-hosted column unless the vendor sells you the dedicated box as their product, in which case you are still buying an API with different packaging. Do not put a closed model in the self-hosted column of a spreadsheet because a slide said “private instance”.
The rest of this page refuses two shortcuts. The first is a single token price presented as the market. We will not print one. You type the price you would sign. The second is “self-hosted means private”. It means you can see the process. Privacy and residency depend on the copies, which are a later section.
What each contract actually moves. Not a winner.
Shared API
Dedicated endpoint
Self-hosted
Who runs the weights
Vendor
Vendor
You, or a contractor you name
What you usually pay
Tokens, at a tariff
Commit, tokens, or both
GPUs kept on, plus ops
What “private” might mean
A contract clause
Isolation and a named region
You hold the disk
What it does not mean
You can leave with the weights
You operate the box
Logs and backups stayed put
The break-even method
Break-even is the volume, or the price, at which two sums you computed are equal. It is not a token count this site publishes, because the sums use your tariff and your machines. The inference cost planner does the multiplication and refuses a default price. Use it. The method below is what to type, and what the planner will not invent for you.
API side. Let input tokens and output tokens be the counts you expect in the period, usually a month. Include the passages you stuff into the prompt for retrieval, the system prompt, and the retries. Cost is input tokens times your input price per million, divided by one million, plus the same for output if the tariff differs. If you truly pay one blended rate, you may add the tokens first. If you blend two rates yourself to make the spreadsheet shorter, write the blend down. A hidden blend is how the comparison becomes fiction.
Self-hosted side, when the machines stay on. Cost is the number of GPUs times your price per GPU-hour times the hours they are powered. A month of always-on time is the hours in that month, not a utilisation fraction. If you keep the model loaded for latency, idle hours are part of the product. The planner’s self-hosted term is this product. Type the hourly price from a quote, a contract or an internal charge. An empty price stays empty.
Ops side. Add the cost of on-call, patching, evaluation time, the gateway and the log store if you want the comparison to include them. The planner has no ops field. Add the figure beside it, or write zero and label the omission. Zero is a common way to make self-hosting look cheaper than an API whose price already contains the vendor’s operators.
Break-even, for a fixed self-hosted bill and a single API price per million, is the token count where API cost equals that bill: tokens equals self-hosted cost times one million, divided by the price per million. That algebra is only honest while two assumptions hold. Adding tokens does not force another GPU. And one price really covers the mix of input and output. When either assumption fails, do not publish the rearranged number. Recompute both sums at the volume you care about.
A dedicated endpoint often breaks the algebra on purpose. A monthly commit plus a token rate is neither pure API nor pure GPU-hour. Map it onto a sum you can compare: the commit, plus expected overage, plus any traffic you still send to a shared API. Averaging a dedicated price with a self-hosted GPU to get a “hybrid rate” is not a method.
Utilisation and throughput change the GPU count
The always-on formula charges for hours powered. Utilisation explains whether those hours were busy. It does not reduce the bill of a machine you refused to turn off. Define utilisation only after you define capacity. If you multiply the GPU-hour cost by utilisation as well, you will under-count the idle box and then wonder why the invoice disagreed.
Capacity is the tokens your replicas can finish while they are serving, at the concurrency and context you will allow. It is not a benchmark tokens-per-second times the seconds in a month. A published speed is someone else’s prompts, batch, engine and hardware. Your prompts are longer, your engine may be different, and you will not sit at that batch if the latency budget forbids it. Measure, or leave capacity as unknown. An unknown capacity means you do not yet know how many GPUs the token volume requires.
When you do have a throughput you trust, in tokens per second on your prompts, a first capacity check is throughput times seconds of serving time times replicas. Serving time is not the whole month unless you will saturate the box. Peaks matter more than the average: a box sized for the monthly average and then offered to the busy hour will queue or spill. Spill onto an API is a second contract. Write it.
Metered GPU time is the other billing shape. Some clouds charge for the hours a job ran, and you can scale to zero. Then hours are busy hours, and utilisation is how you turn tokens and throughput into those hours: busy hours per GPU track tokens divided by throughput, spread across the GPUs you spun. Cost is still GPUs times hours times rate, which collapses toward tokens divided by throughput, times rate. You have not escaped throughput. You have made the bill proportional to it, and you have taken a cold start. Write the cold-start behaviour your callers will feel. We will not invent the number of seconds.
Redundancy sits outside both shapes until you add it. A failover replica that stays hot is another GPU in the always-on count. A failover that is cold is a cold start you already agreed to describe. A canary is another copy. Price the design you will run, not the single GPU that loaded the model once.
Decision prompts, not scores.
When
Then
The model stays loaded overnight because latency must
Hours powered include the night. Do not multiply by a daytime utilisation to shrink the bill.
You only pay for GPU time you consume, and callers can wait
Estimate busy hours from tokens and a throughput you measured. State the cold start.
You have no throughput on your own prompts
Do not complete the break-even. You can still price the API. The self-hosted column is unfinished.
The busy hour needs more GPUs than the monthly average
Size for the hour you will actually serve, or write the queue, or write the API spill.
Costs the token screenshot drops
A fair comparison lists the lines that do not look like a model. Storage for weights, tokenizers and the previous release you must be able to roll back. Network egress if a cloud account meters it. Evaluation compute, which is real traffic even when no customer sees it. The unused set has to be run somewhere. Human review when the model abstains. The gateway, the identity provider and the log store. Training, if you adapt the model: the inference planner excludes it, and a one-off training run is not a reason to ignore it over a year.
Licence can be a cost and a veto. Some cards are free to run and expensive to distribute. Some APIs forbid using outputs to train a competitor, which matters if your self-hosted plan was “distil the API into our weights”. Read that clause before you put distillation in the saving column. The distillation technique page is the rights question. This page only needs you not to assume the API output is a free dataset.
Quality cost is the one spreadsheets omit because it is not a line item until it is. A cheaper self-hosted checkpoint that misses the bar creates review work. That work can exceed the token saving. Run the same unused examples against the API baseline and the self-hosted candidate before you treat the smaller sum as a decision. The SLM versus LLM comparison is the size version of the same rule: a smaller bill is not a pass.
Exit cost belongs in the self-hosted column as a benefit only if you can name it. Weights you can move are an exit from a vendor’s tariff. They are not an exit from the engine, the template and the evaluation set, which you still have to operate. An API has the opposite exit: you can stop calling it, and you cannot take the weights. Write which exit you are buying.
Privacy and residency are not the hosting adjective
Self-hosting is not automatically sovereign. You can run the weights on your GPU and still copy the prompt into a log SaaS, a ticketing tool, a backup bucket and an evaluation notebook in another region. The operator of the GPU is one noun. The readers of the copies are the rest. The inference page is the roster. The sovereignty checklist is what a reviewer will ask. The AI sovereignty page is the commercial version of the same constraint.
A shared API is the clearest “the prompt leaves” design. It can still be the right design when the data class is allowed to leave, the region is named, retention is short enough, and you accept that vendor staff and the vendor’s other controls exist. Calling that sovereign because the marketing page said private is the failure mode. Calling it forbidden when counsel has already allowed it is the other failure mode. Write the permission.
A dedicated endpoint is the nuance people skip. It may be enough. Isolation, a contractual region, no training on your prompts, and a named list of who can open a trace can satisfy a residency rule without you operating a GPU. It does not satisfy a rule that says you must hold the weights, and it does not survive a support process that uploads a prompt bundle to a different tenant. Read those clauses. Do not treat “dedicated” as a synonym for on-premises. The deployment table keeps them in different rows for that reason.
A VPC or private link is a network description. It can sit in front of any of the three contracts. It does not tell you who snapshots the disk. If the security review’s only artefact is a peering diagram, send it back. Ask for the operator and the log store.
Personal data makes this a legal question as well as a design question. The GDPR regulates processing of personal data in the European Union, including when that data is transferred. This page does not say which transfer tool applies to your prompts, and it does not say that self-hosting completes a transfer assessment. Counsel reads the regulation. You show them every hop, including the self-hosted ones that leave via telemetry. UK and India context is on the sovereign AI hub, with the same refusal to give advice.
Air-gap is the strict end of self-hosting, not the default. If you need it, the update path is an import, described on the deployment page. Pricing an air-gap as if it were a normal cloud GPU, with the registry still reachable, is how the claim and the bill diverge.
Decision prompts, not scores.
When
Then
Counsel has allowed this data class to a named vendor
An API can be the design. Do not self-host to decorate a permission you already have.
The rule is a region and an access list, and a vendor will sign both
Price a dedicated endpoint beside self-hosting. It may meet the rule with less of your ops.
The rule is that you operate the weights and the logs
Self-host, and then audit the copies. The GPU invoice is not the audit.
Only some fields are restricted
Do not send the whole prompt to the strictest path by habit. Split the classes. That is the hybrid section.
The hybrid pattern
Hybrid means more than one contract in production, on purpose, with a rule for which prompt may use which. The usual useful pattern is: a path you operate for the data class that must not leave, and an API for traffic that may leave and that your GPUs should not be sized to absorb. A router in front does the split. The router is part of the system. If it fails open into the API, you do not have a hybrid. You have an API with a local decoration.
Split on data class and on task, not on a vibe about difficulty. A narrow extract over a restricted document stays on the box you operate even if a larger API would score higher, until someone changes the rule. A long, unrestricted summarisation can go to the API even if you could run it locally, when the break-even says the GPU would sit idle the rest of the week. Write the classes in a table the gateway enforces. A prompt that mixes a restricted identifier with an unrestricted question is a restricted prompt. Mixing is how hybrids leak.
The spill path needs a number. How many requests may leave, of which class, under which failure. A capacity spill that sends the restricted class out when the GPU queue is long has undone the residency rule at the busiest moment, which is when you will notice least. Fail closed, or queue a person, for the class that must not leave. Spill is for the class you already allowed.
Cost the hybrid as a sum, not as a discount. You pay the always-on GPUs for the local class, the API for the spilled class, and the people who keep the route table true. The local box does not get cheaper because some tokens went elsewhere, unless you actually shrink it. Teams delete the API column once any traffic is local, then meet the API invoice later. Keep both columns.
Routing a small model and a large model is a different hybrid, about size rather than operator. You can combine them: a small model you host for the narrow class, a large API for the wide class, or two models on the same estate. The size decision is SLM versus LLM. Do not let it substitute for the operator decision. A small model on a shared API is still an API.
Evaluation has to cover the route. Unused examples tagged with the class they belong to, checked for which contract answered, and scored for whether the answer was allowed to be produced there. A quality win on the API model is not a win if that example was not allowed to leave. Record the route in the log policy you already accepted.
Latency, lock-in and the exit
Latency is a constraint you measure, not a prize the API or the GPU wins by category. A nearby API can beat a distant GPU you operate. A local box can beat an API once the queue is yours to schedule. Time to first token and total time move differently, and retrieval may dominate both. Bring the budget in the unit a person feels, then measure the path you will ship, including the gateway. We will not supply the milliseconds.
Lock-in is real on both sides. An API locks you to a tariff, a model name that can change under you, and a prompt format. Self-hosting locks you to an engine, a driver, a template and a team. Weights you can reload are portable only across engines that accept that format. A compiled engine from one library is not a portable weight. Write the artefact you could hand to a second operator. If the answer is “nothing, the vendor holds it”, you are on an API, whatever the invoice says.
Quality lock-in is subtler. If your only baseline is one vendor’s hosted model, you cannot tell whether a self-hosted checkpoint failed the task or merely failed to imitate that vendor. Keep the unused examples in your own store, scored against the job, not against a vendor transcript you are not allowed to retain. The fine-tuning page is what you do when behaviour, not location, is the gap.
What we will not conclude for you
We will not say self-hosting wins at a stated token volume. The volume is the output of your prices and your GPU count. Publishing someone else’s break-even would be a borrowed number with our name on it.
We will not say the API is less private in every design. A careless self-host leaks through logs. A careful dedicated endpoint can be the control you needed. The sentence that is always true is narrower: you do not get residency from the word self-hosted, and you do not get an operator from the word private.
We will not recommend a GPU, a cloud, or an engine on this page. The deployment essay names engines as categories you might operate, without a speed table. Bring hardware you can already support, or a quote you can already explain.
Run the method before the meeting
Before anyone argues from a blog, fill four lines. Tokens in and tokens out for a month you recognise, not a hoped-for quarter. The API price you would sign, dated. The GPUs, the hours, the hourly price, and whether failover is in that count. The ops figure or an explicit zero. Put the first and the third into the cost planner. Add ops beside the result. If throughput is unknown, say the self-hosted column is a floor on the bill of the machines, not proof you can serve the tokens.
Then answer the residency line in a sentence a reviewer can check. Which classes may leave, which contract receives them, where logs go. If the sentence is “everything stays because we self-host”, it is not finished. Name the log store.
If both sums and the sentence exist, the meeting can choose. If they do not, the meeting can only choose a slogan. Bring the slogan back as a hypothesis and run the method. The deployment plan is the next document once the contract is chosen, because a break-even is not a gateway, a rollback or an on-call rota.
Sources
Regulation (EU) 2016/679 (GDPR) (Official Journal). The GDPR regulates processing of personal data in the European Union, including the rules that apply when personal data is transferred.
Questions we hear first
Is a self-hosted LLM always cheaper once volume is high?
No. High volume on an always-on box can beat a token tariff, and it can also force more GPUs, redundancy and ops until it does not. Recompute both sums at your volume. A break-even copied from another tariff is not your volume.
Is self-hosting more private than an API?
Only for the copies you actually kept. Weights on your GPU do not cover logs, backups, evaluation sets or a fallback API. A dedicated endpoint with a written access rule can be stricter than a careless self-host. List the copies.
What is a dedicated endpoint, if it is not self-hosting?
The vendor still operates the weights. The contract adds something the shared API did not: isolation, a region, a staff-access rule, a commit, or several of those. Read which. It is not on-premises, and it is not automatically enough.
How do we calculate the break-even without a published GPU price?
Use your price. API cost is your tokens times your price per million. Self-hosted cost is GPUs times your hourly price times hours powered, plus ops you choose to count. The inference cost planner multiplies the two hardware and token terms. Break-even is where your sums meet, while adding tokens does not add GPUs.
Where does utilisation go in the formula?
It explains idle time on a box you keep powered. It is not a second multiplier on an always-on bill. If you pay only for busy hours, utilisation is how you turn a measured throughput into those hours. Do not apply it twice.
Can one product use a self-hosted model and an API together?
Yes, if a gateway routes by data class, the class that must not leave cannot spill open, and you cost both columns. A local model that times out into a shared API is one design only when that class was allowed to leave.
Does fine-tuning change this comparison?
It can change which checkpoint you self-host, and it adds a training cost the inference planner excludes. It does not move a hosted base into your building. If the prompt still goes to an API, you are still on the API side of this page.
Start with one task and a written scope.
Bring the workflow, the constraints and where inference should run. We use that brief to decide whether sovereign LLM & SLM fine-tuning, retrieval or a readiness review is the right first step.