Local Deployment of Large Language Models on a Four-Node Cluster: A Practical Analysis

    This article walks through a real-world four-node on-premises deployment of a large language model, covering the engineering chain behind it: memory tiering, switched network topology, inference engine parallelism, scenario-based load testing, and a selection framework. It explains how compute, memory, interconnect, and unified management are combined into a deliverable private inference capability, and offers a low-risk rollout path for enterprises.

    1. Why On-Premises Deployment of Large Models Has Become a Must-Solve Problem

    Data compliance, predictable inference costs, and availability in network-isolated environments are the core reasons many enterprises move large models back from public cloud APIs to their own data centers. But in practice, teams rarely get stuck on “can the model fit?” Instead, they face an entire engineering chain: how weights are partitioned and stored, how nodes communicate at high speed, how the runtime environment stays consistent, how the inference engine adapts to mixed precision, and how distributed services are orchestrated and observed as one.

    A typical four-node on-premises deployment can be abstracted into four capability layers:

    • Compute and memory layer: provides enough shared memory capacity and parallel compute;
    • Interconnect layer: provides a low-latency, high-bandwidth node-to-node channel with remote direct memory access support;
    • Inference engine layer: handles tensor parallelism, expert parallelism, KV cache management, and batch scheduling;
    • Control and gateway layer: handles model lifecycle, multi-tenant authentication, rate limiting, and invocation observability.

    The approach described here essentially turns these four layers into a “hyper-converged-like” unified infrastructure: compute resources, model serving, and upper-layer AI applications are consolidated under a single management plane. What users face is one inference endpoint, not four machines that must be manually kept in sync.

    2. Reference Hardware Profile and Resource Picture

    A four-node cluster suitable for on-premises inference of large models has roughly the following resource profile (an order-of-magnitude reference for capacity estimation, not specific product specifications):

    Dimension Typical Configuration Design Significance
    Compute nodes 4 next-generation integrated compute units A single unit can host part of a parallel group; four units form one parallel domain
    CPU Around 20 ARM cores per node, about 80 cores total Handles data preprocessing, tokenization, scheduling, and storage I/O
    Memory type Large-capacity LPDDR5X unified memory, hundreds of GB in total Determines the model size and context length that can be supported
    Compute metric PFLOPS-class low-precision sparse compute in total Sets the upper bound on decode throughput
    Local storage Multi-terabyte NVMe SSD Holds cold weights, lookup data, and logs
    Network 100 Gbps-class NIC per node, connected via switches Determines the communication efficiency of tensor parallelism

    Key takeaway: memory capacity decides whether it can run, network bandwidth decides how fast it runs, and storage tiering decides whether memory is sufficient.

    3. Memory Tiering: Putting Limited Memory Where It Matters Most

    The memory pressure of large mixture-of-experts (MoE) models comes from three sources: resident weights, activations plus KV cache, and certain lookup-style structures. The most effective engineering approach is tiering:

    1. Keep hot data resident: distribute the weights of attention layers and high-frequency activation paths across each node’s unified memory;
    2. Offload cold data: push lookup-style, sparsely accessed structures down to local NVMe, trading capacity for high-concurrency random reads;
    3. Govern the KV cache: cap the context limit per request, enable paged cache reuse, and apply prefix reuse per session so long contexts do not drain memory.

    An illustrative capacity estimation logic (pseudocode, expressing the idea only):

    1. # Rough estimate of per-node memory usage for pre-deployment capacity planning
    2. weights_per_node = total_weight_bytes / node_count
    3. kv_cache = batch_size * seq_len * layers * kv_heads * head_dim * dtype_bytes
    4. table_offload = engram_bytes # offloaded to NVMe, does not occupy memory
    5. required = weights_per_node + kv_cache + activation_reserve
    6. assert required <= usable_memory_per_node * 0.85 # reserve for fragmentation and safety margin

    Practical advice: set the safety margin at 80%–85% to leave room for memory fragmentation, burst concurrency, and temporary engine buffers. Otherwise, allocation failures during peak load tests can easily cause batch request timeouts.

    4. Networking: Why a Switched Star Topology Beats Direct Connections

    The bottleneck in multi-node inference is usually communication, not compute. A comparison of two common topologies:

    • Direct node connections (point-to-point): the number of links grows quadratically with node count, cabling becomes complex, and adding a node means reworking the topology;
    • Switched star: all nodes connect to a single high-speed switch, giving a clear topology, simple cabling, and expansion by simply plugging in a cable.

    More importantly, there is the “no relay” property: communication between any two nodes does not require a third node to forward traffic, so end-to-end latency stays stable. This is especially critical for tensor parallelism, where every layer requires an AllReduce. If the network supports Ethernet-based remote memory access such as RoCE, CPU involvement can be significantly reduced.

    Deployment checklist:

    • Confirm the switch’s buffer and flow-control configuration to avoid packet loss caused by incast;
    • Enable huge pages and NIC multi-queue to reduce interrupt jitter;
    • Validate links with point-to-point bandwidth and latency baseline tests before starting distributed inference;
    • Ensure the four nodes run strictly identical OS, drivers, container runtime, and engine versions—version drift is a frequent cause of distributed startup failures.

    5. Inference Engine and Parallelism Strategy

    Using a mainstream open-source inference framework as an example, a four-node deployment typically needs two types of parallelism configured at once:

    1. # tensor parallel size = parallel group within a node; expert parallel size = node count
    2. --tensor-parallel-size 4 \
    3. --enable-expert-parallel \
    4. --kv-cache-dtype fp8 \
    5. --max-model-len 1048576 \
    6. --enable-chunked-prefill

    Key points:

    • Tensor parallelism splits the matrix multiplication of a single layer with frequent communication, so keep it within a high-bandwidth domain;
    • Expert parallelism distributes experts according to MoE routing, with irregular communication patterns that depend on the stability of the switched network;
    • Chunked prefill splits an extra-long prompt into chunks and interleaves it with decode requests, preventing long-document requests from blocking short Q&A;
    • Lowering KV cache precision can trade acceptable accuracy loss for longer context and higher concurrency.

    6. Scenario-Based Load Testing

    Do not report a single “tokens/s” number. Instead, model four categories of real workloads separately:

    1. Everyday Q&A: short input and short output, focusing on time to first token (TTFT) and the single-concurrency experience;
    2. Document processing: long input and short output, focusing on prefill throughput and peak memory;
    3. Complex tasks: multi-turn tool calls and structured output, focusing on stability and error rate;
    4. Coding and agents: long context plus high-frequency small requests, focusing on prefix cache hit rate and tail latency (P95/P99).

    Recommended fixed metrics: TTFT, latency per output token, total throughput, P95 tail latency under concurrency, and energy consumption per request. During testing, raise concurrency step by step and record the throughput inflection point; that inflection point is the actual service ceiling for that scenario.

    7. Selection Evaluation Framework

    When evaluating on-premises options, enterprises can use five questions to quickly narrow things down:

    • Do model size and context length exceed a single machine’s memory limit? If so, multiple nodes are required;
    • Does the data center have high-speed switching and RDMA conditions? Without them, parallel efficiency degrades sharply;
    • Is there a need for unified management (multiple models, multiple tenants, authentication, rate limiting, auditing)?
    • Can cold data be offloaded to local storage to reduce memory procurement costs?
    • Does operations have distributed troubleshooting capability (across three lines: links, versions, and engine logs)?

    8. Conclusion

    The value of a four-node integrated cluster lies not in single-point peak performance but in combining memory tiering, switched networking, engine parallelism, and unified management into a deliverable private inference capability. For most enterprises, the lowest-risk path is to first do capacity estimation and network baseline validation, then run scenario-based load tests in tiers, and finally consolidate services behind a unified gateway. To further lower the barrier to self-building, enterprises can also evaluate general-purpose cloud capabilities such as container platforms, object storage, and monitoring and alerting for auxiliary support, focusing their effort on model quality and business integration.