If your company moved its LLM traffic off a commercial API tomorrow, who would be paged at 3 a.m. when the inference server runs out of GPU memory? That question rarely appears in the spreadsheets engineering leads bring to budget meetings, and it is usually the one that decides whether self-hosting pays off.

We hear the self-hosting debate often from CTOs building teams in Lisbon and Porto. The GPU side of the comparison is easy to price: an hourly rate times the hours in a month. The people side is harder, because it depends on whether you already employ engineers who can run inference in production, how much of their time it takes, and what it costs to hire one if you do not.

In Portugal that cost has its own arithmetic, with 14 salary payments a year and employer social security on top. This piece builds the breakeven around the team, then walks through the edge cases where the usual answer flips.

What you are really buying when you self-host

An API invoice is a price per token, nothing more. The provider absorbs the hardware, the model updates, the scaling, the security patches and the on-call rota. When traffic doubles, the bill doubles; when a product is switched off, the bill goes to zero within a month.

A self-hosted model turns most of that into fixed cost. You pay for GPUs whether they are busy or idle, you need at least 2 of them if one failing should not take the product down, and you need people who can deploy an inference server, tune batching, watch latency, apply security updates and swap in a better open model when one appears. The token price of a self-hosted model is close to zero; the monthly price of keeping it alive is not.

So the breakeven is a volume. Below it, the API's variable cost is smaller than your fixed cost. Above it, the fixed cost is spread over enough requests that each one is cheaper than the API price. The two levers that move that volume most are the API price per request, which depends on your token mix, and the fixed monthly cost, which in many teams is dominated by engineering time rather than hardware. The calculator below makes both explicit.

A breakeven calculator that counts the people

The calculator works per request rather than per token, because that is how product teams think about traffic. It sizes the GPU fleet for your peak hour, adds a share of an engineer priced the way Portuguese payroll works, and searches for the monthly volume at which the two bills cross. All default values are illustrative.

The logic in plain words. API cost is requests times the token cost of one request. GPU count is the larger of your redundancy minimum and the number needed to serve the peak hour, where the peak hour is the average hour (requests divided by 730) times your peak multiple.

Engineering cost is the gross monthly salary times 14, because Portuguese employees receive holiday and Christmas subsidies as two extra monthly payments, plus 23.75 percent employer social security under the general regime, divided by 12 and multiplied by the share of time the work takes.

With the defaults, 2 million requests cost about 1,920 euros a month through the API. Self-hosting costs about 6,060 euros: 2,628 for two GPUs, roughly 3,030 for half an engineer and 400 for everything else. Half an engineer is more than the hardware.

Push the volume up and the calculator finds the first crossing at about 10.5 million requests a month, with 5 GPUs in the fleet. Change the capacity per GPU from 9,000 to 3,000 requests an hour and the breakeven disappears entirely, because each added GPU costs more per request than the API does. Measure that capacity on your own prompts before trusting any result.

The first crossing is fragile, and it is worth understanding why. GPUs come in whole units, so the self-hosted bill climbs in steps of about 1,314 euros each time the peak hour needs one more card.

Just past 10.5 million requests the sixth GPU is required and the API briefly becomes cheaper again; self-hosting only stays ahead for good from roughly 12 million. If your forecast lands near one of those steps, a small change in traffic shape decides the month. Treat the breakeven as a band of a few million requests, not a single line.

The salary input deserves the same caution. The default of 4,200 euros gross a month is an illustrative figure for an experienced engineer in Lisbon, not a market benchmark; senior people with production inference experience can cost noticeably more, especially if they are weighing remote offers from companies abroad. Run the calculator at your real offer level and at 20 percent above it, since that is roughly the range you may need to retain someone once they become the only person who knows how the stack works.

Edge cases that pull the breakeven down

Some situations make self-hosting pay off far earlier than the default numbers suggest. Each one changes a specific input.

You already run GPUs and an on-call rota. If a platform team in Lisbon already operates Kubernetes clusters with GPU nodes for other workloads, the marginal engineering share for one more model may be 0.1 FTE rather than 0.5. Set the FTE field to match and the breakeven can fall by more than half.

