DEPLOYMENT

How to deploy an LLM in production

Deploying an LLM in production means a named operator, a place for prompts and logs, a serving path you can cap and observe, and an update you can roll back. A chat window is not that system. On-premises hardware, a private cloud and a managed API are different claims about who runs the weights. This page is the plan: options, layers, memory arithmetic and the checks that survive a security review.

A demo is not a deployment

A notebook that answers five prompts has not deployed anything. Production is the system that still behaves on a Tuesday afternoon when the person who wrote the notebook is elsewhere: the process stays up, a stranger cannot read the traces, a bad release can be undone, and someone knows the monthly bill. If you cannot name those four, you have a prototype. Call it that.

Fine-tuning does not deploy the model. An adapter is a file. The running system is the place that file is loaded, the identity that can call it, and the store that keeps what people typed. Teams arrive here after a pilot “worked” on a vendor chat UI and then discover the prompts were never allowed to leave. The inference page is the operating roster. This page is how you choose and assemble the path.

An LLM deployment platform, in the sense that matters, is that assembly: hardware or a contract, a serving engine, a gateway, evaluation, and a way to change the weights without improvising. A logo that says platform is not the assembly. Write the layers yourself, including the ones a vendor hopes you will treat as included.

Five ways the model can run

There are five shapes we will actually distinguish. A shared managed API: many customers, vendor-operated weights, you send prompts. A dedicated endpoint: still vendor-operated, but the contract names isolation, a region, or both. A private cloud or VPC deployment: the machines sit in a cloud account, and you must still say who administers them. On-premises: the machines are in a place you name and an operator you name. Air-gapped: that place cannot fetch weights, tokenizers or telemetry at runtime.

People collapse the middle three into “private AI deployment”. The collapse is the mistake. A private network path to a vendor is a route. It does not change who can snapshot the disk or read a support bundle. A VPC you do not administer is a tenancy with a landlord. On-premises LLM deployment means your operator, your patch clock and your incident roster. If the roster is a vendor’s staff in your building, write their name. “Our metal” is not an answer when someone else holds the keys.

Edge is a sixth location, not a sixth doctrine. A device running a small checkpoint is on-premises in miniature, usually with worse update discipline. llama.cpp and a local runner such as Ollama are honest tools for that device. They are not a gateway. Treat “it runs on my laptop” as a fit test, then decide whether the same binary, with authentication and a promotion step, is the production path or only the experiment.

Decision prompts, not scores.
WhenThen
The prompt is allowed to leave, and you will not staff GPUsStart with a managed API. Write the permission so a later slide cannot call it sovereign.
The prompt may leave only under a named region and access ruleA dedicated endpoint can be enough. Read the contract for logs and staff access, not only for the GPU pin.
You must operate the weights, and the room can reach your own registryPrivate cloud or on-premises. The difference is where the machine sits, not which engine you install.
The room must not fetch artefacts or send telemetryAir-gapped. Budget the import path before you budget the GPUs.
Deployment shapes. Each row is a claim you must be able to defend. Not a ranking.
ShapeWho runs the weightsWhat you still have to write
Shared managed APIThe vendorRegion, retention, training-on-prompts, subprocessors, exit
Dedicated endpointThe vendor, with a named isolation storyWhat “dedicated” covers: GPU, network, logs, staff access
Private cloud or VPCWhoever administers the accountAccount owner, key holders, services that still leave the VPC
On-premisesYou, or a contractor you nameHardware owner, patch clock, licence to run, incident roster
Air-gappedYou, with no runtime path outImport procedure, checksums, rollback bundle, banned phone-home

Choose from the constraint, not the catalogue

Write six lines before you pick a shape. Data classes in the prompt, the output and the log. The operator who can read those objects. The residency rule, and whether it is a statute, a contract or a preference. The latency a person will actually wait. The volume in tokens and in concurrent requests, including the busy hour. The people who patch, rotate keys and answer a page. A missing line is a reason to stop, not a reason to default to the vendor your colleague already likes.

Licence sits beside those lines. Open weights can be copied into a room you operate only when the card allows that use, that distribution and that quantised build. A community licence can forbid a use even after you bought the server. The licence comparison is the table of those grants, not a substitute for the file you will load. A closed model never gives you the weights, so “we will move it on-prem later” is a different product, not a migration. The open-weights versus closed-API comparison is that fork. The self-hosted versus API comparison is the money and privacy version of the same fork.

