Skip to main content
Back to Blog
CybersecurityCybersecurityAISecurityOnPremiseAIDataSecurityAIMachineLearningInfoSecITConsulting

Running Large AI Models On-Premises: A Practical Guide for Regulated Industries

Eldar Aydayev· CEO, Aydahwa Enterprise November 26, 2026 14 min read
Running Large AI Models On-Premises: A Practical Guide for Regulated Industries

The problem with sending regulated data to someone else's model

A bank asks us to help its analysts summarise loan files with a language model. A smart-grid operator wants an assistant that can read maintenance logs and flag anomalies. In both cases the first design question is not which model to use. It is whether the data is allowed to leave the building at all. For a core banking system under PCI-DSS, for patient records, for critical national infrastructure, the honest answer is usually no. The data cannot be posted to a public API endpoint, and no amount of contractual language about a vendor's data-retention policy changes what the compliance team will sign off on.

That constraint pushes the whole problem onto your own hardware, and running a capable model on hardware you own turns out to be harder than downloading it. We have watched more than one team pull an 8-billion-parameter model onto a workstation, hit an out-of-memory error on the first load, and conclude that local inference is not viable. It usually is. It just requires understanding where the memory goes and which levers actually move it.

This guide walks through what running a model locally demands, the techniques that let a large model fit on modest hardware, and the security work that self-hosting adds rather than removes. The framing throughout is the one we apply in regulated engagements: keep the data inside a controlled boundary, and make the architecture defensible to an auditor.

What "running a model" actually demands

A model is a large collection of numerical parameters, usually called weights, organised into layers. Using an already-trained model to answer a question is called inference, and during inference those weights stay fixed. That is the reason a model trained on a data-centre full of accelerators can sometimes run on a single server in your rack. Training is the expensive part, and you are not doing training.

Memory is the first wall you hit. A weight stored at 16-bit precision takes two bytes, so eight billion of them need roughly 16 GB for the raw weights alone, before you count the temporary data generated while the model runs. Where that memory sits matters as much as how much of it you have. System RAM and the VRAM on a discrete GPU are separate pools. A server with 64 GB of RAM and 16 GB of VRAM does not give you one fast 80 GB pool. An SSD can hold a model file that is far too large for either, but pulling weights off storage on demand is slow enough to make an interactive assistant unusable.

Even when a model fits, throughput depends on memory bandwidth, meaning how fast the processor can read the weights it needs. For a single user generating text, moving model data around is often the real bottleneck, not raw compute. Generation also has two phases with different characteristics. The prefill phase reads your prompt and can do a lot of work in parallel. The decode phase produces output one token at a time and is inherently sequential. A model can fit in memory comfortably and still answer too slowly to be worth deploying, which is why we measure time-to-first-token and tokens-per-second on the actual workload rather than trusting a spec sheet.

Why regulated teams run inference in-house

The motivation is rarely cost. Occasional, bursty use is often cheaper on a hosted service once you account for hardware, power, and the staff to maintain it. The motivation is control.

Data sovereignty comes first. If prompts contain cardholder data, patient information, or operational details of a power network, local inference keeps that data inside a boundary you can describe precisely to an auditor. That maps directly onto ISO/IEC 27001 controls around information transfer and supplier relationships, onto PCI-DSS requirements about where account data may travel, and onto the NIST Cybersecurity Framework functions of Identify and Protect. Second is availability. Remote sites, plant floors, and secure facilities cannot assume a reliable internet link, and an air-gapped environment has no link by design. Third is version stability. When you host the weights, a vendor cannot silently swap the model underneath a validated workflow, which matters when you have documented a system's behaviour for a regulator.

None of this is theoretical for the sectors we work in. Banking estates under central-bank oversight, telecom cores, and smart-grid control systems all share the same reflex: sensitive workloads stay on infrastructure the operator controls. Applying that reflex to AI inference is a natural extension of work our team has done for years across banking, telecom, and critical national infrastructure.

Architecture diagram of a hardened on-premises AI inference zone: an isolated network segment with no internet egress containing a model inference server and a signed model registry, fronted by an access gateway enforcing authentication and input filtering, with all activity forwarded to a SIEM for logging

Fitting a capable model onto hardware you can afford

The techniques below reduce memory, reduce computation, or move work to slower hardware. They address different parts of the problem, so their savings do not simply add up. The skill is choosing the smallest combination that meets your quality and latency targets inside the hardware budget you have.

Quantization: store each weight more compactly

