Private LLM Deployment for Public Health: A Practical Guide to On-Premises Architecture and Compute Reduction

    This article explains how public health agencies can deploy large language models fully on-premises when sensitive data cannot leave the internal network and budgets are limited. It presents a five-layer private deployment architecture, three technical paths for reducing compute requirements (flash-based memory expansion with parameter residency scheduling, parameter-efficient fine-tuning, and quantization with heterogeneous compute), a data engineering approach for public health fine-tuning, security and auditability controls, and a four-stage rollout plan with common risks. Readers will learn how to trade architecture for cost while keeping data in-domain and weights iterable.

    1. The Problem: Two Constraints in Sensitive Data Scenarios

    Public health agencies applying large language models typically run into two walls at the same time.

    The first is a compliance wall. Decades of health records, infectious disease surveillance data, and immunization program data are highly sensitive personal information. Under data security and personal information protection regulations, this data generally may not leave the internal network or cross borders, which makes public cloud inference services unusable by default.

    The second is a cost wall. Full-parameter fine-tuning of a model with tens of billions of parameters usually requires eight to sixteen high-end accelerator cards. Once servers, power, and data center upgrades are included, the investment can reach several million yuan, which is difficult for municipal-level agencies to afford.

    Looking at both walls together, the conclusion is clear: the viable solution is not “buy bigger cards,” but “reduce compute demand at the same security level.” This requires optimization on three fronts at once—the model, memory, and hardware—rather than piling on hardware at a single point.

    2. Overall Architecture: An Intranet Loop for Training and Inference

    A deployable private architecture typically has five layers:

    • Hardware layer: a small number of general-purpose GPUs in a mixed configuration with heterogeneous AI accelerators;
    • Memory expansion layer: middleware that virtualizes an enterprise-grade flash pool into extended memory addressable by the accelerators;
    • Model layer: a base model plus domain-specific incremental weights (adapters);
    • Platform layer: training scheduling, inference serving, a model registry, and an evaluation pipeline;
    • Security layer: identity authentication, least-privilege access, full auditing, and data masking.

    The key design principles are “data stays in-domain, weights stay iterable, compute stays elastic.” Data is cleaned and used for training inside an isolated network segment, and the only output is a small incremental weight file that is easy to version and roll back.

    3. Three Technical Paths to Compute Reduction

    3.1 Memory Expansion and Parameter Scheduling

    When flash is used as extended memory, the core idea is to keep cold parameters on flash and hot parameters in VRAM, with middleware handling block-level swapping in and out. The logic looks like this:

    1. # Pseudocode: tiered parameter residency policy
    2. def build_residency(model, hot_ratio=0.3):
    3. tensors = list(model.named_parameters())
    4. hot = tensors[: int(len(tensors) * hot_ratio)]
    5. cold = tensors[int(len(tensors) * hot_ratio) :]
    6. for name, p in hot:
    7. p.device = "cuda" # hot parameters stay resident in VRAM
    8. for name, p in cold:
    9. p.device = "flash_pool" # cold parameters scheduled by middleware on demand
    10. return model

    Three engineering points matter most: block granularity (too large wastes bandwidth, too small adds scheduling overhead), prefetch depth (swap in ahead of time based on layer order), and write-back policy (training must guarantee persistence consistency for gradient updates).

    3.2 Parameter-Efficient Fine-Tuning

    With low-rank adaptation and prefix or prompt tuning, only a very small set of new parameters is trained while the base weights stay frozen. The benefit is twofold: fewer trainable parameters reduce VRAM and compute demand, and the artifact shrinks from tens of gigabytes to tens of megabytes, making it easy to distribute to multiple district and county nodes.

    1. # Illustration: freeze the base model, train only low-rank increments
    2. for n, p in model.named_parameters():
    3. p.requires_grad = "adapter" in n

    3.3 Quantization and Heterogeneous Compute

    On the inference side, weight quantization (such as 8-bit or 4-bit) reduces bandwidth pressure. On the training side, compute-intensive matrix operations go to the GPU, while memory-bound operations or specific operators go to heterogeneous accelerators, with a unified runtime routing operators. The difficulty of heterogeneous compute is not peak throughput but data movement and synchronization overhead, so computation for the same layer should complete continuously to minimize cross-device round trips.

    4. Data Engineering for Public Health Fine-Tuning

    Domain performance is capped by data, not by parameter count. Four categories of corpus are recommended:

    1. Standards and guidelines: diagnostic and treatment protocols and prevention plans, used to establish a baseline of terminology and workflow;
    2. Masked question-answer pairs: health consultations and report interpretation, structured as instruction-response pairs;
    3. Structured data converted to text: turning statistical reports into natural language descriptions to improve data interpretation;
    4. Refusal and boundary samples: defining what cannot be answered to suppress out-of-scope advice.

    The data pipeline must include masking and de-identification steps, and the training set must be split to prevent leakage. Evaluation should use three dimensions—preserved general capability, improved domain task performance, and refusal accuracy on safety cases—so that a rising domain score does not hide a collapse in general capability.

    5. Security, Compliance, and Auditability

    • Network isolation: training and inference both run on the internal network, physically or logically isolated from the internet;
    • Storage encryption: static data and weight files are encrypted at rest, with keys managed by the agency itself;
    • Access control: least privilege by role, with all model calls logged;
    • Audit loop: input digests, caller identity, timestamps, and output digests are recorded to support after-the-fact tracing;
    • Output guardrails: requests involving diagnostic conclusions carry an explicit notice that the result is for reference only and requires professional review.

    6. Rollout Plan and Common Risks

    A four-stage rollout is recommended: first validate private inference of the base model on a single node; then add low-rank fine-tuning to run domain tasks end to end; then introduce flash expansion and heterogeneous cards to scale up trainable model size; finally replicate across multiple nodes with centralized operations.

    Three risks are common. First, extended memory bandwidth becomes the bottleneck and throughput falls short of expectations, which should be addressed by analyzing hotspots and adjusting the residency ratio. Second, incomplete operator coverage on heterogeneous accelerators causes fallback to the general path, so the operator list should be verified in advance. Third, missing evaluation leads to something that “looks usable,” so an evaluation set must be built before any production launch.

    7. Summary

    When data cannot leave the domain, the core methodology for LLM deployment is “trading architecture for cost”: extended memory absorbs parameter scale, parameter-efficient fine-tuning compresses training overhead, heterogeneous compute improves output per unit of power, and the intranet loop with auditing satisfies compliance. This path has been validated at multiple municipal-level nodes, with hardware requirements and total investment significantly lower than traditional full-parameter approaches, offering direct reference value for similar sensitive industries.