Volume without a residency rule often favours an API, because you pay for tokens and the vendor staffs the night. A residency rule without volume still forces a shape: you may run a quiet box because the prompt must not leave, and the break-even spreadsheet is then a cost of the rule, not a veto. Do not let a token calculator overrule a line counsel already wrote. Do not let a sovereignty adjective overrule a calculator when the prompt was allowed to leave.

Enterprise AI deployment fails in the gap between those documents. Procurement buys a platform subscription. Security writes “on-prem”. Engineering ships a container that still calls a hosted embedding model and a hosted moderation model. The user-facing LLM is local. The path is not. Draw every hop, including embeddings, rerankers, guardrail models and the observability vendor, before you call the diagram done.

A reference architecture, by layer

Use the same layers whether the machine is rented or in a cupboard. Skipping a layer because a product “includes it” is how you fail to ask who holds the keys. The layers below are a checklist of responsibilities. They are not a brand list, and they are not a statement that you must run all of them yourself.

Hardware and GPU. The device that holds the weights and the cache. For a large checkpoint this is usually one or more GPUs with enough memory for weights plus concurrent cache, on a machine whose CPU, disk and network can feed it. For a small checkpoint it may be one GPU or, for some quantised builds, a CPU. Record the memory you sized, the failure domain (one GPU, one host, one rack) and who replaces a dead card. A single host is a single failure. Say so if you accept it.

Serving engine. The process that loads weights and turns token requests into completions. Current engines teams actually operate include vLLM, SGLang, TensorRT-LLM and Hugging Face Text Generation Inference. llama.cpp, and runners built around it, cover CPU and edge more often than a multi-GPU service. The next section says what each name is allowed to mean. The engine does not authenticate your users and does not decide your region.

Gateway and routing. The only address your applications should know. It authenticates the caller, applies quotas, selects a model, and rejects a request the data-class rule forbids. It is also where a hybrid design sends some traffic to an API and keeps the rest local. If the gateway is missing, every application is a private deal with the raw port, and you will not be able to turn the raw port off.

Observability. Metrics first: queue time, time to first token if you care about it, tokens in and out, GPU memory, error rate, saturation. Traces of the prompt text are a separate decision, because the trace is a copy of the data. A metrics vendor in another region can be a residency failure even when the GPU is local. Write what leaves.

Evaluation and guardrails. A fixed set of unused examples you run before a weight, a template or a quantisation change is promoted. Guardrails are the checks on the live path: schema, allowed tools, refusal rules, redaction, a human queue when the model must not answer. They reduce classes of failure. They do not prove the model is right. A guardrail model that itself calls a foreign API is another hop.

Access and cost control. Identities, roles, and a ceiling on tokens, concurrency and spend. Internal platforms without a ceiling become an unbounded product. The ceiling is also how you keep the KV-cache plan true: if you sized for eight concurrent sequences, the gateway must refuse the ninth or you have a different memory plan.

  • Hardware: memory, failure domain, who replaces a card.
  • Engine: process that loads weights. Not an identity system.
  • Gateway: the only front door. Auth, quotas, data-class routes.
  • Observability: metrics you keep, prompt text you might not.
  • Evaluation: unused examples before promotion. Guardrails on the live path.
  • Access and cost: a ceiling that matches the memory you bought.

Serving engines do not choose the operator

vLLM is a serving engine whose published design, PagedAttention, manages the key-value cache in pages so blocks can be packed and shared. That is a memory mechanism. It is a reason the cache term in the next section is not a single contiguous slab you can guess from a blog. It is not a measured speed on your prompts, and we will not type one.

SGLang is a published system for running structured language-model programmes, with a cache that reuses shared prompt prefixes. Use it when your calls are programmes — constraints, tools, repeated prefixes — and you are willing to operate that stack. Prefix reuse changes how much new cache a repeated template costs. It does not remove the need to cap concurrency.

TensorRT-LLM is NVIDIA’s library for building optimised engines on NVIDIA GPUs. You compile or export an engine, then you serve it. The compile is a build artefact you must version, just like the weights. It does not run on hardware the library does not target. If your estate is not NVIDIA, this name is the wrong row.

