Insights · 28 November 2026

Self-Hosted LLM: Hardware, Real Costs, and When an API Wins

A self-hosted LLM runs on hardware you control. See the GPU memory each model size needs, what you pay for, and when a pay-per-token API is the better choice.

A self-hosted LLM is a large language model that runs on servers you control, either your own machines or your own cloud account, instead of being called through OpenAI's or Anthropic's API. It is worth it when your data cannot leave your network, or when you send large, steady volumes of text through a model every day. For most businesses with modest or unpredictable usage, a pay-per-token API is still the better choice, because self-hosting swaps a usage bill for hardware, setup and ongoing maintenance.

The hardware rule fits in one line. At 4-bit quantization (a compression method explained below), you need about 0.5 GB of GPU memory per billion parameters. A 70 billion parameter model therefore needs roughly 35 GB.

Self-hosted LLM at a glance

Question Short answer
What it is An open-weight model running on infrastructure you control
Main reasons to do it Data privacy, cost at high steady volume, fine-tuning, less vendor lock-in
Memory rule About 0.5 GB of GPU memory per billion parameters at 4-bit
Smallest useful setup A 7B to 8B model in 4 to 6 GB of GPU memory (RTX 3060 or RTX 4060), 30 to 50 tokens per second
Common sweet spot A single RTX 4090 with 24 GB, running quantized models
70B models 35 to 40 GB of GPU memory: dual RTX 4090 or an A100, 7 to 12 tokens per second
Software to start with Ollama for testing, vLLM for production traffic
Licence fees Many models use Apache 2.0 or MIT, which allow commercial use without fees. Some do not
Cost model Hardware or GPU rental, plus power and staff time, instead of per-token billing
When an API wins Low or spiky volume, no one to run the servers, or you need the strongest model available

The hardware figures come from Prem AI's 2026 self-hosting guide. The model sizes and licences come from Onyx's self-hosted LLM leaderboard, last updated in October 2026.

What "self-hosted" means, in plain terms

A few terms come up constantly, so here they are once.

  • Parameters are the numbers inside a model that hold what it learned. A "70B" model has 70 billion of them. More parameters usually means better answers and more memory needed.
  • Open-weight means the company that trained the model has published those numbers, so you can download and run the model yourself. GPT-oss, Llama, Gemma, Mistral and DeepSeek models are examples.
  • Inference is the act of running the model to get an answer. When people talk about hosting costs, they mean inference costs.
  • Tokens are chunks of text, roughly parts of words. APIs bill per token. Speed is measured in tokens per second.
  • VRAM is the memory on a graphics card (GPU). It is the single constraint that matters most.

Prem AI's guide sets out three ways to use a model. An API, where the model runs on the provider's cloud and you pay per token, with minimal setup. A managed platform, which runs in the provider's cloud or your own virtual private cloud on a subscription or usage basis. And self-hosting, where it runs entirely on your infrastructure, your data stays local, and setup effort is high.

How much GPU memory you need

The model has to fit in VRAM. If it does not, the system falls back to the main processor (CPU), which Prem AI puts at 10 to 100 times slower.

Quantization is what makes self-hosting practical. Models are usually published at 16-bit precision, which takes 2 bytes per parameter. Quantization stores each parameter in fewer bits, at some cost in accuracy. At 4-bit it takes about 0.5 bytes per parameter, so the model needs about a quarter of the memory. A 70B model drops from 140 GB to about 35 GB.

Prem AI's hardware table:

Model size VRAM needed (4-bit) Example GPUs Typical speed
7B to 8B 4 to 6 GB RTX 3060, RTX 4060 30 to 50 tokens/sec
13B 8 to 10 GB RTX 4060 Ti 16GB 20 to 35 tokens/sec
32B to 34B 16 to 20 GB RTX 4090, RTX 3090 12 to 20 tokens/sec
70B 35 to 40 GB Dual RTX 4090, A100 7 to 12 tokens/sec

Beyond the GPU, plan for 16 GB of system RAM at minimum (32 GB recommended) and a fast NVMe solid-state drive, because a quantized 70B model file is 35 GB or more. A modern CPU can run a model with no GPU at all, but expect single-digit tokens per second. That is fine for testing and impractical for real use.

Do not compress too far. A Towards Data Science guide to agent workloads recommends staying at a 4-bit level called Q4_K_M or higher. Below that, tool calls and structured output such as JSON start to break, which matters if the model drives an automated workflow.

