Self-hosted
Local LLM inference server (Ollama / vLLM)
vLLM for throughput or Ollama for simplicity, one GPU, and LiteLLM in front as the gateway that issues per-team keys and records spend. The endpoint other recipes point at.
- Source
- Editorial recipe — no step evidence has been fetched yet
- Verified
- Evidence not verified
- Confidence
- Low
01Objective
Stand up an OpenAI-compatible model endpoint on your own hardware that other applications, scripts and staff tools can call, with keys and usage under your control.
- use caseLocal LLMRunning an open-weight model on hardware you own — a workstation, a GPU server, a laptop. The question is usually which model fits the memory you have and how many people can use it at once.
- use casePrivate LLMUsing a language model without your data leaving a boundary you control — a country, a cloud region, or your own network. The constraint is where processing happens and who can see the prompts, not which model runs.
Field notes about this recipe
02Recommended stack
| Role | Component |
|---|---|
| Gatewayoptional | LiteLLM |
| Inferenceoptional | Ollama |
| Inference | Qwen2.5-14B-Instruct or Qwen3-32B, quantised to fit the card |
| Inference | vLLM |
Architecture and data flow
Components
- Internal applications and scripts — people
- LiteLLM gateway (keys, quotas, spend log) — network, optional
- OpenAI-compatible API — application
- PostgreSQL (gateway keys and spend) — database
- vLLM (or Ollama) — inference server
- Open-weight model, quantised to fit — model
- GPU server — hardware
Connections
- Internal applications and scripts to LiteLLM gateway (keys, quotas, spend log) — HTTPS (confidential data)
- LiteLLM gateway (keys, quotas, spend log) to OpenAI-compatible API — reverse proxy (confidential data)
- OpenAI-compatible API to PostgreSQL (gateway keys and spend) — chats, users, settings (personal data)
- OpenAI-compatible API to vLLM (or Ollama) — prompt (confidential data)
- vLLM (or Ollama) to Open-weight model, quantised to fit — loaded weights
- Open-weight model, quantised to fit to GPU server — GPU memory
- vLLM (or Ollama) to GPU server — GPU memory
External data transfer · NONE
DashedOptional — not included in the cost or the hardware sizing: LiteLLM gateway (keys, quotas, spend log).
- No edge in this design crosses out of the company network.
- Model weights are downloaded once from Hugging Face at setup.
- No prompt or completion leaves the network unless a hosted model is added to the gateway — which is a decision, and should be a visible one.
03Suitable for
- Organisation size
- 1–500 employees
- Data classes
- confidential, personal, public
- Constraints
- at least one application that needs a model endpoint; a GPU sized for the model you intend to serve; a place to run containers and someone to keep them running
- Industries
- Technology, Professional services, Financial services, Other
- Jurisdictions
- any
04Hardware
On-premise single 24 GB GPU server
- GPU
- NVIDIA RTX 4090 24 GB (or NVIDIA L4 24 GB for a rack-mounted, 72 W alternative)
- VRAM
- 24 GB
- System RAM
- 64 GB
- Storage
- 2000 GB
- CPU
- 16-core x86 server CPU (AMD EPYC 7003/9004 or Intel Xeon Scalable)
- Form factor
- Tower server
Indicative costUS$4,000 – US$9,000
indicative build cost for the complete machine, USD, Aug 2026 — verify with a local supplier
The default box for a 20–60 person firm. Fits a 14B model at 4-bit with roughly 8 GB of KV cache left for concurrent chat, or an 8B model at fp16. NVMe storage sized for the model cache plus a document corpus and its embeddings. Add a UPS and an offsite backup target — this machine holds the whole knowledge base.
Cloud GPU instance — 1 × NVIDIA L4 24 GB
- GPU
- NVIDIA L4 24 GB (AWS G6, Azure NVadsA10/NCads equivalents, GCP G2)
- VRAM
- 24 GB
- System RAM
- 64 GB
- Storage
- 1000 GB
- CPU
- 8–16 vCPU
- Form factor
- Cloud instance
Indicative costUS$1 – US$2
indicative on-demand rental, USD per hour, Aug 2026 — verify against the provider price list for your region
The private-cloud counterpart of `onprem-small-24gb`: same model sizes, no capital outlay, and a region you choose explicitly. Running it continuously for a year usually costs more than buying the equivalent box, so it suits pilots, bursts and firms without a server room. The cloud provider becomes a data processor — a DPA and a documented region are required.
On-premise single 48 GB GPU server
- GPU
- NVIDIA L40S 48 GB (rack) or NVIDIA RTX 6000 Ada 48 GB (office workstation)
- VRAM
- 48 GB
- System RAM
- 128 GB
- Storage
- 4000 GB
- CPU
- 24–32-core x86 server CPU (AMD EPYC or Intel Xeon Scalable)
- Form factor
- Rack server
Indicative costUS$12,000 – US$22,000
indicative build cost for the complete machine, USD, Aug 2026 — verify with a local supplier
The step up when answer quality matters more than price: a 32B model at 4-bit with generous KV cache, or a 14B model at fp16 with a long context. ECC memory and a standard 2U chassis mean it belongs in a rack or comms room rather than under a desk.
Apple Silicon workstation (unified memory)
- GPU
- Apple M4 Max (up to 128 GB unified) or M3 Ultra (up to 256 GB unified)
- VRAM
- 96 GB
- System RAM
- 128 GB
- Storage
- 2000 GB
- CPU
- Apple M4 Max / M3 Ultra
- Form factor
- Workstation
Indicative costUS$4,500 – US$12,000
indicative build cost for the complete machine, USD, Aug 2026 — verify with a local supplier
Quiet, standard-socket power draw, and a large memory pool — about 75% of installed unified memory is addressable by the GPU, which is where the 96 GB figure comes from on a 128 GB M4 Max. Memory bandwidth, not capacity, sets the ceiling: excellent for a pilot, a partner workstation or a single heavy user, weak for 40 people at once. Runs Ollama, llama.cpp and MLX; does not run CUDA builds of vLLM.
Indicative costUSD · one-off plus monthly
- Software licences
- All components are open source and self-installed. Check each licence for use limits.
- US$0
- Model usage
- Open weights served locally: no per-token charge. The GPU cost sits under infrastructure.
- US$0
- GPU server (24–48 GB class)
- Spans onprem-small-24gb to onprem-medium-48gb — indicative build cost, Aug 2026, verify locally. A cloud L4 instance is the rental equivalent of the lower end.
- US$4,000 – US$22,000
- Implementation (2–6 FDE-days)
- 2–6 FDE-days at US$760–1940 per day, converted from the HK$6,000–15,000 band at the HKMA Linked Exchange Rate band of HK$7.75–7.85 to one US dollar. One-off; excludes internal staff time.
- US$1,520 – US$11,640
- One model served, one gateway, no user interface.
- Excludes the applications that call the endpoint — they are separate work.
- Every figure is an assessment from the inputs listed, not a quotation.
05Difficulty
2 / 5
A few days, mostly configuration
06Skills
- Dockerdocker
- infrastructure
- Linuxlinux
- operations
- LLM inferencellm-inference
- ml
- MLOpsmlops
- operations
- Networkingnetworking
- networking
- Security hardeningsecurity-hardening
- security
07Deployment steps
Commands are copied from each project’s own documentation, and the page they came from is linked under the step. 0 of 6 steps currently open an evidence record. The rest are linked to their source; §10 says which of those documents were fetched and which were fetched without their anchor being found — two different states, named differently there.
- 01
Size the model against the GPU before installing anything
AssessmentWork out weights, KV cache and overhead for the model, context length and concurrency you expect. A 14B model at 4-bit needs roughly 7 GB of weights; the KV cache at 8k context for ten concurrent requests adds several more. Decide the quantisation now — it changes which card you need and how the answers read.
- 02
Start vLLM as an OpenAI-compatible serverversion-sensitive
AssessmentvLLM "can be deployed as a server that implements the OpenAI API protocol", starting on port 8000 by default. Run the official image with the GPU attached and the Hugging Face cache mounted so restarts do not re-download the weights.
docker run --runtime nvidia --gpus all \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=$HF_TOKEN" \ -p 8000:8000 \ --ipc=host \ vllm/vllm-openai:latest \ --model Qwen/Qwen3-0.6Bfrom the vLLM docs — substitute your model
vllm serve Qwen/Qwen2.5-1.5B-Instructthe same thing without Docker
- 03
Or start Ollama, if simplicity matters more than throughputversion-sensitive
AssessmentOllama supports "Nvidia GPUs with compute capability 5.0+ and driver version 550 and newer". One container, a named volume, and `ollama run` to pull a model. Expect lower concurrency than vLLM on the same card.
docker run -d --gpus=all -v ollama:/root/.ollama -p 11434:11434 --name ollama ollama/ollama - 04
Put a key on the endpoint
AssessmentAn unauthenticated inference server on an office network is a shared GPU for anyone who finds it. vLLM accepts `--api-key` or the `VLLM_API_KEY` environment variable and will accept any of several keys, which is what makes rotation possible without downtime.
- 05
Add a gateway when more than one application calls the modelversion-sensitive
AssessmentLiteLLM brings up "the gateway on port 4000 and a Postgres database that stores your models, keys, and spend logs". Issue a virtual key per team or application so usage can be attributed, and so revoking one does not disturb the others.
curl -sSL https://docs.litellm.ai/docker-compose.yml | docker compose -f - up -d - 06
Measure before you promise anything
AssessmentRecord tokens per second at one, five and twenty concurrent requests, and watch GPU memory while you do it. That table is what tells you whether the model, the quantisation or the card has to change — and it is the evidence for the next hardware conversation.
08Compliance considerations
Structured issue-spotting to support your own review — not legal advice. Verify against the cited primary sources and your counsel.
Applies everywhere
Security · Model accesshigh
The endpoint is the control point. Require a key, bind it to the internal network, and keep a record of which application holds which key — otherwise "who sent that prompt" has no answer.
Logging · Prompt leakagemedium
Gateway logs can contain full prompts and completions, which means they can contain personal and confidential data. Decide deliberately whether to log bodies, and apply the same retention rules to those logs as to the source documents.
Open-source licensingmedium
Serving a model is a use of the model licence as well as the server licence. Check the model card for field-of-use or user-count conditions before serving it to the business.
09Alternatives
llama.cpp or LocalAI
Run on CPU or mixed CPU/GPU where no suitable card exists, or on a workstation where the model has to share memory with everything else.
- — Runs almost anywhere
- — Much lower throughput; fine for one user, not for a team
A hosted OpenAI-compatible endpoint
When the workload is spiky and the data allows it, a managed endpoint removes the GPU problem entirely — at the price of sending prompts to a provider.
- — No hardware, instant capacity
- — Prompts leave your network: DPA, region and retention terms apply
No alternative recipe is published yet.
10Evidence
Not yet in the ledger
not yet fetched
not yet fetched
not yet fetched
- Ollama — Docker
Docs
not yet fetched
not yet fetched
not yet fetched
11Community
Deployed this stack, or hit something this page does not cover? Corrections, sources and implementation reports are what keep a recipe worth reading.
Improve this page
Sign in to contribute
From the field
0 deployments · 0 questions
Nobody has reported deploying this here yet, and no question has been opened against this page. Both appear once a reviewer accepts them.
12Hire an FDE
If you would rather not build it, we can introduce a forward-deployed engineer who has deployed this stack before. The enquiry form starts from this recipe.