Quantization lowers the numerical precision used for each weight. Instead of 16 bits per parameter, a 4-bit scheme represents each weight as one of sixteen possible values, with groups of weights sharing scaling information to map those codes back onto sensible ranges. The saving is large and predictable. That same 8B model drops from roughly 16 GB of raw weights to about 4 GB at 4-bit precision. The parameter count does not change; each parameter simply takes less space.

The cost is a possible drop in answer quality, and how much you lose depends on the model, the quantization method, and the task. A configuration that handles routine summarisation well can become unreliable on precise reasoning or code. Two cautions from experience. Lower precision does not guarantee proportionally faster execution, because some runtimes store 4-bit weights but still compute at higher precision. And you must validate the quantized version on your real tasks, not on a generic benchmark, before you trust it in production.

Layer-wise offloading: bring weights in as they are needed

Offloading changes where weights live rather than how big they are. During a forward pass, information flows through the layers in order, and the GPU does not need every layer's weights at the same instant. A system can hold most weights in RAM, copy one layer into VRAM, run it, free that copy, and load the next. Some layers can stay resident on the GPU permanently; more aggressive setups keep weights on disk and stage them into RAM before use.

This is what lets a model larger than your VRAM run at all, and it comes with a clear penalty. Consider a step that moves 10 GB of weights over a link sustaining 10 GB per second: that is about one second of transfer per generation step, repeated for every token. A model that eventually produces an answer can still be far too slow for an interactive assistant, while being perfectly acceptable for overnight batch document processing where latency does not matter. Assigning some layers to the CPU and others to the GPU is a related option, as is running entirely on CPU when you have enough RAM and can tolerate the speed.

Mixture of experts: use only part of the model per token

A mixture-of-experts model changes the architecture. Certain layers hold several alternative sub-networks called experts, and a small routing network picks a few of them for each token. A layer might contain eight experts but use two per token, sending the next token to a different pair. This separates total parameters from active parameters: total parameters drive how much you must store, while active parameters drive how much computation each token costs.

The catch for on-premises deployment is storage. The inactive experts still have to live somewhere, because a later token may route to them. A mixture-of-experts model with 40 billion total parameters still needs roughly 20 GB at 4-bit precision even though only a fraction of it fires for any given token. Mixture of experts buys you more capability per unit of computation, which helps throughput, but it does not shrink the memory you must provision.

Distillation and pruning: build or trim a smaller model

Distillation trains a smaller student model using the outputs of a larger teacher. The student can learn a specific job, such as classifying support tickets and drafting short replies, while needing far less memory and compute. It is a genuinely smaller model, not the large one in disguise, so it can lose breadth and reliability on unfamiliar inputs even while it performs well on the narrow task you trained it for. For a well-scoped internal workflow, that trade is often exactly right.

Pruning removes weights or whole structures that contribute little. Setting individual weights to zero does not help on its own, because a standard array still occupies space and standard maths still processes the zeros. Real savings need a compressed representation, an engine that skips the removed work, or structural pruning that genuinely makes the model smaller, and you often need a short retraining pass to recover quality. Both techniques are worth it when the model and the runtime are built to exploit them, and neither is a free lunch.

The conversation has its own memory cost

After you have shrunk the weights, a second memory problem appears: short prompts work, then a long document triggers an out-of-memory error. The cause is the key-value cache, the working data a transformer keeps for the tokens it has already processed so it does not recompute them. The cache is separate from the weights, and it grows with sequence length and with the number of concurrent conversations. Your model file stays the same size while the workload's memory footprint climbs.

The practical fix is to control context. A document assistant should retrieve the relevant passages and feed those to the model rather than stuffing an entire contract into the prompt, an approach usually built as retrieval-augmented generation. Conversation history can be trimmed to what the current turn needs. You can also quantize the cache or move part of it to CPU memory, at some cost to speed. There is a security angle here that teams miss: the KV cache and any retrieval index hold fragments of the sensitive data you fed the model, so they sit inside your data-classification boundary and need the same access controls, encryption, and disposal rules as the source records.

Better software gets more out of the same hardware

The inference runtime, the software that actually executes the model, can change performance dramatically without touching the weights. FlashAttention reorganises the attention calculation into blocks that use the GPU's fast on-chip memory well, computing the same result while moving far less data. PagedAttention, introduced with the vLLM serving engine, manages the KV cache in blocks so memory is not wasted on fragmentation and duplication, which matters most when you serve many requests of varying length. Batching groups requests so they share the cost of reading the weights, improving total throughput at the price of more working memory.