In the cloud, the same guide finds the best balance of cost and performance in Nvidia's L4, L40S and A100 GPUs. The L40S has 48 GB of VRAM, enough for a 70B model at 4-bit. Its advice is not to move up to the H100 unless you need it.

Which models fit which hardware

Onyx's leaderboard lists two memory figures for each model. They line up with the 4-bit and 16-bit rules above. A selection:

Model Parameters VRAM at 4-bit VRAM at 16-bit Licence
Gemma 4 12B (Google) 12B 6 GB 24 GB Apache 2.0
GPT-oss 20B (OpenAI) 20B 11 GB 40 GB Apache 2.0
Mistral Small 3.1 24B 14 GB 48 GB Apache 2.0
Gemma 4 31B (Google) 31B 16 GB 62 GB Apache 2.0
Llama 3.3 70B (Meta) 70B 38 GB 140 GB Llama License
GPT-oss 120B (OpenAI) 117B 62 GB 234 GB Apache 2.0
MiniMax M2.7 230B 115 GB 460 GB Non-commercial
DeepSeek R1 671B 351 GB 1340 GB MIT
Kimi K3 (Moonshot) 2.8T 1400 GB 5600 GB Kimi K3 License

Three things stand out.

First, the useful middle band (12B to 31B) fits on a single consumer or workstation GPU. That is where most first deployments should start.

Second, the largest open models need hundreds of gigabytes or more of VRAM even when compressed. That means multiple data-centre GPUs. At that scale you are running a small cluster, not "a server."

Third, read the licence column. Apache 2.0 and MIT allow commercial use. MiniMax M2.7 is listed as non-commercial, and others carry their own custom licences. Prem AI's advice is to review each model's acceptable use policy before going to production.

The software: Ollama for testing, vLLM for production

You need an inference server, the program that loads the model and answers requests. Two names cover most cases.

Ollama runs a model with one command. It applies quantization automatically, works on macOS, Linux and Windows, and exposes an OpenAI-compatible API. That means code written for OpenAI can point at it with small changes. Its limit is concurrency, meaning how many requests it handles at once. Prem AI reports a default of about 4 parallel requests and a peak of around 41 tokens per second under load in Red Hat's benchmarks. That is good for one person or a prototype and not for a team.

vLLM is built for production traffic. In the same comparison it reached about 793 tokens per second under high concurrency. Setup is moderate rather than one command.

The OpenAI-compatible API is worth more than it looks. If you build your application against that interface from day one, you can start on a hosted API and move to your own server later without rewriting the application.

What a self-hosted LLM costs

None of the sources verified for this article publish GPU purchase prices, cloud GPU hourly rates or API per-token prices. We are not going to quote numbers that cannot be checked. Prices for both GPUs and APIs also change often enough that a figure from a blog would mislead you. Get both from the vendors' own pricing pages on the day you decide.

What we can give you is the full list of what you pay for, because that is what most cost comparisons leave out.

With an API, you pay for:

  • Tokens in and tokens out, at the provider's rate
  • Nothing when you are not using it

With self-hosting, you pay for:

  • GPUs, bought outright or rented by the hour from AWS, Azure or GCP
  • The rest of the machine: RAM, NVMe storage, networking
  • Power and cooling if the hardware is on your premises
  • Engineering time to choose the model, set up the server, secure it and connect it to your systems
  • Ongoing time for updates, monitoring, outages and moving to newer models

The comparison comes down to one point. API cost rises in a straight line with usage. Self-hosting cost is mostly fixed, whether the GPU is busy or idle. Self-hosting wins only when you keep that hardware busy. Prem AI puts the threshold at "millions of tokens daily" with "predictable, high-volume workloads." The Towards Data Science guide points to companies running 20 to 30 agents or more, or serving agents to customers at scale.

To compare for yourself, estimate your monthly tokens and multiply by your API rate. Then add up a month of GPU cost plus the engineering hours above. Do it for the volume you expect in a year, not just today.

When an API is still the better choice

This section matters more than the hardware tables. Most businesses that ask us about self-hosting should not do it yet.

Your volume is low or uneven. If your team uses AI for drafting, summaries or a support chatbot with modest traffic, your API bill is likely smaller than the cost of one GPU sitting idle most of the day. A rented GPU charges by the hour whether anyone sends a request or not.

