LIVE · Thursday 3 December

HIPAA-Compliant LLM On-Premise Deployment: Keeping Patient Data In-House With Self-Hosted Open-Weight Models

No model is HIPAA compliant by itself. Self-hosting an open-weight LLM takes the model vendor out of your PHI chain, but the Security Rule, and some BAAs, stay. Here is how the deployment shapes, GPUs and controls fit together.

By Nick12 min read

There is no LLM that is "HIPAA compliant" on its own. The HIPAA Security Rule binds covered entities and their business associates, not software, and it lets them use "any security measures" that reasonably implement its standards. To keep patient data on-prem, you run an open-weight model such as Llama on your own GPUs behind a self-hosted inference server like vLLM, so protected health information (PHI) never reaches a model vendor. That removes the need for a business associate agreement (BAA) with the model's publisher. It does not remove the Security Rule, or BAAs with colocation, support or cloud vendors that can reach your systems.

The rest of this guide covers the decisions that follow: which deployment shape, which model size on which GPU, which inference server and how to lock it down, how each control maps to the rule, and how to retrain a model on PHI without the data leaving.

What self-hosting changes, and what it doesn't

The business associate definition in 45 CFR 160.103 turns on what a vendor does with PHI: it covers a person who "creates, receives, maintains, or transmits" PHI on a covered entity's behalf, and explicitly includes "a subcontractor that creates, receives, maintains, or transmits protected health information on behalf of the business associate." A model publisher whose weights you download never touches your patients' records. On that reading, Meta or Google is not your business associate when you run their weights yourself. That is the real gain from self-hosting, and it is the reason a hospital might prefer it to a cloud API offered under a BAA.

The same definition explains why "on-prem eliminates the BAA" overstates it. A colocation provider that maintains the servers holding ePHI, a managed-service firm with remote shell access, a hardware vendor's support engineer who pulls a failed drive, or a cloud provider handling the PHI-free half of a hybrid setup may each meet it. Section 164.308(b)(1) then allows them to handle ePHI "only if the covered entity obtains satisfactory assurances," in a written contract. Whether a specific vendor qualifies depends on what it can actually reach, and that is a question for counsel, not for an architecture diagram.

What never goes away is the Security Rule itself: a risk analysis, a named security official, access control, audit controls, transmission security, device and media controls, a contingency plan and periodic evaluation. Self-hosting makes you the operator of every one of those for the model. HHS's proposed update to the rule, published January 6, 2025 and not yet final, states the point directly: "ePHI, including ePHI in AI training data, prediction models, and algorithm data that is maintained by a regulated entity for covered functions is protected by the HIPAA Rules," and HHS expects a regulated entity using AI to "include the use of such tools in its risk analyses."

Three deployment shapes

Meta's guide to self-hosting Llama in regulated industries names three shapes. They differ in one thing: how a request could ever reach the internet.

Air-gapped. No internet connection at all. Weights arrive on physical media under chain-of-custody procedures, and updates are validated in an isolated test environment before production. Meta says PHI "never has a path to external systems," and positions this for the highest-security settings, such as genomics research. The cost is operational: every model update, security patch and container image has to be carried in.

 [Clinical app] --> [Inference server + GPUs] --> [Audit log store]
        \__________ isolated network, no egress __________/
 Weights and patches arrive on signed physical media only

Private network. The inference servers sit in private subnets with no direct internet route. Weights come from an internal artifact repository, and only authorised clinical applications can reach the endpoint. Meta's sample configuration gives the inference subnet no internet gateway, gives a separate management subnet a NAT gateway for patches, opens port 8000 only to clinical apps, and denies inference-to-internet traffic. Internal traffic runs over mTLS; Meta suggests rotating certificates every 90 days. This is the shape most hospitals with an existing data centre or VPC will land on.

 [EHR / clinical apps] --mTLS:8000--> [Inference subnet: vLLM + GPUs]   (no internet route)
                                       [Management subnet] --NAT--> patches only
 [Internal artifact repo] --> weights

Hybrid. An internal classifier inspects each request. Turns that contain PHI go to the local model; PHI-free turns, such as a general drug-interaction question with no patient attached, go to a cloud model. The weak point is the classifier: any PHI it misses goes to the cloud. A sensible default is to treat the cloud side as if it will see PHI anyway, which means a provider that signs a BAA. AWS's HIPAA eligible services list, updated November 16, 2026, includes Amazon Bedrock and says customers may not use listed services for PHI "without first entering into an AWS business associate agreement."

 [Clinical app] --> [PHI classifier] --PHI--> [Local model, private network]
                                     \--no PHI--> [Cloud model under a BAA]

