Skip to content

Architecture and migrationGuide

On-prem LLM: when to run models on your own hardware

Running language models in your own data centre is a capacity-planning problem before it is a model problem. When it is worth it, which serving engines to use, how to size memory, how to combine it with provider APIs, and what it really costs to operate.

By INFRO Editorial

Published

8 min read

Dark ground with a closed glass enclosure of stacked server nodes glowing amber inside, one thin amber line leaving it toward distant outside nodes

In short

Run an LLM on-prem when data must stay on your infrastructure, when a regulator or contract requires it, or when steady high volume keeps GPUs busy. Serve an open weight model with an engine such as vLLM or SGLang behind an OpenAI-compatible endpoint, size GPU memory for the weights plus the KV cache of your concurrent requests, and route only the traffic that must stay in-house to it while provider APIs handle the rest.

Key takeaways

  • Run an on-prem LLM for a reason you can name: data that must stay on your infrastructure, a regulatory or contractual requirement, latency inside your network, or steady volume that keeps GPUs busy.
  • vLLM and SGLang are the production serving engines; Hugging Face has put TGI in maintenance mode and recommends them; Ollama is for development and single machines.
  • GPU memory must hold the weights plus the KV cache of every concurrent request. Size the KV cache from the model's layers, KV heads and head dimension, times tokens in flight.
  • Most teams end up hybrid: sensitive traffic on-prem, everything else on provider APIs, behind one OpenAI-compatible endpoint with routing rules deciding which is which.
  • Never let sensitive traffic fail over to a public provider by accident. Decide per route whether a failure moves on or stops.
  • The honest cost is utilisation and people: an idle GPU costs the same as a busy one, and someone owns upgrades, capacity and the pager.

An on prem LLM is a language model you run on hardware you control, in your own data centre or private cloud, instead of calling a provider's API. It makes sense when data must stay on your infrastructure, when a regulator or contract requires it, or when steady volume keeps the GPUs busy; otherwise an API is usually simpler to operate and costs less at low or uneven volume.

This guide covers when on-premises is worth it, the serving stack, how to size GPU memory for the weights and the KV cache, the hybrid pattern most teams end up with, and the costs that do not appear on a hardware quote.

When does an on-prem LLM make sense?

Name the reason before buying hardware. Each one leads to a different design.

ReasonWhat it requiresWhat it does not require
Data must stay on your infrastructureEvery request carrying that data served in-house, with no fallback outsideEvery request in the company served in-house
A regulator, customer contract or sovereignty ruleDocumented control of where processing happens, and evidence of itThe largest model available
Latency inside your networkThe model near the callers, with capacity headroomMulti-region failover to the internet
Steady, high volumeHigh utilisation, sustained for monthsBurst capacity, which an API absorbs better
A fixed, validated model versionPinned weights you upgrade on your scheduleRunning the weights yourself; some hosts pin versions too
The usual reasons, and what each actually demands of the design.

Two observations follow. First, most of these reasons apply to some traffic, not all of it, which is why a hybrid design is common. Second, "air-gapped" is a stronger requirement than "on-prem": no outbound network at all, so weights, container images and updates arrive through a controlled transfer process, and nothing in the request path may depend on an outside service.

What you give up is most closed models. Their weights are not published, so on-prem in practice means open weight models, unless a vendor offers a private deployment under its own agreement. Open weight models in 2026 compares the current families and, just as important, their licenses.

The on-prem LLM stack

From the bottom up:

  1. Accelerators. GPUs with enough memory for the weights and the KV cache, and fast interconnect between them if a model spans several.
  2. A serving engine. The software that loads the weights, batches requests and streams tokens.
  3. An API edge. TLS, authentication and the paths you choose to publish.
  4. Routing and policy. Which application may call which model, failover, budgets and request records.
  5. Observability. Engine metrics such as queue depth and KV cache use, plus per-request records.

Serving engines

EngineUse it forWhat its documentation states
vLLMProduction servingPagedAttention for KV memory, continuous batching, chunked prefill and prefix caching; NVIDIA and AMD GPUs, CPUs and plugins for TPU, Gaudi and Ascend; FP8, INT8, INT4, GPTQ and AWQ; an OpenAI-compatible server1
SGLangProduction servingRadixAttention and prefix caching, multi-GPU parallelism; NVIDIA, AMD, Intel Xeon, TPU and Ascend hardware; OpenAI-compatible APIs2
Text Generation InferenceExisting deployments onlyIn maintenance mode; Hugging Face recommends vLLM and SGLang going forward3
OllamaDevelopment and single machinesA subset of the OpenAI API: chat completions, completions, responses, models and embeddings4
Serving engines as their own documentation describes them on 19 October 2026.

