A self-hosted LLM is worth it in two cases. The first is when your prompts hold data that must not leave servers you control. The second is when you send so many requests that a server running all month costs less than paying per request. On price alone it seldom beats a small hosted model. A cloud server with one 16 GB graphics card costs about US$384 a month at list price before it answers a single question. So the main reason to host your own LLM is where the data goes, not the bill.
Below: what you actually run, the two bills side by side, the hardware sums, the privacy side, and a step-by-step way to try it without wasting a month.
What is a self-hosted LLM?
An LLM (large language model) is the kind of model behind chat assistants. A self-hosted LLM is an open-weight model running on a machine you control. "Open-weight" means the publisher lets you download the model's weights, the large file of learned numbers that is the model. The machine can be a server in your own cloud account, a rented GPU server or a box in your office.
You download the weights once. An inference server loads them and answers requests over your own network. ("Inference" just means running the model to get an answer.) Nothing you send reaches a model company, because no model company is in the path.
The setup has three parts:
- The model. An open-weight model such as Qwen3, Mistral Small, Llama 3.1, Gemma 3 or gpt-oss. Bigger models usually write better and need more memory.
- The inference server. The software that loads the model and answers requests. llama.cpp runs on almost anything, from a laptop to a GPU server. Ollama is a quick way to get models running on one machine.
- The machine. A GPU server for real traffic. A laptop is enough to test whether a model can do your job at all.
Inference servers such as llama.cpp answer in the same request format as the OpenAI API. So an app that already calls a hosted model often needs only a new address and a new model name. With llama.cpp installed, this line downloads a small model and starts that kind of server on your own machine:
llama serve -hf ggml-org/Qwen3.5-0.8B-GGUF
Which models can you run on your own server?
Start with the licence. It decides whether you may use the model in a product at all. These are the licences the model cards on Hugging Face named on 2 November 2026. (A "parameter" is one of the learned numbers inside the model, so the count is a rough measure of its size.)
| Model | Size | Licence named on its model card |
|---|---|---|
| Qwen3-8B | 8 billion parameters | Apache 2.0 |
| Llama 3.1 8B Instruct | 8 billion | Llama 3.1 Community License |
| Gemma 3 12B | 12 billion | Gemma |
| gpt-oss-20b | about 21 billion | Apache 2.0 |
| Mistral Small 3.1 | 24 billion | Apache 2.0 |
Apache 2.0 is a standard open licence that allows commercial use. The others come with their publisher's own terms. Read them, and keep a copy with your project, before you build a product on the model.
Is a self-hosted LLM cheaper than an API?
Only at high, steady volume. Your own server costs the same for every hour it is on, busy or idle. An API costs nothing when nobody asks and a small amount for every request. So the answer depends on how many requests you send.
Here is one example request, priced from list prices read on 2 November 2026: 1,500 tokens in (a question plus a page of your own documents) and 300 tokens out (a short answer). A token is a small piece of text, roughly part of a word, and APIs charge by the token. Swap in your own numbers.
The server bill
Two single-GPU servers from Microsoft's public price list, in its East US region, on Linux, paid as you go:
| Server | GPU and its memory | Per hour | All month (730 hours) |
|---|---|---|---|
| NC4as T4 v3 | one NVIDIA T4, 16 GB | US$0.526 | about US$384 |
| NC24ads A100 v4 | one NVIDIA A100, 80 GB | US$3.673 | about US$2,681 |
The same price list has lower spot prices too (spare capacity sold cheaper, which the cloud can take back). The monthly figure is what you pay with the server switched on all the time, and a live chat feature needs exactly that.
The API bill for the same work
Anthropic's price page lists these prices per million tokens:
| Hosted model | Input | Output | The example request |
|---|---|---|---|
| Claude Haiku 5.5 | US$0.10 | US$0.50 | US$0.0003 |
| Claude Sonnet 5.5 | US$2 | US$10 | US$0.006 |
Where the two bills cross
Divide the server's monthly cost by the price of one request. The result is the number of requests at which the server becomes the cheaper option:
| Server against hosted model | Requests a month to break even | About this many a day |
|---|---|---|
| T4 server against Haiku 5.5 | 1,280,000 | 42,700 |
| T4 server against Sonnet 5.5 | 64,000 | 2,100 |
| A100 server against Sonnet 5.5 | 447,000 | 14,900 |
The second row looks tempting. It only holds if a model that fits on a 16 GB card does your job as well as Sonnet does, and on hard writing and reasoning work it usually does not. Test it on your own task. Run the same 50 real requests through the open model and the hosted one, and compare the answers before you compare the bills.
The cost in people's time
Someone has to run the server. They apply security updates, watch the queue, move to a newer model when one comes out and fix the server when it stops at night. That is engineering time every month, and it belongs in the sum. At common engineering rates, ten hours a month can cost about as much as the T4 server itself.
What hardware do you need to run your own LLM?
Memory decides what fits. A model's weights take its number of parameters times the bytes each parameter is stored in. At 16-bit precision each parameter takes 2 bytes.
Quantisation stores each parameter in fewer bits, so the model gets smaller. llama.cpp supports 1.5-bit up to 8-bit. That cuts the memory a model needs and speeds up its answers. Check the answers again at the setting you pick, because fewer bits can change them.
| Model size | 16-bit | 8-bit | 4-bit |
|---|---|---|---|
| 8 billion parameters | 16 GB | 8 GB | 4 GB |
| 24 billion | 48 GB | 24 GB | 12 GB |
| 70 billion | 140 GB | 70 GB | 35 GB |
That is the weights alone. The model also needs room for the text it is working on, and that grows with longer prompts and with more people asking at once. So leave space on the card.
Two examples. An 8 billion parameter model at 4-bit runs on the 16 GB T4 with room to spare, while the same model at 16-bit would fill it. A 70 billion parameter model at 4-bit fits on the 80 GB A100, and at 16-bit it needs two of them.
Can you test on a laptop first?
Yes, and it is the cheapest step in the whole project. llama.cpp treats Apple silicon as a first-class target and runs on ordinary processors too. So a laptop with 16 GB of memory can run a small model at 4-bit. It will be slower than a GPU server, and that is fine here: the test checks whether the answers are good enough on your own tasks, not how fast they come.
Is a self-hosted LLM more private than an API?
First, two terms. An on-premise LLM runs on machines in your own building. A self-hosted one can also sit in your own cloud account. Either way, your prompts, your documents and the model's answers stay on machines you control, and no model company receives a copy. Hosted APIs publish their own terms on how they store and use what you send, but the data still leaves your network to reach them.
The catch is that the privacy work moves to you along with the server. You decide who can call the model, what gets logged and for how long, and who can read the backups. A self-hosted model with an open port and every prompt logged forever is less private than a well-run API.
So put the server on a private network, keep logs short and write down where every prompt goes. Then you can answer a client who asks.
Which part of your system should you host yourself?
You rarely need to host everything. Find the step where the sensitive data first enters your system, and host the model that works on it. That is often a small model that is cheap to run, while the LLM further along can stay hosted.
On an exam platform we built for a coaching institute, the speech-to-text model runs on the institute's own server. It runs on an ordinary processor with no graphics card, one recording at a time, and no recording goes to a model vendor. The scoring step after it sends only the text to a hosted model, and a teacher approves every grade it drafts. The speech-to-text pipeline write-up shows the code and the trade-offs, including that a small model on a processor is less accurate on strong accents than the best hosted one.
The same split works for many businesses. A small model on your own server reads the contract or the customer file and takes out the names and numbers. The hosted model only sees what is left.
When a hosted API is still the better buy
- Your volume is low or comes in bursts, so a server would sit idle most of the month.
- You need the best quality on hard writing, coding or reasoning, and no model that fits your budget matches it.
- Nobody on your team will look after a server at three in the morning.
- You are still finding out whether the feature is worth building at all.
In those cases start on the API. Keep your prompts in a format any OpenAI-style server can answer, so moving later stays a small job.
How to host your own LLM, step by step
Work through the steps in this order, and you will not spend a month on the wrong model:
- Write down the job. Pick one task, such as summarising support tickets or answering from your own documents. Collect 50 real examples and the answers you would accept.
- Test open models on a laptop. Run two or three models from the licence table through your 50 examples. Keep the smallest one that passes.
- Size the server from the memory sum. Add the weights at your chosen precision, the room for the text in flight and the number of people asking at once.
- Serve it on a private network. Run the inference server with no public port. Put your own API in front of it and point your app at its address.
- Log what you need and nothing more. Record request counts, response times and errors. Keep prompt text out of the logs unless you have a reason to keep it.
- Compare a month of bills. Put the server, the hours spent on it and the hosted API price for the same traffic side by side. Then decide whether to keep it.
Quick answers
Is a self-hosted LLM cheaper than using an API?
Only at high, steady volume. In the worked example above, a one-GPU server at about US$384 a month breaks even with a small hosted model at roughly 42,700 requests a day. Below that the API costs less, and the server still needs someone to run it every month.
What GPU do you need for a self-hosted LLM?
It depends on the model's memory. Multiply its parameters by the bytes each one takes. An 8 billion parameter model needs about 4 GB at 4-bit and 16 GB at 16-bit, before room for the text it is working on. A 16 GB card runs small models, and a 70 billion parameter model at 4-bit needs about 35 GB.
What is the difference between on-premise and self-hosted?
An on-premise LLM runs on hardware in your own building. Self-hosted is the wider term: the model runs on any machine you control, which can be your own cloud account or a rented server. In both cases your prompts and documents stay on machines you control.
Is a self-hosted LLM as good as a hosted model?
It can come close on narrow, repeated tasks such as sorting tickets, pulling fields from documents or answering from your own files. On hard writing, coding and reasoning, the largest hosted models usually stay ahead of anything that fits on one affordable server. Test both on 50 of your own real requests before you decide.
Originally published on Boffin Coders. If you would rather have a private LLM planned, built and looked after for you, see private LLM deployment.
Top comments (0)