← all articles

Self hosting an open model vs. paying per token: the real cost math

Every few months someone on a team asks the same question: “we’re spending a lot on API calls, shouldn’t we just run our own model?” It’s a fair question. It’s also usually asked by someone who hasn’t priced out a GPU box or thought about who’s on call when it falls over. Let’s actually work through it.

The pitch versus the reality

The pitch sounds clean: rent or buy a GPU, download an open weights model, stop paying per token, done. No more watching a bill scale linearly with usage.

The reality is that per-token pricing and self-hosting are two completely different cost shapes. API pricing is variable cost: you pay for exactly what you use, and it scales with traffic. Self-hosting is mostly fixed cost: you pay for the GPU whether it’s serving one request a minute or sitting idle at 3am, and then you layer usage-driven costs like power and bandwidth on top of that. Comparing them is a matter of “at what volume does the fixed cost stop being wasted”, not “which is cheaper.”

That crossover point is the entire question, and it depends on your actual request volume, not on vibes about how much you’re spending.

What actually costs money when you self-host

Start with the model itself. Model size determines VRAM, and VRAM determines what hardware you need. A model’s parameters at fp16 take roughly 2 bytes per parameter to hold in memory, so a 7B model needs somewhere around 14GB of VRAM just to load, before you add the KV cache for whatever context length you’re serving. A 70B model at fp16 needs somewhere around 140GB, which puts it outside a single consumer GPU and into multi-GPU or datacenter territory.

Quantization changes this math. Running the same 70B model at 4-bit roughly quarters the memory footprint, which is why quantized GGUF or AWQ versions of open models are so popular for self-hosting: they let a 70B-class model fit on hardware that would otherwise only handle something in the 13B to 30B range. The tradeoff is a hit to output quality that varies by model and quantization method, and you should expect to test that hit yourself on your own tasks rather than assume it’s negligible.

Once you know the VRAM requirement, you’re choosing between renting GPU instances by the hour from a cloud provider, or buying hardware outright. Renting means your bill is proportional to uptime, which is good if load is bursty and bad if you need the model available around the clock, since an idle GPU instance still bills you for every hour it’s reserved. Buying means a big upfront cost, plus you now own depreciation, power draw, cooling, and the fact that GPUs are the component most likely to be obsolete or in demand for resale in two years.

Then there’s inference software. Running a raw model checkpoint isn’t the same as running a production endpoint. You need a serving layer, something like vLLM, TGI, or llama.cpp’s server mode, configured for batching, concurrent requests, and whatever context length your app needs. Each of these has its own tuning surface, and getting throughput anywhere close to what the hardware is theoretically capable of takes real setup work, not a default config.

How the math changes with usage volume

Here’s the part that actually decides the outcome, and it’s simpler than people expect: per-token API pricing is a per-request cost, and self-hosted GPU rental is a per-hour cost regardless of how many requests you push through it in that hour.

Say your GPU rental runs you a flat rate per hour, and it’s on continuously. That’s a fixed monthly number no matter what. Your API alternative charges per million tokens processed. As your request volume climbs, the API bill keeps climbing linearly, but the self-hosted bill stays flat, because you already paid for the hour whether you used 5% of its capacity or 95%.

That means self-hosting looks worse than the API at low volume, because you’re paying full price for a GPU that’s mostly idle. It starts looking better as volume rises, because you’re now spreading that same fixed hourly cost across more and more tokens. Somewhere in between is a break-even point, and where that point sits depends entirely on your actual GPU rate and your actual token volume, both of which you should plug into your own spreadsheet rather than take from a blog post. The shape of the tradeoff is the useful part: fixed cost against idle capacity, versus variable cost against usage.

This is also why the answer is “at your volume, which side of the crossover are you on”, not “self-hosting is cheaper” or “APIs are cheaper,” full stop.

The hidden costs nobody puts in the spreadsheet

The GPU line item is the easy part to estimate. The parts people underprice are the ones that don’t show up until week three.

Uptime is one. An API provider is dealing with failover, redundancy, and load balancing as their whole business. If you self-host on one box and it dies at 2am, that’s now your incident, and someone on your team is the page-out contact.

Scaling is another. Per-token pricing absorbs a traffic spike for you automatically, at a cost, but automatically. A self-hosted box has a hard ceiling on concurrent requests, and past that ceiling you’re either queuing users or standing up a second instance, which means load balancing, which means more infrastructure than “we bought a GPU.”

Model upgrades are a quieter cost. When a better open model ships, moving to it on your own infrastructure means re-testing your prompts, re-validating output quality, possibly re-tuning your serving config for the new architecture, and redeploying. Switching API providers or model versions behind a hosted endpoint is often a one-line config change on their side, sometimes literally nothing on yours.

And someone has to own all of this. Patching the serving stack, watching GPU utilization, rotating logs, handling driver updates. That’s an ongoing time cost, not a one-time setup cost, and it doesn’t show up in a GPU rental price at all.

When self-hosting actually wins

Self-hosting makes the most sense when you have sustained, predictable, high volume that keeps the GPU busy most of the time it’s running, so you’re not paying for idle capacity. It also makes sense when your data can’t leave your infrastructure for compliance reasons, in which case cost comparison is secondary to the fact that a hosted API isn’t an option at all. It’s also worth it if you need a fine-tuned model that doesn’t exist as a hosted product, since you’re paying for the infrastructure either way to serve a custom checkpoint.

When it doesn’t

Low or spiky traffic is the clearest case against it, because you’re paying full fixed cost for a GPU that spends most of its time waiting. Small teams without dedicated infrastructure time are another, because the ops burden of keeping an inference server healthy is real work that competes with whatever you’re actually trying to ship. And if you need the newest, largest closed models for quality reasons, self-hosting isn’t even on the table, since the open models available to run yourself are a different tier of capability, not a drop-in swap.

A rough way to decide

Work out your GPU cost per hour for hardware that fits your model’s VRAM needs, multiply by the hours you’d realistically run it, and compare that fixed number against what your current token volume actually costs you on your API bill for the same period. If the API bill is already higher than the fixed GPU cost, and your volume is steady rather than spiky, self-hosting is worth a real pilot. If the API bill is lower, or your traffic is unpredictable, the GPU is going to sit there costing you money on requests that never come. Run the numbers with your own rates before you commit hardware or a headcount’s worth of ops time to it.

If you want more breakdowns like this on the actual mechanics behind AI tooling costs, not vendor talking points, check out AI Tool Gazette.

for builders
Running agents or scrapers at scale?

AI pipelines that crawl, research, or automate the web hit rate limits and geo-blocks fast. Singapore Mobile Proxy runs real 4G/5G mobile IPs that carriers still trust.

see plans →
read on
More from the Gazette

Tool reviews, model and pricing news, and build guides for people shipping real things with AI.

browse all articles →