Self-hosting an LLM is worth it when traffic is steady, an open model meets your quality bar and you have staff to run it. For low or bursty traffic, an API is usually cheaper. On October 2026 AWS prices, one 8 x H100 server running Llama 3.3 70B matches Amazon Bedrock on compute at about 1.6 billion tokens a day.

An illustration of one server that serves people at laptops by day and takes a conveyor of document stacks at night, so it stays busy around the clock.

Is self-hosting an LLM cheaper than an API?

Only when the GPUs stay busy. The cost trade-off between self-hosted and managed LLM inference is variable spend against fixed capacity. A pay-per-token API turns every token into a bill and charges nothing when idle. Self-hosting turns GPUs and staff into a fixed monthly cost.

Cost factorPay-per-token APISelf-hosted
How you payPer input and output tokenPer GPU hour or owned hardware, plus staff
Cost when idleNothingThe full capacity cost
Cost as traffic growsRises in line with tokensFlat until a GPU is full, then a step up
Engineering effortIntegration onlyDeployment, scaling, monitoring, upgrades, on-call
Data pathRequests go to the providerRequests go to servers you run
Model choiceThe provider's catalogueAny open-weight or custom model you can run

How do you compare self-hosted and API cost?

Start with one workload, not the whole AI budget. Pick a specific endpoint such as document extraction, support drafting or code review. Record four weeks of traffic if you can.

Collect these inputs:

  • Daily input and output tokens, and request count by hour.
  • Prompt-cache hit rate, retry rate and failure rate.
  • Required model quality, P95 latency and availability target.
  • Data residency or privacy constraints.

Do not average workloads together. That hides a strong self-hosting candidate next to a bursty one that belongs on an API. Then calculate both sides as cost per successful request. The API side is a token sum.

API cost = input tokens x input rate + output tokens x output rate + tool and service charges.

Add retries and fallback calls. Input and output rates can differ, so check both.

The self-hosted side is a capacity sum divided by the work it serves.

Monthly platform cost = GPU hours + CPU and memory + storage + network + software + operations.

Cost per successful request = monthly platform cost / successful production requests.

Idle GPUs raise this figure, because fewer requests share the same monthly cost. Higher utilisation lowers unit cost until queueing or latency forces you to add capacity.

How do you compare a GPU you own with an API bill?

If you buy the hardware, count its price spread over its useful life, plus power, hosting and staff time. Set that against how busy the box really is, not its peak capacity. Compare cost per successful task over a few months, as in LLM cost per task.

Many chat apps resend the conversation on every turn, so an API bill grows with the tokens sent. Prompt caching bills reused input tokens at a lower rate. As of October 2026, OpenAI says prompt caching is on by default for supported models, with a reduced rate for cached input tokens. Anthropic prices cache reads at 0.1 times base input for most models and charges more for cache writes.

On a self-hosted vLLM server, automatic prefix caching reuses the processed chat history for later turns. It only speeds up prompt processing (prefill), not generating new tokens. So measure your cache hit rate on both sides before comparing.

What hidden costs change the answer?

The GPU bill is the easy part. People and headroom can change the answer as much.

  • Engineering and on-call time. Model rollout, autoscaling, monitoring, driver compatibility, security updates and incident response.
  • Idle headroom. You size for peak traffic and your availability target, not the average.
  • Evaluation and upgrades. Each new model or engine version needs testing on your own prompts.
  • Exit and switching. On an API, tuned prompts take effort to move. On hardware you own or commit to, the commitment can outlast the workload.

Include all of these in the monthly platform cost. Counting only GPU hours against token prices favours self-hosting unfairly.

When does self-hosting break even? A worked example

On public AWS prices, one 8 x H100 server running Llama 3.3 70B costs the same as Bedrock for that model. That happens at about 1.6 billion tokens a day. That covers compute only. It is not a price quote, and it ignores staff, storage and network.

InputValueSource
API priceLlama 3.3 70B on Amazon Bedrock, US East (N. Virginia): $0.72 per 1M input tokens and $0.72 per 1M output tokens. Batch: $0.36 per 1MAmazon Bedrock pricing, AWS price list dated 6 October 2026
GPU pricep5.48xlarge, 8 x H100, US East (N. Virginia): $47.757 per hour effective rate. Sydney is listed at the same rateEC2 Capacity Blocks for ML pricing, checked 8 October 2026

Our arithmetic:

  1. GPU cost for 30 days, using the Capacity Block rate as a monthly proxy: $47.757 x 720 hours = $34,385.04.
  2. Tokens the API would bill for the same money: $34,385.04 / $0.72 per million = about 47.8 billion tokens a month.
  3. That is about 1.59 billion tokens a day, or about 18,400 tokens per second, around the clock.

Self-hosting wins on compute only if real traffic averages about 18,400 tokens per second, around the clock. One server must also serve it at your quality and latency targets. This counts input and output tokens together, so your input to output ratio changes how hard that target is. Measure throughput with your own prompts and engine settings. Staff and hidden costs push break-even higher.

The batch rate moves the line further. At $0.36 per million tokens, the same $34,385.04 buys about 95.5 billion tokens a month. That is about 3.2 billion tokens a day. If your work can wait for batch results, the API stays cheaper for longer.