Model cards point the same way: DeepSeek V4.1 Flash, for example, gives serve commands for vLLM and SGLang and points to quantized builds for llama.cpp and Ollama for local use5. Pick vLLM or SGLang for shared production capacity, test the specific model on the engine you choose, and keep Ollama for laptops and prototypes. The production details around vllm serve (a stable model name, an API key, which paths the key covers, tool-call parsers, metrics) are in self-hosted models behind an OpenAI-compatible endpoint.

How much GPU memory does an on-prem LLM need?

Memory is the first constraint, and it has two parts: the weights, which are fixed, and the KV cache, which grows with every token in flight.

Weights

Weights take parameters times bytes per parameter. NVIDIA's worked example: a 7-billion-parameter model at 16-bit precision needs about 14 GB6. At 8-bit it is half that, at 4-bit a quarter, before overhead. Vendors increasingly publish the fit directly: gpt-oss-20b runs within 16 GB7, gpt-oss-120b fits on one 80 GB GPU because its expert weights ship in MXFP48, and Mistral Large 3 at FP8 runs on a single node of B200 or H200 GPUs, with its vLLM example using eight H200s9.

For mixture-of-experts models, size memory for the total parameters, not the active ones. Active parameters set compute per token; every expert still has to be loaded.

KV cache

During generation the engine keeps keys and values for every token of every running request. NVIDIA gives the size as batch size × sequence length × 2 × layers × hidden size × bytes per element, the 2 covering keys and values6. Models with grouped-query attention store fewer KV heads than attention heads, so replace hidden size with KV heads × head dimension:

KV cache sizing
KV bytes per token = 2 × layers × kv_heads × head_dim × bytes_per_element
KV cache total     = KV bytes per token × tokens in flight
GPU memory needed  ≈ weights + KV cache total + engine overhead

The example shows why concurrency and context length are capacity questions, not just product settings. Before buying hardware, decide the longest context you will accept, the number of requests you need running at once, and the precision you have evaluated for quality. Then cap the engine's maximum model length to match, so one long prompt cannot crowd out everything else.

The hybrid pattern: on-prem for sensitive traffic, APIs for the rest

Few organisations need every request served in-house. The common design puts sensitive workloads on owned capacity and everything else on provider APIs, with one endpoint in front:

  • One OpenAI-compatible endpoint. Applications use one client and one base URL. Because vLLM, SGLang and Ollama all speak the OpenAI API124, the on-prem server is one more target behind the gateway.
  • Rules decide the destination. Route by project, application, metadata such as a data-classification tag, or key, so the decision is made once and enforced for every caller rather than remembered in each codebase.
  • Failover is a policy, not a reflex. For general traffic, a failed on-prem attempt can move to a hosted model. For traffic that must stay in-house, a failure should stop and return an error. Failing over to a public API would quietly break the requirement that justified the hardware. Routing rules and failure rules covers how to express both on one route.
  • Overflow is explicit. When the on-prem queue is full, non-sensitive work can spill to an API, which lets you size owned capacity for the steady load rather than the peak. Automatic failover explains which failures are safe to retry elsewhere.

There is one constraint to settle early: the gateway sits in the path of every request it routes. If your sensitive traffic may not leave your network, the gateway that routes it has to run inside your network too.

The honest costs of an on-prem LLM

The hardware quote is the smallest surprise. The rest:

  • Utilisation. Cost per token is total monthly cost divided by tokens served. A cluster at half load costs twice as much per token as a full one, and GPUs cost the same idle. Provider APIs bill per use; owned capacity bills for time.
  • People. Someone owns driver and engine upgrades, model upgrades and re-evaluation, capacity planning, security patching and the pager. Budget engineering time as part of the cost, not as an afterthought.
  • Model churn. Open weight families keep shipping new versions. Each upgrade means downloading, quantizing, evaluating and rolling out, and an air-gapped site adds a transfer process to each step.
  • Lead times and lock-in to a size. Hardware bought for today's model fixes what you can run for years. A model that outgrows a node needs a new node, not a configuration change.
  • License review. On-prem, compliance with each model's license is entirely yours, including attribution and revenue-threshold clauses that some 2026 licenses carry.

On-prem and hybrid with INFRO

INFRO is a control plane over provider accounts you already hold, and an on-prem server is one of them: it connects as an OpenAI-compatible endpoint, with a base URL and an optional key, next to the hosted providers you use (connect a provider). Routes put it beside hosted targets with failover, if-rules send matching requests (by metadata, project, key and more) to their own targets, and failure rules decide per failure kind whether to retry, move on or stop (routes).

On the hosted service, INFRO's gateway runs on Cloudflare and reaches your server over the public internet: the base URL must be HTTPS, and private, loopback and link-local addresses are refused. So the hosted gateway fits the hybrid pattern when the on-prem server may be published through an authenticated HTTPS edge. It does not fit traffic that must never leave your network, or an air-gapped site.

