Unified Memory and Integrated Graphics: A Low-Cost Guide to Local LLM Deployment
This article explains how large language models can be deployed locally on affordable consumer hardware using unified memory and integrated graphics. It covers why token generation is often limited by memory bandwidth rather than raw compute, how unified memory expands usable capacity, why quantization reduces model size, why Mixture-of-Experts models benefit from sparse activation, and how open compute interfaces and lightweight inference engines make this approach practical. It also includes configuration tips, expected performance limits, and guidance for choosing between local and cloud inference.
1. Introduction: Getting Past the VRAM Wall
For a long time, running large language models locally has been treated almost as a question of whether you own a GPU with enough VRAM. Mainstream large models often have billions or even tens of billions of parameters. Even with low-precision quantization such as INT4, model weights commonly occupy roughly 10–30 GB, while consumer discrete GPUs usually provide only a few GB to a couple dozen GB of dedicated VRAM. This made questions like “What can you actually do with 4 GB of VRAM?” feel like an unsolvable arithmetic problem.
However, this view assumes one thing: the model must fit into dedicated VRAM. Once that assumption is dropped, and the focus shifts to integrated graphics platforms with unified memory, the conclusion can change significantly. This article explores a practical, low-cost local inference path: no expensive discrete GPU and no cloud API required. Instead, it focuses on running large-parameter models on an affordable consumer mini PC.
2. Clarifying the Bottleneck: Decoding Needs Bandwidth, Not Just Compute
To understand why a small machine can still run large models, it helps to clarify the performance structure of large-model inference. Autoregressive generation has two stages:
- Prefill: processes the input prompt in one pass. It is compute-intensive and mainly depends on compute throughput.
- Decode: generates text token by token. It is memory-bandwidth-intensive and mainly depends on memory bandwidth.
The key is the decode stage. For every new token, the model’s currently active weights must be read from memory. As a result, decode speed is largely bounded by memory bandwidth rather than floating-point compute. A useful analogy is that compute is like the heat of a kitchen stove, while bandwidth is the speed of the serving conveyor. Even a powerful stove cannot serve food faster if the conveyor cannot move quickly enough.
This changes how we evaluate hardware. Rather than focusing only on peak compute, it is more important to understand how much model-weight data can be moved per unit time. This is where unified memory platforms create an opportunity.
3. Unified Memory: Expanding “VRAM” to Total System Memory
Traditional discrete GPUs have separate dedicated VRAM. Its capacity is limited and relatively expensive. Unified memory architecture, or UMA, allows the processor and graphics core to share the same physical memory pool. The integrated GPU is no longer constrained by “a few GB of VRAM”; instead, it can directly use the machine’s system memory.
In practice, a mini PC with 32 GB of shared memory can allocate more than 20 GB to the integrated GPU. By contrast, a discrete GPU with only 4 GB of VRAM may not even be able to hold the weights of a mid-sized model. Raising the capacity ceiling is the first foundation that makes “running large models on a small machine” possible.
Of course, there is no free lunch. System memory, such as common DDR variants, usually has lower bandwidth than the dedicated VRAM of high-end discrete GPUs. This means that the generation speed per token is not necessarily faster than on a top-tier GPU. The tradeoff of unified memory is clear: trade bandwidth for capacity. A portion of peak speed is sacrificed in exchange for the more basic requirement of “fitting the model in memory.” For many local interactive scenarios, being able to run the model at an acceptable speed is more valuable than pursuing maximum throughput.
4. Quantization: Fitting Large Models into Limited Memory
Even with unified memory, directly loading a model at its original precision is still unrealistic. For example, with FP16, a model of around 35 billion parameters needs roughly 70 GB just for weights. Quantization reduces model size by using fewer bits per parameter:
| Precision | Bytes per parameter | Approximate weight size for a 35B model |
|---|---|---|
| FP16 | 2 bytes | ~70 GB |
| INT8 | 1 byte | ~35 GB |
| INT4 | 0.5 byte | ~17.5 GB |
From FP16 to INT4, the weight footprint is reduced to roughly one quarter. This is why running a model with more than 30 billion parameters on a machine with just over 20 GB of memory can work in practice.
That said, quantization is not free. Low-bit quantization introduces some precision loss. In many cases, 4-bit is a pragmatic balance between size and quality. For precision-sensitive tasks, a higher bit width may be appropriate. In addition, actual memory usage must include KV cache, context window, and runtime overhead, so some headroom should be reserved when planning capacity.
5. Sparse Activation: Why MoE Models Fit This Pattern Well
If quantization solves “fitting,” Mixture-of-Experts, or MoE, architecture helps explain “running reasonably fast.” The core idea of MoE is sparse activation: the model contains multiple expert subnetworks, but for each token, only a small subset of experts are routed and activated.
A subtle but important distinction is:
- Capacity requirement: all expert weights of an MoE model must reside in memory, so MoE can still require substantial memory capacity.
- Bandwidth requirement: when decoding a single token, only the activated expert weights need to be read. Therefore, the amount of data read is much smaller than that of a dense model with the same total parameter count.
For example, consider a MoE model with about 35 billion total parameters but only about 3 billion activated per token. Its per-token memory access can be roughly comparable to a small dense model. This means that on a unified-memory platform with “enough capacity but limited bandwidth,” MoE models can play to their strengths: they can hold a large total parameter count while maintaining a reasonable generation speed through lower per-token memory traffic.
This is why sparse models can achieve tens of tokens per second on such hardware. The key is not that the hardware is exceptionally powerful, but that the model structure matches the hardware constraints.
6. Software Stack: Open Compute Interface Plus Lightweight Inference Engine
Putting these ideas into practice requires a well-coordinated software stack with two core roles:
- Cross-platform open compute interface: It allows the integrated GPU to be scheduled as a general-purpose compute device, independent of a single vendor’s toolchain. This lets it directly access model weights stored in system memory. The benefit of an open standard is better compatibility and portability, so the same model can run across different hardware.
- Lightweight open-source inference engine: It handles model loading, quantization and dequantization, memory management, operator scheduling, and KV cache maintenance. It also dispatches compute tasks efficiently to the integrated GPU.
Together, these two pieces make it possible for the integrated GPU to read model weights directly from system memory. This approach also has an implicit advantage: it stays fully local and incurs no API call fees, while sensitive data does not need to leave the machine.
7. Practical Configuration and Tuning
Even when the principles are clear, poor configuration can significantly reduce performance. The following YAML configuration is illustrative and shows how several parameters work. Actual field names depend on the inference engine used.
# Illustrative inference configuration; parameters may vary by enginemodel:quantization: Q4_K_M # Quantization level: balance between size and qualitygpu_offload_layers: -1 # Offload compute layers to the integrated GPU (-1 means all)context:length: 8192 # Context length; larger values increase KV cache usagebatch_size: 512 # Batch size; affects prefill throughputruntime:flash_attention: true # Enables efficient attention and reduces memory usagememory_fraction: 0.7 # Fraction of shared memory the integrated GPU may use
A few practical guidelines:
- Offload as many compute layers as possible to the integrated GPU. For example, set
gpu_offload_layersto all. The more work the integrated GPU handles, the less load on the CPU. - Set a reasonable shared-memory fraction. Balance system usage and integrated-GPU usage, and avoid over-allocating so much memory that the system slows down.
- Set context length according to actual needs. KV cache grows roughly linearly with context length, and overly long contexts can consume available memory.
- Enable efficient attention mechanisms. In long-context scenarios, this can significantly reduce memory overhead.
8. Performance Expectations and Bottlenecks
Setting realistic expectations is key to a satisfying local deployment. Generation speed is mainly affected by:
- Memory bandwidth: It determines the physical upper bound of decode speed and is the most critical bottleneck.
- Quantization level: Lower-bit quantization is usually faster, but may reduce quality.
- Dense vs. sparse: At the same parameter scale, MoE models often perform better because of sparse activation.
- Context length: Longer contexts require larger KV cache, which increases memory pressure and can reduce speed.
- Batch size and concurrency: For single-user interaction, bandwidth utilization is limited; higher concurrency can amortize overhead.
Therefore, this type of platform is best suited for single-user or small-scale interactive use. If high concurrency, large throughput, or very long contexts are required, local hardware will quickly hit limits.
9. Local vs. Cloud: A Pragmatic Choice
Local deployment is not a universal answer. It should be compared with cloud capabilities:
- Local deployment advantages: data does not leave the machine, natural offline availability, no marginal API usage cost, and no network round-trip latency. It is well suited for privacy-sensitive, offline, or frequent lightweight scenarios. The integrated-GPU approach described above is a low-cost example of this route.
- Cloud inference advantages: no upfront hardware investment, elastic access to larger models and higher concurrency, and platform-managed operations and scaling.
When local hardware cannot meet requirements, teams can consider cloud services such as model inference, elastic compute, object storage, and monitoring and alerting offered by cloud platforms like Baidu AI Cloud. They can host and call large models on demand. Monitoring and alerting can help observe latency and throughput, while log services can trace request chains. In many cases, the ideal architecture is a hybrid model: local first, cloud as backup. Sensitive or high-frequency tasks can stay on local hardware, while heavy or high-precision workloads can be sent to the cloud.
10. Conclusion
Running large models on a small machine may seem counterintuitive, but it is grounded in four engineering facts that are often overlooked: decode performance is determined by memory bandwidth; unified memory expands “VRAM” to total system memory; quantization compresses weights into limited capacity; and MoE sparse activation matches bandwidth-constrained platforms. Together, with a cross-platform open compute interface and a lightweight inference engine, this approach gives consumer-grade hardware a realistic path to running models with billions of parameters.
For developers, the bigger lesson is to return to the core tradeoff among memory bandwidth, capacity, and model structure, rather than blindly chasing peak compute or expensive GPUs. Only by understanding the principles, applying quantization appropriately, and choosing local or cloud deployment according to the scenario can you build a practical inference environment at the lowest cost.