AWS says Capacity Blocks prices are next scheduled to update in January 2027. Capacity Blocks are one purchase option. On-demand, reserved or owned hardware gives a different figure.

Why can't the crossover be one token number?

The API bill scales with tokens, while the GPU bill is mostly fixed. When a GPU hits a latency or memory limit, another replica adds a step to the cost curve.

The 1.6 billion figure comes from one model, one price list and one instance type. A different model, cache hit rate, GPU, purchase model or headroom target gives a different answer. Update the cost model quarterly, or when prices change.

How do you raise GPU utilisation for LLM inference?

If you pay for GPUs around the clock (owned, reserved or a capacity block), move work that can wait into the hours when they would otherwise sit idle. A server sized for the office-hours peak is often quiet at night and on weekends, so the monthly cost is spread over less work.

Compute cost per token is the monthly cost divided by tokens served. With a fixed monthly cost, a server serving half the tokens it could costs twice as much per token on compute.

Extraction backlogs, evaluation runs and classification jobs can often wait. Running them in hours you already pay for, instead of on extra capacity or an API, lowers compute cost per successful task. See LLM cost per task.

If you pay for GPUs around the clock, move work that can wait, such as extraction backlogs, evaluation runs and classification jobs, into off-peak hours when they would otherwise sit idle, and keep daytime latency within target.
  1. Measure tokens served and GPU utilisation by the hour for four weeks.
  2. List the jobs that can wait until off-peak hours.
  3. Schedule them through a queue that runs only when interactive traffic is low.
  4. Re-measure utilisation and cost per successful task.

Batch jobs must not push daytime latency past your target. Bedrock's batch rate for Llama 3.3 70B is $0.36 per million tokens against $0.72 (US East, October 2026). Compare your off-peak cost with an API's batch rate, not its standard rate.

Is cost the only reason to self-host?

No. Data control and model choice can matter as much as price. The OAIC says this about control: "Deploying a system locally or on premises is likely to be more privacy-preserving as it limits the risks of third party access to the data" (OAIC guidance).

The same guidance does not rule out the cloud. For cloud deployments, it says "it will be necessary to consider" security and privacy risks, including where servers are located.

So privacy can justify self-hosting even when the token maths favours an API. Check it against your own obligations.

Model choice is the other reason. Self-hosting lets you run any open-weight or custom model and pin its version. An API limits you to the provider's catalogue.

When should you use an API, self-hosting or both?

Keep a workload on an API when it is small, variable or needs a proprietary model. Evaluate self-hosting when traffic is steady and an open model passes your evaluation. If your portfolio has both kinds, use both. If finance is weighing the choice, our guide to AI capex vs opex explains how buying GPUs and paying per token usually show up in the accounts.

A hybrid design assigns workloads rather than picking one provider for everything. Steady or sensitive requests run on private infrastructure. An API handles rare reasoning tasks, experiments, bursts or a fallback. Hybrid adds policy and observability work, so it does not automatically save money.

For lessons on running many models on private GPUs, read 4 lessons from a 50-model private GPU cluster. To compare platforms, see self-hosted inference platforms compared. For a wider cost model, see sovereign AI vs cloud TCO.

Our 18-minute webinar Open models, explained compares the three ways to run an open model: a managed API, dedicated GPUs or your own servers.

How Xinference fits

Xinference is an AI inference platform for enterprise teams. It runs open and custom models behind one OpenAI-compatible API in your own environment, whether that is your VPC, your data centre or your servers. You choose the serving engine for each model when you deploy it.

The Model API is a per-token option hosted in Australia. As of October 2026, DeepSeek V4.1 Flash is $0.30 input and $1.20 output, per 1M tokens. As of November 2026, GLM-5.3 is $1.40 input and $4.40 output (see pricing). It is an API option too, so the same utilisation test applies. Per-token pricing suits traffic that would leave a GPU idle. Every deployment option uses the same API, so moving a workload between them is a base URL change. See Dedicated Inference, the comparison pages and pricing.

Our Sovereign AI TCO Guide builds the cost model step by step. See also Open models or commercial APIs?

Sources: Amazon Bedrock pricing (AWS price list dated 6 October 2026), EC2 Capacity Blocks pricing (checked 8 October 2026), OpenAI, Anthropic and vLLM caching docs (as of October 2026), and OAIC guidance.

Questions

Is it worth it to self-host AI for a small team?

Usually not for cost alone. Small or uncertain traffic leaves GPUs idle, and an API charges nothing when unused. Self-host when privacy or model control matters and someone can run it.

How much does it cost to self-host an LLM?

One 8 x H100 Capacity Block at $47.757 an hour costs about $34,385 for 30 days, before staff, storage and network. Source: AWS, checked 8 October 2026.

When does self-hosting an LLM break even?

In the example above, at about 1.6 billion tokens a day against Llama 3.3 70B at $0.72 per million tokens. Batch pricing doubles that, and staff costs push it higher.

How do I raise GPU utilisation on a self-hosted LLM server?

Measure tokens served and utilisation by the hour, then queue work that can wait, such as extraction, evaluations and classification, for off-peak hours. Keep daytime latency within target.

Does prompt caching change the self-hosting maths?

It can change both sides. OpenAI and Anthropic bill cached input tokens at a lower rate, and vLLM prefix caching speeds up prompt processing. Measure your cache hit rate on each side first.