Four Approaches to Local LLM Deployment: Hardware, Memory, and Trade-offs
This article breaks down four practical options for deploying large language models on your own hardware, ordered from lowest to highest hardware requirements. It starts with a capacity estimation method for weight memory and KV cache, then covers single-GPU low-bit quantization, multi-GPU tensor and pipeline parallelism, CPU and memory offloading, and domestic accelerator cards with a containerized inference platform. Each approach includes its suitable scenarios, bottlenecks, and configuration tips, followed by a comparison table and a selection guide based on context length, concurrency, and workload type.
1. Background: Capability Leaps Meet Cost Pressure
On April 24, 2026, an open-source large model series released a preview version and opened its weights at the same time. The high-end version has roughly 1.6 trillion total parameters with about 49 billion activated parameters; the lightweight version has roughly 284 billion total parameters with about 13 billion activated parameters. Both support million-token context windows and rank among the top open-source models for agentic tasks, world knowledge, and reasoning.
The problem is the bill. The lightweight version is priced at 1 RMB per million input tokens and 2 RMB per million output tokens for pay-as-you-go calls; the high-end version is 12 RMB per million input tokens and 24 RMB per million output tokens. For teams that repeatedly feed code repositories, document sets, and conversation history into a long context, input tokens are usually the main cost, and a monthly bill above 10,000 RMB is not an exaggeration.
The benefits of local deployment go beyond “free”: data stays inside the internal network, latency is controllable, operation can be offline, and models can be fine-tuned or distilled for specific business needs. The costs are hardware investment, operational complexity, and throughput ceilings. The four approaches below are ordered from low to high hardware requirements.
2. Do the Math First: How Much VRAM and Memory You Actually Need
Capacity estimation is mandatory before selection; otherwise you end up with a configuration that boots but cannot run.
Weight memory can be estimated with a simplified formula:
Weight VRAM (GB) ≈ Total parameters (B) × Bytes per parameterFP16/BF16 → 2 bytesINT8 → 1 byteINT4 → 0.5 byte
For 1.6 trillion parameters: about 3200GB in BF16, about 1600GB in INT8, about 800GB in INT4. That is weights only; in practice you also add KV cache, activations, framework overhead, and fragmentation, so reserve another 20%–30%.
KV cache is roughly proportional to context length and concurrency:
KV (GB) ≈ 2 × Layers × KV heads × Head dim × Context length × Concurrency × Bytes / 1e9
Million-token context is a VRAM killer. A single million-token session can consume tens of gigabytes of KV cache alone, so long-context scenarios must be paired with paged attention, KV quantization, or prefix cache reuse.
3. Approach 1: Single Consumer GPU + Low-Bit Quantization
Suitable for individual developers and small teams doing validation and lightweight workloads. Loading an INT4-quantized lightweight version (about 140GB+ for 284 billion parameters) on a 24GB-class consumer card is still not enough. A more realistic positioning for this approach is to run distilled or pruned small and medium models, or to serve as the “front-end inference node” of the whole system, handing long context and complex reasoning to a backend cluster.
Key points:
- Prefer quantization formats with group scaling and zero points; accuracy loss is usually smaller than naive rounding;
- Set context length as needed rather than maxing it out by default; KV cache is a hidden cost;
- Use continuous batching to improve concurrent throughput and avoid serial request queuing;
- Enable KV cache reuse so system prompts and code repository prefixes are computed only once.
Illustrative startup parameters (generic form):
python -m inference_server \--model-path /models/xxx-int4 \--quantization gptq \--max-model-len 32768 \--gpu-memory-utilization 0.90 \--enable-prefix-caching
4. Approach 2: Multi-GPU Tensor Parallelism + Pipeline Parallelism
When a single GPU cannot hold the model, scaling out is the only path. Tensor parallelism splits each layer’s matrices across GPUs; it requires frequent communication and must run over high-speed interconnects. Pipeline parallelism splits by layer; it needs less communication but introduces bubbles, making it suitable across nodes.
Take INT4 with 800GB of weights as an example: 8 GPUs with 80GB each (640GB) is still insufficient, so you need 8–16 GPUs plus KV quantization; with BF16, you need tens of GPUs. Planning recommendations:
- Prioritize high-speed interconnects within a single node; insufficient cross-node bandwidth sharply reduces tensor parallelism efficiency;
- Choose a tensor parallelism degree that divides the GPU count to avoid uneven splits;
- Use paged attention to reduce KV fragmentation and continuous batching to fill the pipeline;
- Monitor per-GPU VRAM levels to prevent one card from overflowing first and forcing a group restart.
This approach is the mainstay of on-premises production: throughput and latency are the most controllable, but cluster utilization depends on load testing and tuning.
5. Approach 3: CPU and Memory Offloading (Running Large Models on Modest Hardware)
With one consumer GPU plus large memory capacity, you can offload weights: keep most layers in memory and swap them into VRAM on demand. For hardware, memory capacity should be at least 1.2× the weight size, and memory bandwidth directly determines token generation speed.
Suitability and trade-offs:
- Suitable for latency-insensitive scenarios such as offline batch processing, overnight data jobs, and personal knowledge base Q&A;
- Generation speed is constrained by memory bandwidth, so interactive experience degrades noticeably;
- A layered schedule with a small model on the hot path and a large model on the cold path can balance responsiveness and quality;
- Quantizing to INT4 and enabling memory-mapped reads significantly reduces startup time and peak usage.
6. Approach 4: Domestic Accelerator Cards and Integrated Inference Platforms
For enterprise compliance and long-term operations, you can choose a cluster of domestic accelerator cards, together with a container platform, image registry, log service, and monitoring and alerting to build a unified inference foundation. In Baidu AI Cloud and common industry technical solutions, general capabilities such as containerized inference services, elastic scaling, model file object storage, and full-link monitoring are typically provided, making it easier to standardize deployment, canary release, and rollback.
Engineering checklist:
- Store model weights in object storage and have nodes pull them on demand, so local disks do not become the bottleneck;
- Use container orchestration for health checks and automatic restarts, and set readiness probes to prevent traffic from hitting instances that have not finished loading;
- Build a metrics dashboard: throughput, time to first token, per-token latency, VRAM level, queue length;
- Set quotas and rate limits so a single business cannot saturate the cluster;
- Put a gateway in front of the inference service for authentication, auditing, and usage statistics, providing data for capacity planning.
7. Comparison and Selection Advice
| Approach | Hardware requirement | Suitable scenario | Main bottleneck |
|---|---|---|---|
| Single-GPU quantization | Low | Validation, lightweight workloads, front-end nodes | VRAM capacity |
| Multi-GPU parallelism | High | On-premises production, high concurrency | Inter-GPU interconnect and tuning |
| Memory offloading | Medium | Offline batch processing, personal knowledge base | Memory bandwidth |
| Accelerator card platform | Medium-high | Enterprise compliance and long-term operations | Ecosystem fit and operations system |
Recommended selection order: first determine whether the workload is interactive or batch, then estimate context length and concurrency, and finally load test time to first token and throughput with real business samples to decide GPU count and parallelism degree. If monthly call volume is stable over the long term and data is sensitive, the payback period for local deployment is usually clearly better than pay-as-you-go; if traffic fluctuates heavily and samples are not yet settled, validating demand with a cloud API first and then gradually moving to local deployment is the safer path.