Speculative decoding attacks the sequential nature of generation. A small, fast draft model proposes several tokens, and the larger target model checks them all in parallel; accepted tokens are kept, and a rejected one is corrected by the target before generation continues. It speeds things up when the draft agrees with the target often, but the target still has to run and the draft needs its own memory, so it helps only after the basic memory problem is already solved.

TechniqueWhat it reducesMain trade-offBest fit
Quantization (e.g. 4-bit)Weight memoryPossible quality loss on hard tasksAlmost always the first lever to pull
Layer-wise offloadingGPU memory needed at onceSlower generation from repeated transfersBatch and background workloads
Mixture of expertsComputation per tokenFull model still must be storedHigher capability without more compute
DistillationModel size and computeNarrower capability than the teacherWell-scoped, repeatable internal tasks
PruningWeights and structuresNeeds a compatible runtime; may need retrainingWhen engine and model are co-designed
KV-cache control (RAG, trimming)Working memory during long contextRetrieval adds engineering; index holds sensitive dataLong documents and multi-turn chat
Decision flow for fitting a model on available hardware: start by quantizing weights, check whether the model fits in memory, apply offloading or move to a smaller distilled model if not, then validate quality and latency on real tasks before deploying

Self-hosting adds security work, it does not remove it

Keeping inference in-house solves the data-egress problem. It also makes your team responsible for security controls that a hosted provider would otherwise own, and skipping them is where self-hosted deployments go wrong. Four items belong on every design.

The model itself is now part of your software supply chain. Weights are large binary files pulled from public repositories, and they can be tampered with or carry unsafe serialised code. Treat a downloaded model like any other third-party dependency: verify checksums and signatures, prefer safe serialisation formats, and hold approved versions in an internal registry rather than letting each server pull from the internet. This is the same discipline we apply to hardened image provisioning and CIS-benchmarked builds, extended to model artifacts.

Isolation is the second item. An inference server handling regulated data belongs in its own network segment with no outbound internet path, reachable only through a controlled gateway, on the zero-trust principles we design into every sensitive environment. The gateway is where authentication, authorisation, rate limiting, and input filtering live, because a model endpoint left open on the network is an exfiltration channel waiting to be used. Third, log at the gateway and forward to your SIEM. Prompts and responses can contain sensitive data, so decide deliberately what you retain, protect those logs to the same standard as the underlying records, and keep enough of an audit trail to answer who asked the model what. Fourth, treat prompt injection as a real input-validation problem, especially once the model can trigger actions or read from a retrieval index that untrusted content can reach.

A sizing checklist we run before committing hardware

  1. Define the workload precisely: interactive assistant or batch processing, expected concurrent users, and typical and maximum context length.
  2. Set explicit targets for answer quality, peak memory, time-to-first-token, and tokens-per-second, tied to the real task rather than a benchmark.
  3. Start with a quantized model and measure whether it fits and whether quality holds on your own data.
  4. If it does not fit, add offloading for batch work, or step down to a smaller or distilled model for interactive work, and re-measure.
  5. Size the KV cache for your longest realistic context and concurrency, and decide the retrieval strategy for long documents.
  6. Choose a runtime that supports the optimisations you need, such as PagedAttention for multi-user serving.
  7. Place the whole system inside a segmented, egress-controlled zone with a gateway, logging, and a signed model registry before it touches production data.

Each adjustment should be validated against realistic tasks, because the savings from these techniques interact in ways that a checklist alone cannot predict. Background document processing tolerates delays that would make a coding assistant useless, and the right configuration for one is the wrong configuration for the other.

How Aydahwa Enterprise can help

Running capable AI models on infrastructure you control is an infrastructure and security problem before it is a machine-learning problem, and it sits squarely in the work Aydahwa Enterprise has delivered for regulated organisations for over two decades. We size and architect on-premises and air-gapped inference environments, design the network segmentation, zero-trust access, key management, and SIEM integration around them, and align the whole design to ISO 27001, PCI-DSS, NIST CSF, and CIS Benchmarks so it stands up to an audit.

If you are weighing local inference for sensitive workloads, our cybersecurity services and cloud and infrastructure practice cover the architecture and the controls end to end, and our managed IT support keeps the environment healthy once it is live. To gauge where you stand today, start with our free cybersecurity self-assessment or work through the cybersecurity readiness checklist. When you are ready to scope a deployment, get in touch and we will help you design something your compliance team can sign.

Share

Need expert guidance?

Our cybersecurity and IT consultants can help you implement the strategies discussed in this article.

Call UsWhatsAppBook