Text Generation Inference is Hugging Face’s serving toolkit. It is a reasonable engine when your artefact already lives in that ecosystem and you will patch it yourself. The toolkit is not a private cloud. Pointing it at a public download on first boot is a phone-home, which an air-gapped room cannot do and a private room should not do by accident.

llama.cpp is the usual engine when the checkpoint is quantised for CPU or a small GPU, and when the deployment is a device rather than a service. Ollama is a local runner around that kind of runtime. Both can sit inside a serious design. Both are also how teams skip the gateway and call the result production because the demo felt fast. Production is the layers above, not the binary.

Pick an engine your on-call can debug. A faster engine nobody can patch is a worse operating plan than a plainer engine you have already restored from a backup. Write the version, the build flags and the model format (a Hugging Face directory, a compiled engine, a GGUF file) into the same record as the checkpoint hash. Changing format is a new deployment, not a config tweak.

A dated reading of the November 2026 releases is vLLM vs SGLang vs TensorRT-LLM vs Ollama.

A deployment plan, in order

Walk this once on paper before you rent a GPU. The order is the point. Teams that start at the engine, or at a model card, discover the constraint after the invoice.

Write the constraint. Data classes, operator, residency, latency, busy-hour volume, on-call names. Mark each line as a rule or a preference. Preferences can be traded against cost. Rules cannot, until someone with authority withdraws them.

Choose the shape from the table above, and write the fallback in the same paragraph. A local model that times out into a shared API has two shapes. If the fallback is forbidden, the timeout must queue a person or fail closed.

Pick a checkpoint you are allowed to run in that shape. Read the card for the exact file, including any quantised build and any adapter you will attach. Fine-tuning changes behaviour. It does not move the file into your building and it does not rewrite the publisher’s terms.

Size memory for the concurrency you will allow, using the arithmetic in the next section, then choose an engine that can load that artefact on that hardware. If the weights alone do not fit, stop. No batch trick shrinks the file.

Put the gateway in front before any application integrates. Authentication, a token ceiling, a concurrency ceiling, and a route table by data class. Applications bind to the gateway. They do not bind to a node port that bypasses it.

Add metrics, the log policy, the unused evaluation set, and the live guardrails. Promote the first version only when that set has been run on the same engine and template the gateway will serve. A laptop generation is not that run.

Rehearse update and rollback, including the air-gapped import if you have one. If you cannot restore yesterday’s bundle, you do not have a deployment. You have a hope that the next change will be harmless.

GPU memory is weights plus KV cache

Serving memory is not the parameter count in the press release. Two terms dominate, and they move for different reasons. Weight memory is the checkpoint resident on the device. KV-cache memory is the key and value state kept for tokens you have already read, and it grows with how many sequences you serve at once and how long those sequences are.

Weight bytes are parameter count times bytes per stored value. The fine-tuning VRAM planner uses the same width table we will use here, and it labels the widths as assumptions: 4 for fp32, 2 for fp16 or bf16, 1 for int8, and 0.5 for 4-bit storage before scales and block metadata. Real 4-bit files are larger than the 0.5 figure because of those scales. Treat 0.5 as a lower bound on the weight term, which is what the planner already says. The planner adds optimiser state for training. Serving does not. Do not paste a training total into a serving budget.

The planner also excludes activations. So does the serving sum below. Prefill can allocate activation memory the formula does not show. If a run dies while the weight-plus-cache sum still fits, you are in that remainder. Shorten the prompt or the batch. Do not invent a constant to hide it.

KV-cache bytes, for a decoder-only model, are 2 × layers × key-value heads × head dimension × bytes per element × tokens resident in the batch. The 2 is keys and values. Read layers, key-value heads and head dimension from the model config, not from a parameter slogan. Head dimension is often hidden size divided by attention heads. Key-value heads can be fewer than attention heads when the model uses grouped-query attention. If you assume they are equal, you will overstate the cache, which is the safe direction, but you should still read the config.

Bytes per element in the cache are whatever the engine stores. That is often 2 for fp16 or bf16. It is not automatically the weight width. A 4-bit weight file with a 16-bit cache is a normal combination. Quantising the weights and then forgetting the cache is how a model “fits” in a spreadsheet and fails under concurrency.