Sizing the GPUs, and the option general guides skip

Meta's guide sizes three Llama models for regulated self-hosting. At FP16 the memory figures work out to two bytes per parameter, which also gives a quick estimate for sizes it doesn't list: an 8B model needs about 16 GB for its weights alone, before the key-value cache that grows with concurrent requests.

Model (Meta's suggested use) GPUs, per Meta FP16 weights Lambda list price
Llama 3.3 70B (complex reasoning) 2x A100 80GB or H100 140 GB $9.78/hr (2x H100 SXM)
Llama 3.2 11B (clinical notes, decision support) 1x A100 40GB or L40S 22 GB $1.99/hr (A100 40GB)
Llama 3.2 3B (transcription, simple Q&A) 1x A10 24GB or T4 6 GB $1.29/hr (A10)
3B post-trained for one clinical task 1x A10 24GB 6 GB plus a small adapter $1.29/hr (A10)

The prices are Lambda's on-demand cloud rates, a stand-in for the cost of hardware you own, which depends on your purchase contract.

Those rates translate into a rough cost per request once you fix a volume. Assume 20,000 requests a day, 600,000 in a 720-hour month, and that one instance of each setup carries the load. Two H100 SXM GPUs at $9.78 an hour come to $7,041.60 a month, or $11.74 per 1,000 requests; one A100 40GB comes to $1,432.80 a month, or $2.39 per 1,000; one A10 comes to $928.80 a month, or $1.55 per 1,000. A contingency plan under 164.308(a)(7) can mean a second instance for failover, which doubles each figure, and because owned GPUs cost the same whether busy or idle, lower volume raises the per-request cost. Whether one instance actually carries that load depends on note length, concurrency and the server.

The last row is the option Meta's table does not list. Many hospital uses are not a general-purpose assistant but one job done thousands of times a day, such as drafting a discharge summary, suggesting codes, or sorting intake messages. A small open-weight model post-trained on examples of that job runs on the hardware in the bottom row instead of the top one. Hugging Face's PEFT library fine-tunes "a small number of (extra) model parameters instead of all the model's parameters," and its README says a 3B model trains comfortably on a single A100 80GB with LoRA, at a fraction of the memory of full fine-tuning. vLLM can then serve the resulting LoRA adapter on top of the base model "on a per-request basis with minimal overhead." The hardware stays inside the perimeter, and so does the training data.

The trade is quality you have to prove. A JMIR Dermatology viewpoint published August 21, 2026 argues that 7B to 33B models now run on workstations and that local models free practices from "vendor model deprecation," but lists "quantization-induced accuracy loss" and model drift among the governance problems. And size alone doesn't guarantee safety: a January 2026 Scientific Reports study that ran Llama 3.3 70B and two other open-weight models on-premise to write lay summaries of 105 real brain MRI reports found an error rate of 19.7 percent, "warranting expert oversight."

Throughput, time to first token and cost per 1,000 requests for a small task-specialised model against a general 70B model on the same clinical workload have not been measured in any published source. You can measure them on your own hardware. vLLM's vllm bench serve reports request throughput and time to first token (measured from sending the request to the first streamed output); use the synthetic random dataset with input and output lengths matching your notes and a fixed --seed, and vary the seed between runs, because the docs warn that a warm prefix cache inflates repeat results. Run your own de-identified sample at the same settings for the number that matters.

Inference servers and runtime hardening

Meta's guide sorts the three main servers by job. vLLM gives the highest throughput for production, with continuous batching, PagedAttention and an OpenAI-compatible API. TensorRT-LLM gets the most out of NVIDIA GPUs and the lowest latency, for real-time decision support, at the cost of more setup. llama.cpp runs GGUF models offline on CPUs, Apple Silicon and modest GPUs, which suits a single workstation or an edge device; Ollama, which its FAQ says runs locally without seeing prompts, is another workstation option.

Each of them can phone home unless told not to, and that matters on a network that should have no egress:

  • vLLM "collects anonymous usage data by default." Set VLLM_NO_USAGE_STATS=1 or DO_NOT_TRACK=1.
  • TensorRT-LLM collects telemetry unless you set TRTLLM_NO_USAGE_STATS=1, DO_NOT_TRACK=1 or pass --no-telemetry to trtllm-serve.
  • Hugging Face libraries collect some usage data by default. HF_HUB_DISABLE_TELEMETRY=1 turns it off, and HF_HUB_OFFLINE=1 means "no HTTP calls will be made to the Hugging Face Hub," so a model cannot be fetched at runtime. Meta's guide uses TRANSFORMERS_OFFLINE=1 for the same purpose.
  • Ollama says it does not see prompts when run locally, but it has cloud features; disable them with OLLAMA_NO_CLOUD=1. It binds to 127.0.0.1 by default, which you should keep unless a proxy sits in front.

Around the server, Meta recommends minimal base images, containers that run as non-root (runAsNonRoot: true in Kubernetes), image scanning in CI, and network policies that block traffic between namespaces. These flags and policies are worth treating as configuration you audit, not defaults you trust: block egress at the network layer too, so a missed flag fails closed.

Mapping the Security Rule to LLM controls

The rule's text is short and technology-neutral, so the work is translating each standard into something an inference stack does. NIST SP 800-66 Revision 2, published in February 2024, is the federal implementation guide for that translation.

Rule section What it requires LLM control
164.308(a)(1) Risk analysis and risk management Add the model, its logs, prompts and training data to the risk analysis
164.308(b)(1) Written assurances from business associates BAAs with colocation, support, managed-service and cloud vendors that can reach ePHI
164.310(a), (d) Facility access; device and media controls Locked GPU racks; chain of custody for weight media; wipe drives before reuse
164.312(a) Unique user IDs; encryption at rest (addressable) SSO per clinician; encrypted volumes with HSM-held keys; PHI tokenised at ingestion
164.312(b) Audit controls Log user, time, model version and request hash, never prompt text; export to SIEM
164.312(e) Transmission security mTLS between app, classifier and inference server

Two details are worth getting right. First, keep PHI out of the logs. Meta's sample audit record holds a timestamp, user ID, department, model, request hash, token count, a PHI-detected flag and latency, and nothing from the prompt; its guide detects PHI at ingestion with pattern matching and named-entity recognition and replaces it with reversibly encrypted tokens, so identifiers don't surface in logs or error messages. Second, retention: Meta's guide says HIPAA requires seven years for audit logs, but the rule's own retention clause, 164.316(b)(2)(i), sets six years for required documentation and does not name audit logs. Set the period with your compliance team.

Encryption is "addressable" today, which means you must implement it or document why an equivalent measure is reasonable. HHS's proposed rule would remove the distinction between addressable and required specifications and require encryption of all ePHI at rest and in transit, with limited exceptions. For a new system there is little reason to build to the weaker standard.

Retraining on PHI without it leaving the perimeter

A task-specialised model is only as good as the data it learns from, and in a hospital that data is PHI. The whole loop has to stay inside: request traces captured on your servers, evaluation sets built and reviewed by your clinicians, training runs on your GPUs, and checkpoints stored in your artifact repository. Under HHS's stated view, every one of those artifacts is protected ePHI, so they inherit the same access control, audit and encryption as the production system, and the disposal rules in 164.310(d) when you delete an old checkpoint.

In practice that means a fixed, de-identified-where-possible evaluation set scored before any model goes live, a pass mark agreed with clinical leads, expert review of a sample of outputs (the 19.7 percent error rate above is the reason), and a re-run of the evaluation after every retrain to catch drift. Model licences carry their own conditions: Llama 3.2's community licence requires "Built with Llama" attribution, and Google's MedGemma, which comes in 4B and 27B sizes, says its outputs "are not intended to directly inform clinical diagnosis" without validation.

Some vendors sell the post-training loop as a service. Parsec, a small-model lab, describes one that traces requests, builds datasets and evaluations the customer approves, trains with SFT or LoRA and serves the result, and says customers can download their weights; it says a first post-trained model takes about four weeks, without a stated baseline. Its pages describe serving on a shared cluster and do not mention VPC or on-prem deployment for this service, so a team whose PHI must stay inside its own network would need that confirmed before sending traffic.

Bottom line

If a single clinical task drives most of your volume, a small open-weight model post-trained on your own data, served by vLLM on one A10-class GPU in a private network, is the cheapest shape that keeps PHI inside, provided you benchmark it on your own hardware and keep clinician review in the loop. If you need open-ended reasoning, budget for a 70B model on two 80 GB GPUs. Choose air-gapped only if your risk analysis demands it, and hybrid only with a BAA on the cloud side. In every case, sign BAAs with whoever can reach the servers, build to the proposed encryption requirement, and put the model, its logs and its training data in your next risk analysis.

Sources

More in Chips & Compute

All Chips & Compute →