Skip to content
Agent Month

Self-hosted LLMs: when it pays off, and how

Last verified: July 2026· LLM cost

"Should we self-host?" is one of the most common questions we get, and it is usually asked too early. Open-weight models are genuinely good and free to download, which makes running your own inference sound like an obvious cost win. It rarely is at low volume. Self-hosting swaps a variable per-token bill for a fixed cost you pay whether the GPUs are busy or idle, and it hands you an operations problem — serving, scaling, batching, observability — that the API provider was quietly solving for you. This guide covers the honest tradeoff, the cases where self-hosting actually wins, what it really costs, and how to deploy one if you decide to.

Self-hosted LLMs: when it pays off, and how
ImageFile:Rear of rack at NERSC data center - closeup.jpgbyDerrick Coetzee from Berkeley, CA, USACC0 1.0tinted
Utilisation
the break-even variable
fixed GPU cost only wins when GPUs stay busy
Fixed vs per-token
the core swap
you trade one cost shape for the other
Ops
the hidden line item
serving, scaling, and observability you now own
Open-weight model
download the weights, free to run
Your GPUs (cloud/on-prem)
serve · batch · scale
Your app
private, no per-token
Self-hosting replaces the hosted API's per-token meter with GPUs you operate — the weights are free, the infrastructure and its idle time are not.

Hosted API vs self-host: the actual tradeoff

A hosted API charges you per token and absorbs everything behind it: the GPUs, the serving stack, autoscaling, batching, uptime, and every model upgrade. You pay only for what you use, and when traffic is zero the bill is zero. That elasticity is the entire value proposition, and it is exactly what you give up when you self-host.

Self-hosting means downloading an open-weight model and running inference on GPUs you rent in the cloud or own on-prem. The weights cost nothing. The GPUs cost the same whether they serve a million requests an hour or sit idle overnight — that is the crux. You are converting a variable per-token cost into a fixed capacity cost, and fixed cost only wins when you keep the capacity busy.

So the decision is not "which is cheaper" in the abstract — it depends entirely on your utilisation and your constraints. Below a break-even level of steady traffic, the API is both cheaper and dramatically less work. Above it, or when a hard requirement rules the API out, self-hosting starts to make sense. Everything else in this guide is about finding which side of that line you are on.

When self-hosting actually wins

Compliance and data residency. The clearest case has nothing to do with cost. If regulation or contract requires that data never leaves your infrastructure or a specific jurisdiction, a hosted API may simply be off the table. Self-hosting gives you a private LLM where prompts and outputs stay inside your network — sometimes the only reason that matters.

High, steady volume. If you run large, predictable inference load around the clock, per-token pricing adds up while a saturated GPU does not. Past a break-even utilisation, owning or renting the hardware and keeping it busy costs less than metering every token. The keyword is steady: bursty or low-average traffic wastes the capacity you are paying for.

Customisation and control. Self-hosting lets you fine-tune on your own data, pin a specific model version so behaviour never shifts under you, and control latency by placing inference close to your workload rather than depending on a shared endpoint. If deep customisation or predictable latency is core to your product, that control can justify the operational cost on its own.

The real costs and risks

GPU economics. Whether you rent in the cloud or buy on-prem, GPUs are the dominant cost, and you pay for the capacity, not the usage. On-prem is capex plus power, cooling, and hardware refresh; cloud rental is opex that can quietly exceed API spend if utilisation is low. Either way, the meter runs while the GPU is idle.

Idle waste. This is where self-hosting projections go wrong. Break-even math assumes near-full utilisation, but real traffic has peaks and troughs. Provision for the peak and you waste capacity in the trough; provision for the average and you fail at the peak. That gap between provisioned and used capacity is pure loss, and it is the single most common reason a self-hosting business case that looked cheaper on paper isn't.

Inference operations. The API provider was running a serving stack, autoscaling, request batching, and observability on your behalf. Self-host and you own all of it: standing up a serving engine, batching requests for throughput, scaling under load, monitoring latency and failures, and keeping the whole thing up. That is real engineering time, ongoing.

Keeping current. Open-weight models improve constantly. A hosted API upgrades transparently; self-hosted, you carry the work of evaluating new releases, re-testing, and migrating — plus the model and hardware selection decisions every time the landscape moves. Standing still means slowly falling behind.

How to actually deploy one

Pick the model and the hardware together. These are one decision, not two. The model's size in memory determines the GPU you need, and the GPU you can get determines which models are realistic. Choose the smallest open-weight model that clears your quality bar on your actual tasks — capability you do not use is capacity you overpay for.