Tokens resident in the batch means concurrent sequences times the tokens you actually keep, not the maximum context printed on the card, unless your gateway allows every request to fill that maximum. Size the cache for the ceiling you will enforce. Then enforce it. A 128k context advertised on a card is a permission, not a capacity plan.

Mixture-of-experts checkpoints are a separate trap. Activated parameters describe compute. The file you must hold is the experts you do not offload. If every expert stays on the GPU, weight memory follows total parameters. Do not brief a 37-billion-activated model as if the box only stored 37 billion parameters.

Multi-GPU splits the weight term across devices and then spends memory on whatever the parallel scheme duplicates. Tensor parallel, pipeline parallel and expert parallel do not share one formula on this page, because the duplicate depends on the engine. After you split, re-check the cache: it is often replicated or sharded differently from the weights. Measure the engine’s reported memory at your ceiling. The arithmetic is the plan. The engine’s meter is the check. We will not publish a card-by-card fit table.

Price the month with your own rates

The inference cost planner is the arithmetic. Hosted API cost is your tokens times your price per million, with input and output separated when the tariff says so. Self-hosted cost is GPU count times your price per GPU-hour times the hours those GPUs stay on. Hours include idle time when the model is kept hot. The planner does not look up a market rate. Neither does this page.

A deployment changes the inputs, not the formula. An always-on on-premises box has an hourly price you must derive from hardware, power, space and support, or from an internal charge. A cloud GPU has a quote. A dedicated endpoint has a contract that may not look like either formula: a monthly commit, a token rate, or both. Map the contract onto the two sums before you compare them. If you cannot, you are comparing a slogan with an invoice.

Ops is not inside the GPU term unless you type it. Patching, on-call, evaluation time and the gateway are part of running the model. An API price usually includes the vendor’s version of those. Leaving yours at zero is allowed only if you label the zero. The break-even method, including utilisation and throughput, is written out on the self-hosted versus API page. Use it when the argument is money. Use this page when the argument is the system you will operate.

Redundancy multiplies GPUs before it multiplies quality. A second host for failover is a second bill. A canary that stays hot is a second bill. Write them into the hour count. A design that prices one GPU and then requires two for the roster is not a design yet.

Air-gapped updates are an import, not a pull

An air-gapped deployment cannot pip install, git pull, or fetch a tokenizer the first time a prompt mentions a new token. Anything the process would download in a connected lab must be in the bundle, or the first real request will hang or fail. Build the bundle on a connected staging system that matches the engine version, then move the bundle in.

The bundle is the weights, the tokenizer, the chat template, the engine config or compiled engine, the container image or binary, and the checksums of each. Version them as one release. A new template with old weights is a behaviour change. A new engine with an old compiled plan can be a failed boot. Rollback is the previous bundle, still inside the room, not a note that you could download it again.

The import path is a security control. Name who may carry it, how it is scanned, and how the checksum is checked on the inside before anyone points the gateway at it. An informal laptop is a path. If it is the path, write it down so it can be reviewed. Do not describe it as “we just copy the file” in a design that claimed to be air-gapped.

Run the unused examples inside the room before promotion. A score from the connected staging twin is evidence about the twin. The room can differ in CPU flags, driver versions and the engine build you actually imported. Promote only the bundle that passed where it will run.

Then disable the exits. No runtime pull of adapters, no telemetry to a vendor, no licence server that must be phoned, no observability SaaS. A model process that “only checks for updates” has left the gap. Metrics should land on a store you operate on the same side of the gap. If a vendor tool cannot be configured that way, it is the wrong tool for this shape.

Decision prompts, not scores.
WhenThen
The room can reach an internal registry you controlYou may not be air-gapped. You are on a private network. Say which, because the update path is different.
Nothing can be fetched at runtime, including tokenizers and imagesTreat every change as a checksummed import, evaluated inside, with the previous bundle kept for rollback.
A dependency still wants a phone-homeReplace it or abandon the air-gap claim. Do not leave the call in and hope it fails closed.

Sovereignty is a set of checks, not a hosting adjective