For those, self-hosted and hybrid deployment of INFRO itself (the gateway in your own infrastructure, the console hosted by INFRO) is available under an enterprise agreement. It is scoped and delivered as part of that agreement, not a package you download, and self-serve plans run on the hosted service. The enterprise page describes how that conversation starts.

Questions readers ask

What hardware do I need to run an LLM on-premises?
It depends on the model and how many requests run at once. As published by their vendors: gpt-oss-20b runs within 16 GB of memory, gpt-oss-120b fits on one 80 GB GPU, and Mistral Large 3 at FP8 needs a full node of eight H200 or B200 GPUs. Add memory for the KV cache of your concurrent requests on top of the weights.
Can an LLM run fully air-gapped?
Yes. Open weight models and the serving engines run without internet access once the weights and container images are inside the network. Mirror both through an internal registry, verify checksums on the way in, and plan how updates cross the gap, because nothing will update itself.
Does on-prem cost less than an LLM API?
Only at sustained high utilisation. On-prem cost is hardware, power, space and engineering time divided by the tokens you actually serve, so a cluster that sits half idle costs twice as much per token as a full one. Spiky or small workloads are usually better served by an API.
Can on-prem models and provider APIs share one endpoint?
Yes. Every serving engine in this guide exposes an OpenAI-compatible API, so a gateway can put an on-prem server and hosted providers behind one endpoint and route by rule. The gateway itself then has to run where the sensitive traffic is allowed to go.

From the team that builds it

Where this shows up in INFRO

INFRO is a control plane in front of the provider accounts you already hold. The capabilities below are the parts of it this article touches, each with the documentation that defines its behaviour.

  • Provider connections

    Available with a plan

    Connect provider accounts you already hold. Each credential is encrypted when saved, scoped to your organization and never shown again; applications use INFRO gateway keys instead.

    Read the documentation for Provider connections
  • Health-aware routing

    Available with a plan

    Named routes use priority or weighted targets over your own connections, with health checks, retries and failover.

    Read the documentation for Health-aware routing
  • Automatic failover

    Available with a plan

    A route that times out or 5xxs before the response starts is retried elsewhere without your client seeing it.

    Read the documentation for Automatic failover
  • Routing rules

    Available with a plan

    If-rules on a route send matching requests to their own targets, by metadata, feature, end user, key, project, prompt size, streaming, images, tools or time of day. Failure rules decide per failure kind whether to retry, move on or stop.

    Read the documentation for Routing rules
  • Self-hosted and hybrid deployment

    Enterprise agreement

    INFRO in your own cloud account, or hybrid: the gateway in your infrastructure and the console hosted by INFRO. Scoped and agreed per contract; self-serve plans run on the hosted, multi-tenant service.

INFRO accounts are self-serve. Provider usage is billed to you by your providers; INFRO charges a software subscription and takes 0% of model spend. See plans.

Sources

Numbered in order of first citation. Each was opened and checked against the claim on the date shown.

  1. 1.vLLM documentation (opens in a new tab) — vLLM. Accessed Oct 19, 2026.
  2. 2.SGLang documentation (opens in a new tab) — SGLang. Accessed Oct 19, 2026.
  3. 3.Text Generation Inference (opens in a new tab) — Hugging Face. Accessed Oct 19, 2026.
  4. 4.OpenAI compatibility (opens in a new tab) — Ollama. Accessed Oct 19, 2026.
  5. 5.deepseek-ai/DeepSeek-V4.1-Flash (opens in a new tab) — Hugging Face. Accessed Oct 19, 2026.
  6. 6.Mastering LLM Techniques: Inference Optimization (opens in a new tab) — NVIDIA. Accessed Oct 19, 2026.
  7. 7.openai/gpt-oss-20b (opens in a new tab) — Hugging Face. Accessed Oct 19, 2026.
  8. 8.openai/gpt-oss-120b (opens in a new tab) — Hugging Face. Accessed Oct 19, 2026.
  9. 9.mistralai/Mistral-Large-3-675B-Instruct-2512 (opens in a new tab) — Hugging Face. Accessed Oct 19, 2026.

About this article

Written from the documentation of vLLM, SGLang, Text Generation Inference and Ollama, model cards on Hugging Face and NVIDIA's inference optimisation article, all opened on 19 October 2026, and from INFRO's public documentation and availability registry, which the authors maintain. The memory example uses a hypothetical model configuration and is labelled as illustrative. No hardware was benchmarked for this article.

Last checked against its sources on . The next review is due by . No separate named reviewer is recorded for this article.

How articles are written, sourced and corrected is set out in the editorial standards.