Use quantization to fit. Quantization stores the model's weights at lower numerical precision, shrinking its memory footprint so it fits on smaller or fewer GPUs, usually with modest quality loss. It is the standard lever for making a model economical to serve — but the tradeoff is real, so validate quality on your own evals after quantizing, not before.

Serve with batching. Do not call the model one request at a time. A proper inference server groups concurrent requests into batches so the GPU processes many at once, which is what turns raw hardware into throughput. Batching, continuous batching, and sensible concurrency limits are the difference between a GPU earning its cost and sitting half-idle under load.

Instrument everything. You now own the numbers the API used to show you: latency, throughput, GPU utilisation, queue depth, and error rates. Without this observability you cannot tell whether you are past break-even or quietly wasting capacity — which is the whole question. Treat monitoring as part of the deployment, not an afterthought.

A decision framework

Start on a hosted API and optimise it first. Routing each request to the cheapest adequate model, caching repeated work, and batching offline jobs will cut a hosted bill substantially — often enough that the self-hosting case evaporates. Do this before you price a single GPU; it is faster, cheaper, and reversible.

Then ask two questions. First: does a compliance or data-residency requirement forbid the API? If yes, self-host — the decision is made for you and the economics are secondary. Second: is your volume high and steady enough to clear break-even utilisation? Estimate honestly, using peak-versus-average, and be skeptical of projections that assume a GPU stays busy.

If neither answer is a firm yes, stay on the API. Self-hosting is a real engineering commitment — hardware, serving, ops, and a treadmill of model upgrades — and it only rewards teams whose volume or constraints genuinely demand it. When both answers are yes, deploy deliberately: right-size the model, quantize to fit, batch to serve, and instrument so you can prove the machine is actually earning its cost.

How to decide and deploy a self-hosted LLM

  1. 1
    Step 1

    Optimise the hosted API first

    Before pricing any hardware, apply routing, caching, and batching to your existing API usage. This often cuts the bill enough that self-hosting is unnecessary, and it gives you a real cost baseline to beat.

  2. 2
    Step 2

    Check for a hard constraint

    Determine whether compliance, data residency, or contract requires that data never leave your infrastructure. If it does, self-hosting is decided regardless of cost — proceed to deployment.

  3. 3
    Step 3

    Estimate break-even utilisation

    Model your real traffic, peaks and troughs included, against fixed GPU cost versus per-token pricing. Self-host only if steady volume keeps the GPUs busy enough to beat the API; be honest about idle time.

  4. 4
    Step 4

    Pick model and hardware together

    Choose the smallest open-weight model that passes your evals, and match it to a GPU that fits it in memory. Use quantization to lower precision and shrink the footprint, then re-validate quality on your own tasks.

  5. 5
    Step 5

    Stand up a batching inference server

    Deploy a real serving engine that groups concurrent requests into batches for throughput, with sensible concurrency limits and autoscaling for load. One-request-at-a-time serving wastes the hardware you are paying for.

  6. 6
    Step 6

    Instrument and hold the line

    Monitor latency, throughput, GPU utilisation, and error rates so you can prove you are past break-even. Budget ongoing time to evaluate new model releases and migrate, since open-weight models move fast.

Frequently asked questions

Is self-hosting an LLM cheaper than an API?

Only above a break-even level of steady utilisation. Self-hosting converts a per-token bill into a fixed GPU cost you pay whether the hardware is busy or idle, so it is cheaper only when you keep the GPUs saturated. At low or bursty volume the hosted API is both cheaper and far less work. The model weights are free; the GPUs and the operations around them are not.

What is an open-weight model?

A model whose trained weights are published for download, so you can run inference on your own GPUs rather than calling a provider's endpoint. Open-weight models are the foundation of self-hosting — running them yourself is what makes a private, on-your-infrastructure deployment possible.

What does quantization do, and does it hurt quality?

Quantization stores the model's weights at lower numerical precision, shrinking its memory footprint so it fits on smaller or fewer GPUs and costs less to serve. There is usually some quality tradeoff, typically modest, so you should validate on your own evaluation set after quantizing rather than assuming the loss is negligible.

When should we self-host instead of using an API?

When a compliance or data-residency requirement forecloses the hosted API, or when your inference volume is high and steady enough to clear break-even utilisation, or when deep fine-tuning, version pinning, or latency control is core to your product. If none of those hold, stay on the API and optimise it.

What's the hidden cost people miss when self-hosting?

Two things: idle capacity and inference operations. GPUs cost the same whether busy or idle, so any gap between provisioned and used capacity is pure waste — which is why bursty traffic breaks the business case. On top of that you now own the serving stack, batching, autoscaling, observability, and the ongoing work of evaluating and migrating to new model releases that a hosted API handled for you.