Self-hosting is not sovereignty. Sovereignty, on this site, is an operator you chose, a place for prompts and logs and backups, and weights you are allowed to run there. A GPU in your rack with traces in a foreign observability tenant fails the second noun. A dedicated endpoint you do not operate can still meet a written residency rule if you accept that vendor as the operator and the contract matches the rule. The sovereign AI hub defines the nouns. The AI sovereignty page is the commercial reading. The sovereignty checklist is the list you can hand to a reviewer.

Walk the copies, not the slogan. Training examples, if you adapted the model. Prompts and retrieved passages. Outputs. Logs and metrics. Evaluation sets. Backups and snapshots. Support bundles a vendor asks you to upload. Each copy has a region and a reader. The inference page is where that roster is supposed to live after this design is chosen. If a copy has no owner, it is the incident you have not had yet.

Statutes are not summarised here into “you must stay on-premises”. The GDPR regulates personal data in the European Union, including transfers. The EU AI Act regulates certain AI systems placed on the Union market. Neither instrument, on this page, chooses vLLM or a hyperscaler. Counsel reads the instrument. You bring them the hop list. India and UK context is on the sovereign AI hub, with the same limit: not legal advice.

Private AI deployment is a phrase vendors use for several of the shapes above. When you hear it, ask which row of the table they mean, who can read a prompt, and whether the weights can be moved if you leave. If the answers are missing, the phrase is advertising. Do not repeat it in your own design document.

Mistakes that survive the pilot

Calling a VPC peering or a private link “on-prem”. The packet stayed off the public internet. The operator did not change. Write the operator in the same sentence as the network.

Sizing from parameters alone. The weight term fit, the cache for the busy hour did not, and the gateway had no concurrency cap, so the engine was free to accept the overload. The arithmetic and the cap are one control.

Quantising until it fits, then skipping the unused examples. Fewer bits are a memory decision. Quality is a measurement on your task. GPTQ and other post-training methods change storage. They do not sign your bar. The same is true of a merged adapter you never re-ran on the serving engine.

A laptop stack promoted in place. Ollama or llama.cpp answered a demo, so the port was opened. There is no authentication, no second person who can restore the box, and no record of which file is loaded. The binary can stay. The missing layers cannot.

Logs of full prompts in a tool the security review did not see. The model was local. The trace exporter was not. Observability is part of the data path. Put it on the diagram.

A hidden hop. Embeddings, moderation, a fallback model, a grammar checker, a web search tool. Each one is a deployment with its own operator. The user-facing model being local does not localise the hop.

No rollback bundle. The new weights are better on three examples and worse on the job, and the previous file was overwritten. Promotion without a retained previous release is how a bad Tuesday becomes a rebuild.

An air-gap that is only a missing default route. The host can still reach a proxy, a licence server or a container registry through a management network. Test the negative: from the serving account, a pull should fail.

Cost control left for later. Every internal team gets a key with no quota. Utilisation looks healthy. The bill, or the queue, belongs to nobody. Ceilings are part of go-live, not a finance project for next quarter.

Fine-tuning used as a substitute for deployment. The adapter is accurate in a notebook that calls a hosted base. Production still sends the document to that host. Adaptation did not answer where inference runs.

What the proposal should contain

A reviewer should be able to rebuild the decision from the document without attending the meeting. One page is enough if the lines are specific. A diagram that omits logs is not enough.

Name the shape, the operator, and the region of each copy. Name the checkpoint hash, the licence line, and the engine version. Name the concurrency and context ceiling, and the weight-plus-cache sum that ceiling implies, with the config fields you read. Name the price inputs you typed into the cost planner, or say the price is not chosen yet. Name the unused set you will refuse to train on, and the rollback. Name the hops that are not the main model.

If a line is unknown, leave it unknown. An invented GPU price or an invented tokens-per-second figure will be quoted back at you as a fact. This site will not supply one to fill the blank. Bring the blank to the scoping call. The call is for the constraint and the path, not for a platform slogan.