You have no one to run it. A self-hosted model is a production system. It goes down, needs security patches, and needs someone who understands quantization, memory limits and inference servers. If that person does not exist on your team, the real cost is a hire or a contract, and that usually outweighs years of API usage.

You need the strongest models. The largest open models need hundreds of gigabytes of VRAM or more. If your task really needs that level of quality, renting it per token is the practical way to get it.

Your privacy concern can be solved by contract. Privacy is the most common reason to self-host. Prem AI cites Kong's 2025 report, in which 44% of organisations named data privacy and security as the top barrier to adopting LLMs. Before buying GPUs, check whether a business agreement with your API provider, or a managed platform running inside your own cloud account, already meets your rules. For many companies it does.

You need many users at once. Ollama's default of about 4 parallel requests is fine for one person. Serving a whole company needs vLLM or similar, proper hardware and load testing. This is a bigger project than the one-command demos suggest.

If any of these describe you, stay on an API. Build against the OpenAI-compatible interface so you can move later, and revisit the question when your monthly bill or your data rules change. The same rent-versus-run question applies to workflow tools, and we cover it in n8n pricing explained.

When self-hosting is the right call

Self-hosting makes sense when one of these is true and you can staff it:

  • Your data legally or contractually cannot leave your network, as with patient records, financial data or source code.
  • Your token volume is high and steady, typically from agents running all day. (If you are unsure what separates an agent from a chatbot, see AI agent vs chatbot.)
  • You need to fine-tune a model on your own data so a smaller model performs well on your specific task.
  • You need the model to work in an air-gapped environment with no internet connection.

Start small. Pick a model that fits comfortably on one GPU, test it against your real workload, and scale up only if the results fall short.

How Stackbinary helps

We build custom AI systems, so weigh what follows accordingly.

The hard part of a self-hosted LLM is rarely downloading the model. It is deciding whether you should self-host at all, choosing a model that does your actual task well enough, sizing the hardware or cloud setup on AWS, Azure or GCP, and connecting it to the tools your team already uses. After that comes keeping it running. Our work covers AI and machine learning, cloud migration and managed services, DevOps and SRE, and application security, so one team can handle the whole path, from first test to running system.

We will also tell you when the answer is an API. If your volume is low and your data rules allow it, that is the cheaper and simpler choice, and we will say so.

When a build does make sense, projects are scoped after a discovery call, and a written fixed-price proposal follows within 48 hours. You own the system and the data, you pay only for the features you use, and our team can run it for you. Tell us what you want the model to do.

Frequently asked questions

Is a self-hosted LLM worth it?

It is worth it if your data cannot leave your network, or if you process millions of tokens a day in a steady pattern. For low or uneven usage, an API is usually the better choice because you pay nothing when it is idle. You also need someone to run the servers, which is a real ongoing cost.

How much does a self-hosted LLM cost?

You pay for GPUs (bought or rented), the rest of the machine, power, and engineering time to set up and maintain it. The sources verified here do not publish GPU or API prices, so check current vendor pricing pages. The key difference is that API cost grows with usage while self-hosting cost is mostly fixed.

Can I run an LLM on my own computer?

Yes. A 7B to 8B model at 4-bit quantization needs 4 to 6 GB of GPU memory, which an RTX 3060 or RTX 4060 provides, at 30 to 50 tokens per second. Ollama runs one with a single command. Without a GPU, expect single-digit tokens per second.

What hardware do I need for a 70B model?

About 35 to 40 GB of GPU memory at 4-bit, which means two RTX 4090 cards, an A100, or a cloud GPU such as the 48 GB L40S. At full 16-bit precision the same model needs 140 GB. Speeds of 7 to 12 tokens per second are typical.

Are open-weight models free to use commercially?

Many are. Models under Apache 2.0 or MIT, such as GPT-oss and Gemma 4, allow commercial use without fees. Some do not: Onyx lists MiniMax M2.7 as non-commercial, and others use custom licences, so review each model's terms before production.


Figures from Onyx, Prem AI and Towards Data Science verified against their published pages in November 2026. Model releases, hardware and pricing change quickly, so confirm before you buy. Stackbinary builds custom AI systems, including the kind of deployment discussed here, and we have tried throughout to say plainly when an API is the better choice.