Deploying Large Language Models on Air-Gapped Intranets: A Low-Cost Fine-Tuning Pathway for Public Health Institutions
Many public health and disease control agencies hold sensitive epidemiological data that cannot leave their intranets, yet face tight hardware budgets when adapting large language models to domain work. This article outlines a practical pathway: keeping all equipment on-premises, using parameter-efficient fine-tuning (LoRA/QLoRA) instead of full-parameter training, and—where appropriate—offloading cold model states to flash storage to reduce GPU count. It covers hardware route comparison, memory-tiering prerequisites and benchmarking checklists, a step-by-step fine-tuning workflow with a sample configuration, evaluation thresholds, a security and compliance checklist, and the boundaries and pilot strategy for responsible rollout.
Key Takeaways First
When data cannot leave the intranet and the budget is limited, three measures form a relatively stable starting point: deploy all equipment inside the agency’s network, use parameter-efficient fine-tuning instead of full-parameter training, and use tiered memory expansion to reduce the number of GPUs required. The first two can be implemented directly by most institutions. The benefits of the third depend on model size, hardware topology, and access patterns, and must be verified through real-world testing—it should not be used as a procurement justification on its own.
Two Constraints That Shape the Design
Disease control agencies accumulate years of infectious disease reports, surveillance data, and epidemiological investigation records containing identity and health information. Under data protection and personal information privacy laws, the handling of such data is strictly regulated. Public cloud inference and cloud-based fine-tuning are therefore usually off the table.
Budget is the second constraint. Fully fine-tuning a model with tens of billions of parameters typically requires multiple high-end GPUs—a capital expense beyond the reach of most prefecture-level agencies. The design goal is therefore not maximum parameter scale, but a usable, verifiable domain model delivered within a controllable cost envelope.
Comparing Hardware Routes
Three routes are common in practice, each with different prerequisites.
| Route | Core idea | Best suited for | Main cost or risk |
|---|---|---|---|
| Pure GPU scaling | Add GPUs until memory and compute suffice | Large budgets, larger models | High hardware cost, complex operations |
| GPUs + AI accelerator cards | GPUs handle core compute; accelerator cards share matrix operations and memory duties | Small-to-medium models on a budget | Driver, kernel, and inference framework compatibility must be verified item by item |
| Tiered memory expansion | Hot data in VRAM; cold data in a flash pool managed by middleware | VRAM capacity is the main bottleneck and access shows locality | Limited bandwidth and latency; performance depends heavily on scheduling |
Before selecting a route, determine whether the bottleneck is compute or memory. If training steps are slow but VRAM is sufficient, prioritize adding compute. If the model simply does not fit in VRAM, consider quantization, LoRA, or tiered expansion. The two bottlenecks have different remedies; mixing them increases debugging cost.
Tiered Memory Expansion: Conditions and Metrics to Validate
How it works: model weights and optimizer states are tiered by access frequency. During LoRA fine-tuning, the base weights are frozen and read-only, so they belong in the cold tier. The low-rank adaptation matrices and their optimizer states are small and frequently accessed, so they stay in VRAM. This access pattern makes prefetching and paging potentially effective, but actual gains must be measured on the target machine.
The following factors directly affect performance, and each should be logged during a pilot:
- Flash bandwidth and PCIe topology: Effective bandwidth is determined jointly by the NVMe drives, controllers, and PCIe topology. Measure sustained read bandwidth on the target server; do not rely on vendor-marketed figures.
- Prefetch hit rate: A low hit rate forces the GPU to wait for data, sharply reducing training throughput. Log wait time per training step.
- Access latency and throughput: Measure training and inference separately. Inference services are more sensitive to time-to-first-token; training cares more about throughput.
- Flash write endurance: Frequent writes during training consume write endurance. Estimate replacement cycles based on the drives’ rated write volume.
- Consistency boundaries: Verify through fault-injection testing whether weight write-back completes correctly after power loss or abnormal process termination.
Suggested benchmark checklist:
- VRAM usage curve for the target model at the target precision and sequence length.
- Per-step training time on the same fine-tuning task, comparing an all-VRAM setup with the tiered setup.
- P50 and P95 latency as concurrent requests scale from 1 to the target volume.
- Recovery time and data integrity results after power loss or forced process termination.
Only when all of these metrics meet the agency’s business requirements should tiered expansion be adopted into the formal design.
Implementing Domain Fine-Tuning
1. Corpus Construction
Consolidate internal materials such as disease control guidelines, surveillance reports, and epidemiological investigation records; de-identify them first, then annotate them as instruction-tuning data. Fields such as ID numbers, names, and addresses should be structurally replaced or masked. Document the replacement rules and retain audit logs. Even after de-identification, samples require manual spot checks, with the sampling ratio specified in the project plan.
2. Parameter-Efficient Fine-Tuning
LoRA trains only the low-rank adaptation matrices while freezing the base weights, keeping VRAM requirements and catastrophic forgetting risk relatively low. QLoRA goes further by quantizing the base weights to 4 bits, compressing VRAM usage further at the cost of slower training and accuracy loss that must be evaluated. Selection principle: choose LoRA when VRAM is sufficient; choose QLoRA when VRAM is tight and the business can tolerate some accuracy loss.
The following is an illustrative configuration. Values are shown only to demonstrate the format and must not be used in production as-is; fill in and document each item in the pilot report based on actual hardware and model.
# Illustrative configuration; all values must be replaced per actual model and hardwarefinetune:base_model: "<model name and version>" # log parameter scale, source, and licensemethod: lora # switch to qlora if VRAM is tightprecision: bf16 # use fp16 if the accelerator card lacks bf16 support, and record the reasonquantization: null # set to nf4 (4-bit) when using QLoRAmax_seq_len: 2048 # must cover the longest typical input in the workloadlora_rank: 16lora_alpha: 32lora_dropout: 0.05target_modules: [q_proj, k_proj, v_proj, o_proj]learning_rate: 1e-4per_device_batch_size: 4gradient_accumulation: 8 # effective batch size = per-device batch × number of devices × accumulation stepstrain_dataset: "on-prem de-identified instruction set; log version and sample count"eval_dataset: "public health evaluation set, physically isolated from training data"seed: 42 # fix the random seed for reproducibility
3. Evaluation and Alignment
The evaluation set must be physically isolated from the training set and cover terminology comprehension, policy Q&A, reasoning accuracy, refusal behavior, and response safety. Medical questions require professional annotators and reviewers.
The following thresholds are suggested starting points; the specific values should be set by the agency’s expert panel according to business risk:
- Terminology Q&A accuracy: measured against an expert-annotated gold-standard set, recommended at no lower than 90%.
- Medication and clinical advice questions: all high-risk samples go through manual review; the error rate must stay below the agency-defined ceiling.
- Refusal rate and false refusal rate: tracked separately to avoid over-refusal driven by risk aversion.
- Regression test set: at least 500 items per iteration to detect regressions in older capabilities.
4. Iterative Rollout
Start with a low-risk pilot inside the intranet, such as an intelligent Q&A assistant. Collect user feedback and evaluation results, iterate on fine-tuning, and once stability is confirmed, gradually extend to scenarios like investigation support and report generation. Define exit criteria for each stage: if metrics fall short, return to the previous stage rather than pushing forward blindly.
Security and Compliance Checklist
Security measures should cover five layers—network, data, keys, access, and application. Confirm each item before go-live.
Network layer
- Intranet has no internet egress; firewall rules have been double-reviewed.
- Model weight updates are performed only via offline media or controlled transfer, with approval records and logs for each transfer.
- Transfer media undergo virus scanning and integrity checks before intake, with hashes recorded.
Data layer
- Training data and model weights are encrypted at rest and in transit.
- Sensitive corpora are stored in tiered repositories with least-privilege access.
- Data disposal follows documented destruction procedures, including residual data in flash pools, with destruction records retained.
Key layer
- Keys are held by an HSM or dedicated key management service; never written into code, config files, or logs.
- Key rotation cycles and responsible owners are defined.
Access layer
- End-to-end audit logs cover training data reads/writes, weight reads/writes, and inference calls.
- Critical operations such as deletion, export, and weight publishing require two-person review.
Application layer
- Inference outputs are filtered to prevent indirect reconstruction of personal information through multi-turn questioning.
- Abnormal outputs trigger alerts and enter a manual handling workflow.
Pilot Scope and Boundaries
This article describes a candidate pathway, not a standard solution validated across many institutions. It cites no completed multi-site benchmark data. Whether to adopt it should be decided by your own pilot results.
Additional boundaries to keep in mind:
- Model output serves only as supporting material; epidemiological judgments, outbreak assessments, and clinical advice require confirmation by professionals.
- Performance conclusions for tiered expansion depend on the specific hardware and model; changing flash drives or PCIe topology requires re-benchmarking.
- Fine-tuning data quality determines the model’s ceiling. If de-identification rules are incomplete, the model may emit un-de-identified information, so the de-identification workflow needs its own audit.
Three directions are worth watching going forward: supporting a wider range of accelerator cards, improving middleware scheduling to handle larger parameter scales, and building corpus engineering practices for public health so that localized, low-cost fine-tuning can take root in grassroots institutions.
