Private AI
Self Hosted AI: What It Takes to Run Your Own
Checked 2026-10-31
Loading poll...
Self-hosted AI means you run an open-weight model on hardware you control and send prompts to your own endpoint, not to a vendor. The fastest start is Ollama on a laptop. A team usually moves to a GPU server running vLLM. The real decision is whether the privacy or the volume justifies the work, and we checked the numbers on 31 October 2026.
The short version
Question | Short answer |
|---|---|
What do I run? | An open-weight model, such as gpt-oss or Qwen, through a runtime |
Which runtime for one person? | Ollama (MIT licensed) or LM Studio |
Which for a shared server? | vLLM (Apache 2.0) |
What hardware? | Enough memory to hold the weights plus the context cache |
Is it private? | Prompts stay on your machine; the rest is your network setup |
Is it cheaper? | Only at steady volume, or when data cannot leave |
Is it as good as a frontier API? | Not on hard multi-file work; |
If you want the step-by-step install, our guide on how to self-host an LLM has the commands. This page is the decision layer that sits above it: what the pieces are, what they cost and where people get stuck.
What "self-hosted" covers
People use the word for three different setups, and the costs differ a lot.
- A machine on your desk. A laptop or workstation runs the model for you. Nobody else uses it. Cost is hardware you already own.
- A server your team shares. One box with one or more GPUs sits in an office or a rack. Several people send requests at once. Cost is the hardware plus someone's time.
- A rented GPU you manage. You rent a GPU by the hour from a cloud, install the runtime yourself and keep the weights. Cost is an hourly rate. This is self-hosting in the sense that you choose and control the software, but the hardware belongs to someone else. See Runpod and Lambda Cloud.
A fourth thing is often confused with these: a hosted API that serves open models, such as Groq or Cerebras. You do not run anything there. We cover the difference in cloud vs self-hosted AI.
The pieces of a self-hosted stack
Model weights
Open-weight means the trained parameters are published for download. They come with a licence you should read. For example, OpenAI's gpt-oss models are listed on Ollama with an Apache 2.0 licence, which the model page describes as permissive, with no copyleft restrictions. Qwen3-Coder from Alibaba is also listed for local use. Always read the licence file on the model's page before a commercial rollout, since terms differ between families. Our open vs closed models page covers that choice.
A runtime
The runtime loads the weights and answers requests. Three are common.
Runtime | Licence | Best at | Platforms |
|---|---|---|---|
Ollama | MIT | One-command install, local use, many integrations | macOS, Windows, Linux, Docker |
vLLM | Apache 2.0 | Serving many requests on a GPU server | Linux; NVIDIA, AMD, Intel; Apple through a community plugin |
llama.cpp | MIT | Fine control, many backends, small footprint | CUDA, Metal, Vulkan, SYCL and more |
The vLLM docs say it does not support Windows natively and point Windows users to WSL. Ollama's hardware page lists Nvidia GPUs from compute capability 5.0 up, AMD cards through ROCm and Vulkan, and Apple GPUs through Metal. The llama.cpp README lists Apple silicon as a first-class target, with CUDA, HIP, Vulkan and SYCL backends.
For a longer side-by-side, read Ollama vs vLLM and llama.cpp vs Ollama.
An API your tools can call
All three expose an OpenAI-style HTTP API. Ollama listens on port 11434 and vLLM on port 8000 by default. That means most chat front ends, agent frameworks and coding tools can point at your server by changing a base URL and a dummy key. Ollama also documents an Anthropic-compatible endpoint, which is how it connects to Claude Code.
A network setup
By default Ollama binds to 127.0.0.1, so only your own machine can reach it. The moment you widen that, you are running a service that needs a proxy, TLS and authentication. Ollama's local server has no login step. vLLM can check a key if you pass --api-key. Treat the port like a database port.
How much hardware you need
Weights take roughly parameters times bytes per parameter. A 4-bit build uses about half a byte per parameter. Add room for the context cache, which grows with the conversation and with the number of parallel requests.
Published sizes from the Ollama library show the real numbers:
Model | Listed size | Context | Note from the model page |
|---|---|---|---|
gpt-oss 20B | 14 GB | 128K | Runs on systems with as little as 16 GB of memory |
gpt-oss 120B | 65 GB | 128K | Fits a single 80 GB GPU |
Qwen3-Coder 30B | 19 GB | 256K | Mid-size coding model |
Qwen3-Coder 480B | 290 GB | 256K | Needs a minimum of 250 GB of memory or unified memory |
The gpt-oss figures work because OpenAI post-trained the models with the mixture-of-experts weights in MXFP4, about 4.25 bits per parameter, per the model page. That is why a 120B model fits an 80 GB card. Our GPU requirements for LLMs page goes through VRAM by size and quantisation in more detail.
A practical reading: a modern laptop with 16 to 32 GB of memory runs a 20B-class model for one person. A single 80 GB GPU handles a 120B-class model. Anything near 480B is a multi-GPU or large unified-memory machine, and at that point renting is usually more sensible than buying.
What it costs
You pay in one of three ways.
Hardware you own
A workstation GPU is a one-off purchase plus power and your time. The break-even depends on what you would otherwise spend on API calls. Our worked example in how to self-host an LLM shows a case where $400 a month of API spend and a $3,000 machine needs about 22 months to pay back. Those are example figures, not quotes. The pattern is the useful part: at modest API spend, owning rarely wins on cost alone.
A GPU you rent
Prices checked on 31 October 2026:
Provider | GPU | Price per hour |
|---|---|---|
Runpod Community | H100 SXM | $2.69 |
Runpod Secure | H100 SXM | $3.99 |
Lambda | 1x H100 SXM | $4.29 |
Modal (per second) | H100 | about $3.95 |
Runpod Secure | A100 | $1.79 |
Runpod Secure | RTX 4090 | $0.89 |
Some links on this page go through /go/ and may earn us a fee; it never changes our order. For a worked monthly comparison of these providers, see Runpod vs Lambda, Modal vs Runpod, and the interactive hosting compare.
An example, with volumes we chose for illustration: an H100 at $3.99 an hour, run for 8 hours a day over 22 working days, is 176 hours, or about $702 a month. Left on all month it is about $2,913. The gap is why renting works for part-time or bursty use and gets expensive when idle.
A hosted API instead
Hosted open-model APIs charge per token and have no idle cost. Groq lists gpt-oss-120b at $0.15 per million input tokens and $0.60 per million output tokens. Cloudflare Workers AI lists the same model at $0.35 and $0.75. At low and medium volume this beats any server you run, which is why cloud vs self-hosted is a volume question first.
Privacy and data control
What you gain by self-hosting is simple to state. Prompts and outputs never leave your network unless you send them. There is no vendor retention policy to read, no training-use clause, and no third-party outage to wait out.
Ollama's FAQ says it runs locally and does not see your prompts or data when you run locally. It also sells cloud models now, and for those it says it processes prompts and responses to provide the service but does not store or log that content and never trains on it. The same FAQ says you can run Ollama in local-only mode by disabling its cloud features. If privacy is the reason you are here, turn that off and confirm it.
What you take on in return:
- Access control for the port, and a log policy you write yourself.
- Patching the runtime, the driver and the host.
- Provenance of the weights. Download from the publisher's own page or repository, and check the hash if one is given.
- Backups of anything you fine-tune.
Self-hosting removes one risk, the vendor, and adds another, your own operations. Whether that trade is good depends on who is operating it.
Coding agents on a self-hosted model
Several coding agents can point at a local endpoint. Ollama's own docs describe ollama launch claude, ollama launch codex and ollama launch opencode, and tell you to give Claude Code, Codex and OpenCode a context window of at least 64k tokens. Cline's page asks for at least 32K. We cover each agent's configuration in local coding agent with Ollama and self-hosted AI coding assistant. The agents themselves are listed under AI coding agents.
Be honest about quality. Open models of this size are improving, but long tasks that touch many files are where a local 20B model most often loses to a frontier API. Try your own tasks before you commit a team.
Limits and gotchas
- Default context is small. Ollama picks a default from VRAM: 4k under 24 GiB, 32k from 24 to 48 GiB, 256k at 48 GiB or more, per its docs. A coding agent that reads files needs more than 4k.
- Memory spills silently. When a model does not fit the GPU, Ollama splits it across GPU and CPU.
ollama psshows the split, and speed drops. - One model at a time on vLLM. A vLLM server hosts one model per process by default.
- Concurrency is a setting. Ollama's
OLLAMA_NUM_PARALLELdefaults to 1, and memory needs scale with it. - Upgrades change behaviour. Runtimes and model files move fast. Pin versions for a team.
Who should self-host
You are | Our take |
|---|---|
A developer who wants to try open models | Install Ollama today; it costs nothing but disk space |
A small team with private code | One GPU box with vLLM or Ollama behind a proxy |
A regulated business | Self-host, or use a provider with a contract that covers data terms; see on-premise AI |
A startup with light usage | A hosted API first; revisit when the bill is steady |
Someone who wants the best coding quality | A frontier API, and a local model as a fallback |
Mistakes we see in plans for self-hosted AI
Most failed rollouts trace back to the same few choices, and all of them can be avoided on paper before any money is spent.
Buying hardware before measuring demand. Teams often size a server for the model they wish to run, not the one they need. Count how many people will send requests at the same moment, because concurrency, not headcount, sets the GPU memory you need. One person chatting uses the model in bursts. A coding agent that loops through tool calls keeps it busy for minutes at a time.
Ignoring the context cache. Weights are the number everyone quotes. The key-value cache is the number that breaks the plan. Ollama's FAQ ties required memory to context length and parallel requests together. Double the context and the cache roughly doubles, so a model that fits at 8k can fall off the GPU at 64k.
Treating the port as private because it is inside the office. A flat office network, a VPN with many users and a shared Wi-Fi are all places where an open inference port gets used by people you did not plan for. Put authentication in front of it from day one.
Skipping a fallback. Hardware fails and drivers break after updates. Decide in advance whether the team falls back to a hosted API, to a rented GPU, or simply waits. If the data is the reason you self-host, the fallback has to respect the same rule, so write that down.
Expecting one model to do everything. A small fast model is right for autocomplete and quick questions. A bigger one is right for planning and review. Many teams run two models and route by task. That is a cost question as much as a quality one, and it is easy to test with a few days of real prompts.
Our take
From the documented facts, self-hosting is a good fit when one of two things is true. Either your data may not leave, or your volume is high and steady enough that a fixed machine beats per-token billing. If neither holds, the engineering time usually costs more than the API. If one holds, start small: a single machine, one runtime, one model, and a clear owner. Add a second server only when the first is busy.
We have not run a head-to-head test of local and hosted models for this page, so we make no claim about relative output quality beyond what the vendors state.
A first-week plan
- Pick one use case, for example a private chat for the team or a coding agent.
- Install Ollama on a machine that meets the memory figure for a 20B-class model, and pull one model.
- Set the context length for the use case, then check with
ollama psthat the model sits fully on the GPU. - Decide who may reach the port. Keep localhost unless you need more, and put a proxy in front if you do.
- Run real prompts from your own work for a week and note where it fails.
- Only then price a server. Use the figures above, and your own usage, in the hosting compare.
Related pages
Questions
What does self-hosted AI mean?
It means the model runs on a machine you control, a laptop, an office server or a rented GPU you manage, and your prompts go to that machine instead of a vendor's API.
Do I need a GPU to self-host AI?
Not for small models. Ollama's docs say it can fall back to system memory, though responses get slower. Shared use by several people usually needs a GPU server.
Is self-hosted AI cheaper than an API?
Only at steady, high volume, or when the data cannot leave. At low volume a hosted API is usually cheaper once you count your own time.
Which runtime should I start with?
Ollama for one machine and a quick start. vLLM for a shared GPU server. llama.cpp when you want the engine itself and fine control.
Loading poll...