Your traffic is flat. Overnight batch jobs such as classifying the day's support tickets, enriching a CRM or scoring job applications have a peak multiple near 1. Every GPU hour is used, and the fleet is sized for the average instead of a spike three times larger.

A small fine-tuned model is good enough. If an 8-billion-parameter model fine-tuned on your data matches a large API model on one narrow task, the requests per GPU hour can triple, which moves the breakeven down sharply.

Contracts forbid third-party processing. Some clients in banking, insurance or the public sector write into their contracts that data may not leave infrastructure you control. Then cost is not the deciding factor, though it is worth checking whether a provider's regional or private deployment option meets the contract before buying hardware.

Edge cases that push it out of reach

Other situations keep the API cheaper long after a simple estimate says you have crossed the line.

Round-the-clock support needs a rota, not a fraction. If the model sits in a customer-facing product with an uptime commitment, someone must be reachable at night and at weekends. A humane on-call rota needs at least 4 people sharing it. Half of one engineer cannot provide that, and the true staffing figure is closer to a share of 4 salaries plus on-call allowances.

Hiring takes months. Experienced engineers who have run inference in production are scarce in Portugal, as elsewhere in Europe, and many of them work remotely for foreign companies at salaries above local averages. A search for one can take a quarter or more, and the API bill keeps running during that time. Add the search and onboarding period to the payback calculation.

Traffic is spiky. A consumer app with a peak hour 6 times the average needs twice the GPUs of the default case for the same monthly volume. Try setting the peak field to 6 and watch the breakeven move.

The API gets cheaper while you are not looking. Providers regularly cut prices and offer batch processing and prompt caching discounts, which can halve the cost of suitable workloads. A breakeven computed against last year's price list may already be out of date.

A decision tree for the build-or-rent call

Answer in order and stop at the first branch that ends.

  1. Does a contract or regulation require that data never leaves infrastructure you control, and no provider deployment option satisfies it? If yes, self-host and treat cost as a constraint to minimise. If no, continue.
  2. Is your monthly volume below the calculator's breakeven using your own measured capacity and peak multiple? If yes, stay on the API. If no, continue.
  3. Do you already employ engineers who run GPU workloads in production with an on-call rota? If no, continue to question 4. If yes, go to question 5.
  4. Can you fund and fill at least one dedicated hire, plus on-call cover, within the next 2 quarters? If no, stay on the API and revisit in 6 months. If yes, go to question 5.
  5. Does an open model you can run match the API model's quality on your own evaluation set? If no, stay on the API until one does. If yes, run a pilot on 10 percent of traffic for one month before migrating the rest.

Mistakes and a checklist before you commit

The mistakes we see most often in self-hosting business cases:

  • Pricing the engineer at 12 monthly salaries instead of 14, and leaving out employer social security, which understates the true employer cost by about 30 percent.
  • Using the vendor's maximum throughput benchmark as capacity, instead of throughput at your latency target with your prompt lengths.
  • Sizing GPUs for the monthly average, then discovering queues every weekday at 10 a.m.
  • Counting one GPU, with no redundancy, for a product that promises uptime.
  • Assuming the engineer who set it up will stay; if they leave, the knowledge often leaves with them.
  • Comparing against list API prices when the workload qualifies for batch or cached pricing.

And a short checklist before signing a GPU contract:

  • Measured requests per GPU hour on your own traffic at the target latency.
  • Peak multiple from at least 4 weeks of real logs.
  • Named owners for deployment, monitoring, upgrades and on-call, with their time share written down.
  • Total employer cost of each person, using 14 payments and social security.
  • A quality comparison on your own evaluation set, signed off by the product owner.
  • An exit plan: how quickly traffic can go back to the API if the self-hosted model fails.

Run the numbers with your own inputs and the answer will be clear for most volumes. The harder question sits underneath them: if open models keep getting smaller and API prices keep falling, will the engineers you would hire to run inference be worth more to your company building the product itself?