Sources

  1. Kwon et al., Efficient Memory Management for Large Language Model Serving with PagedAttention (SOSP 2023). The vLLM paper introduces PagedAttention, which stores the key-value cache in pages so a serving engine can pack and share cache blocks. This site cites the mechanism. It does not carry a speed figure.
  2. Zheng et al., SGLang: Efficient Execution of Structured Language Model Programs (Accessed November 2026). SGLang is a published system for executing structured language-model programmes, including a radix-tree cache for reusing shared prompt prefixes. This site names the system. It does not publish a throughput score.
  3. NVIDIA, TensorRT-LLM (Accessed November 2026). TensorRT-LLM is NVIDIA’s library for optimising and serving large language models on NVIDIA GPUs. It is an engine you operate, not a hosting contract.
  4. Hugging Face, Text Generation Inference (Accessed November 2026). Hugging Face publishes Text Generation Inference as a toolkit for serving language models. Naming the toolkit is not a recommendation and not a benchmark.
  5. ggml-org, llama.cpp (Accessed November 2026). llama.cpp is a C and C++ implementation for running language models, including quantised checkpoints, on CPUs and GPUs. A binary is not an access policy or an update process.
  6. Ollama (Accessed November 2026). Ollama publishes a way to run models locally. A local runner still needs an operator, an access rule and an update path before it is a production deployment.
  7. Frantar et al., GPTQ: Accurate Post-Training Quantization for Generative Pre-trained Transformers (Accessed November 2026). GPTQ is a post-training quantisation method for generative transformers. Quantisation stores weights in fewer bits. It does not reduce the parameter count, and this site does not treat the paper as a quality score on your task.
  8. Regulation (EU) 2016/679 (GDPR) (Official Journal). The GDPR regulates processing of personal data in the European Union, including the rules that apply when personal data is transferred.
  9. Regulation (EU) 2024/1689 (AI Act) (Official Journal). The AI Act is the European Union’s regulation on artificial intelligence. It is not, on this site, read as an instruction to fine-tune or to host on-premises.

Questions we hear first

What is the difference between on-premises, a private cloud and a managed API?

On-premises means you name the operator and the place the machine sits. A private cloud means the machine is in a cloud account, and you still have to name who administers it. A managed API means the vendor runs the weights and you send prompts under a contract. A private network path does not turn the third into the first.

Does putting the model on our GPUs make the deployment sovereign?

No. Sovereignty needs the operator, the location of prompts, logs and backups, and a licence that allows the run. A local GPU with traces, embeddings or a fallback in another tenant has not kept the data local. Use the sovereignty checklist on the hop list, not on the GPU invoice.

How much VRAM do we need to serve a model?

Add weight bytes (parameters times bytes per stored value) to KV-cache bytes (2 × layers × key-value heads × head dimension × bytes per element × tokens you keep resident). Read the integers from the checkpoint. Cap concurrency so the cache cannot exceed what you sized. The fine-tuning VRAM planner covers weight bytes and training state. It does not compute the cache.

Which serving engine should we use?

Use an engine your hardware and your operators can run: vLLM, SGLang, TensorRT-LLM, Text Generation Inference, or llama.cpp where the device is small. We do not publish a speed ranking. The engine still needs a gateway, a log policy and an update path.

Is a dedicated endpoint enough for data residency?

Sometimes. It is enough when the contract names the region, who can read prompts and logs, retention, and whether prompts are used to train, and when you accept the vendor as operator. It is not enough when the rule is that you operate the weights, or when a support path copies data somewhere else.

How do we update a model in an air-gapped network?

Import one versioned bundle — weights, tokenizer, template, engine and checksums — through a path security has named. Evaluate it inside the room. Keep the previous bundle for rollback. Disable runtime downloads and telemetry. A staging score from a connected twin is not a promotion.

How should we compare the cost of self-hosting with an API?

Type your token volumes and your API prices, and your GPU count, hours and hourly price, into the inference cost planner. Add ops, idle time and redundancy, or label their absence. Do not use a price from this page. There is not one. The self-hosted comparison walks the break-even, including throughput.

What does a production deployment include that a demo skips?

An operator, a ceiling on concurrency and tokens, authentication, a decision about prompt logs, an evaluation set that blocks promotion, a rollback bundle, and a written fallback that does not break the residency rule. The demo only showed that one checkpoint can emit text.

Start with one task and a written scope.

Bring the workflow, the constraints and where inference should run. We use that brief to decide whether sovereign LLM & SLM fine-tuning, retrieval or a readiness review is the right first step.

Explore your AI options