Running Large Models Locally on Low-Cost Hardware: The Integrated GPU and Unified Memory Approach
Running large language models on a low-cost local machine is less about compute than about memory capacity, bandwidth, and the software stack. This guide explains why 8–16 GB discrete GPUs fall short, how integrated GPUs differ across unified memory architectures (Apple silicon) and shared system memory (AMD and Intel x86 iGPUs), which frameworks, backends, and quantization formats to use, and how to budget memory correctly by adding weights, quantization metadata, KV cache, and system overhead. It also covers the memory-bandwidth limit behind low token throughput, prefill versus decode latency, how to decide between local and cloud inference, and a troubleshooting checklist for slow generation. Included are two Python estimators for weight size and a conservative total-memory budget, plus guidance on running agent workflows safely.
1. What Actually Blocks Local LLM Deployment
For developers who want to run multi-billion-parameter models on their own machine, the first obstacle is rarely compute. It is memory capacity.
Even after quantization, model weights can still occupy tens of gigabytes. Consumer discrete GPUs commonly ship with 8 GB, 12 GB, or 16 GB of VRAM. When a model does not fit, the overflow is handled either by CPU system memory or by leaving some layers unoffloaded and computing them on the CPU. In both cases, data crosses PCIe constantly, generation speed collapses, and the process may fail outright for lack of memory.
So the problem is not “buy another GPU.” It is redesigning the memory path. Local inference used to be treated as an exercise in stacking VRAM, but on a low-cost machine a more realistic path is to use large system memory together with an integrated GPU or a unified memory architecture, keeping the model in memory that both the CPU and the GPU can address directly.
2. Can an Integrated GPU Run an LLM? Unified Memory vs. Shared Memory
A traditional discrete GPU has its own VRAM, and weights must fit into that pool as completely as possible. An integrated GPU is different: it typically has no large dedicated memory of its own and instead uses system memory. But “integrated GPU shared memory” is not one single design, and two categories need to be kept apart.
The first category is a unified memory architecture, such as Apple silicon. CPU and GPU share the same physical memory pool, so the integrated GPU can address model weights held in system memory directly, and capacity planning is more straightforward. The caveat: CPU and GPU still share the same bus and bandwidth. Unified memory does not mean unlimited bandwidth.
The second category is integrated GPU shared memory on x86 platforms from AMD and Intel. Here the BIOS usually carves out a reserved portion as dedicated memory, and at runtime the GPU can additionally borrow system memory on demand through mechanisms such as GTT. The integrated GPU and the CPU contend for the same memory bus, so real throughput depends on memory bandwidth, the driver, and the inference backend.
The conclusion is straightforward: an integrated GPU can run large models without buying a separate card, but this is not zero additional cost. The value of an integrated GPU is that no extra card is required, which suits mid-sized models and privacy-sensitive use cases. Backend support, however, is limited. ROCm support for AMD’s consumer integrated GPUs is generally limited, so many setups default to Vulkan. Intel integrated GPUs are worth pairing with a backend such as IPEX-LLM. On Apple platforms, Metal or MLX are the usual choices.
On capacity: a machine with 32 GB of system memory can in theory run roughly 20 GB-class 4-bit weights, but the headroom left for the OS, display, KV cache, and runtime is tight. If you want stable larger contexts or multi-turn conversations, plan for 64 GB as a starting point.
3. Making Integrated GPUs Work Well: Frameworks, Formats, Quantization
Hardware is only the foundation. Whether a model actually runs depends on the software stack. Common combinations today are:
- Open-source inference frameworks: llama.cpp, Ollama, and LM Studio. All of them load models locally and offer GPU offloading to varying degrees.
- Inference backends: llama.cpp’s Vulkan backend covers many integrated GPUs; Intel integrated GPUs can be paired with IPEX-LLM; Apple platforms can use Metal or MLX. Vulkan is a cross-vendor open interface, which makes it easier to cover different integrated GPU devices than a stack bound to a single vendor ecosystem.
- Model format and quantization: local deployment commonly uses the GGUF format, with quantization levels such as Q4_K_M, Q5_K_M, and Q8_0.
Lower is not automatically better when quantizing. A practical way to choose:
| Quantization | Size and speed | Quality tendency | When to use it |
|---|---|---|---|
| Q8_0 | Larger, slower | Better quality retention | Plenty of memory, stable output required |
| Q5_K_M | Medium size | Reasonably balanced | Worth trying on 32 GB+ machines |
| Q4_K_M | Smaller, faster | Common balance point for local deployment | First choice for 20 GB-class models |
| 3-bit or lower | Most memory-efficient | Noticeable quality loss | Only when the task tolerates errors |
For MoE sparse models, one common misconception needs correcting. An MoE model activates only a few experts per token, but all expert weights still have to stay resident in memory, so the total capacity requirement does not drop because of sparse activation. What drops is the amount of weight read and the amount of computation per single decode step. In addition, the prefill stage may activate more experts, which is why the speedup on long inputs is usually less pronounced than during decode.
4. Memory Planning: Do the Math First
Before deploying locally, estimate the memory requirement rather than launching whatever appears to fit. The minimal formula is:
weight size ≈ parameter count × bytes per parameter
where bytes per parameter = quantization bit width ÷ 8. For 4-bit quantization, that is 0.5 bytes per parameter.
The following code gives a quick estimate of weights plus rough runtime overhead:
from decimal import Decimal, ROUND_HALF_UPdef estimate_memory_gb(params_billion, bits_per_weight):# Weight footprint: params (billions) x bytes per parameterp = Decimal(str(params_billion))b = Decimal(str(bits_per_weight))weights = p * b / Decimal(8)# Rough runtime overhead, for initial screening onlyoverhead = weights * Decimal("0.18")total = weights + overheadreturn float(total.quantize(Decimal("0.1"), rounding=ROUND_HALF_UP))# Example: ~35 billion parameters, 4-bit quantizationprint(estimate_memory_gb(35, 4)) # 20.7# Example: ~26 billion parameters, 4-bit quantizationprint(estimate_memory_gb(26, 4)) # 15.3
This result is only a screening value, not a final budget. A real deployment has to add three more categories of overhead:
- Quantization metadata: K-quant formats in GGUF, for example, can add roughly 0.5 bits per weight. On a 35B model, that alone can reach gigabyte scale.
- KV cache: strongly tied to context length. A simplified formula is: layers × 2 (K and V) × number of KV heads × head_dim × context length × number of sequences × bytes per element. For a 30B-class model at 8K context, the KV cache is typically already in the gigabytes.
- System and runtime overhead: the operating system, display services, browser, inference runtime, and caches usually need another 6–10 GB reserved.
So judging whether a machine can run a model is not a matter of “allocating just over 20 GB to the model.” It is a matter of whether weights + quantization metadata + KV cache + system overhead together stay below physical memory. Use decimal GB rather than GiB for these figures to avoid the familiar “nominally enough, actually not enough” gap.
For a more conservative budget:
def budget_gb(params_b, bits, kv_cache_gb, system_gb=8):weights = params_b * bits / 8quant_meta = params_b * 0.5 / 8return round(weights + quant_meta + kv_cache_gb + system_gb, 1)# 35B, 4-bit, ~2GB KV cache for 8K context, 8GB reserved for the systemprint(budget_gb(35, 4, 2, 8)) # 29.7
A 32 GB machine running a 35B-class 4-bit model therefore has very little headroom left, and pressure rises quickly with longer contexts and more sequences.
5. Throughput: Why Local Generation Feels Slow
The core metric for a smooth local experience is tokens per second (tok/s). On integrated GPU and unified memory platforms, the main bottleneck during decode is usually memory bandwidth rather than compute, because every generated token requires reading the relevant weights from memory. Bigger models and lower bandwidth mean slower output.
A rough formula gives the theoretical ceiling:
theoretical tok/s ≈ memory bandwidth ÷ weight bytes read per step
For 20 GB-class 4-bit weights, assuming a full weight read:
| Memory bandwidth | Theoretical ceiling | Typical real-world range |
|---|---|---|
| ~120 GB/s | ~6 tok/s | ~4–5 tok/s |
| ~270 GB/s | ~13 tok/s | ~8–11 tok/s |
| ~410 GB/s | ~20 tok/s | ~12–16 tok/s |
Real throughput is typically 60%–80% of the theoretical value, because of KV cache reads, memory latency, inference framework efficiency, and background processes. It therefore does not hold universally that “ten to twenty-odd tokens per second” applies on every machine; model size and memory bandwidth conditions have to be stated alongside it.
Two latency figures also need to be separated:
- Time to first token, the prefill stage: generally determined by compute, context length, and batching. Longer inputs mean longer waits.
- Subsequent generation speed, the decode stage: driven more by memory bandwidth and the model’s activation volume.
For chat and writing tasks, an integrated GPU platform with sufficient bandwidth can usually deliver an acceptable experience. Code completion depends not only on generation speed but also on time to first token, toolchain support, and context management. If time to first token is too high, the interactive experience still suffers.
The main factors affecting throughput:
- Memory bandwidth: the most critical variable; higher bandwidth means faster decode.
- Model size and activation volume: more parameters and larger per-step activation both slow things down.
- Quantization precision: lower bit widths move less data and are usually faster.
- Context length: long contexts increase both KV cache and compute overhead.
- Inference backend and driver: support for Vulkan, Metal, IPEX-LLM, and others varies by backend.
6. From Chat to Agents: Value and Boundaries of Local Workflows
The value of local inference goes beyond chat. Because the model runs entirely on the machine, data does not pass through an external API, latency is controllable, and there are no per-call charges. That makes it possible to run more complex agent workflows: having the model plan tasks, call local tools, read and write files, and carry out multi-step reasoning. As long as the inference framework exposes a standard calling interface, upper-layer applications can embed a local model into automation pipelines much as they would orchestrate a cloud service.
The more capable the agent, the more important explicit safety boundaries become. At minimum, follow these principles:
- Least-privilege tool access: grant only the file, network, or system permissions the current task actually requires.
- Run in a sandbox or container: avoid letting the model operate directly on critical directories or system services.
- Back up before operating: take a snapshot or backup before writing, deleting, or moving files.
- Human confirmation for high-risk actions: deleting data, executing scripts, and modifying system configuration must be confirmed by a person.
- Treat untrusted input as untrusted: both model output and tool returns should be treated as untrusted input to guard against prompt injection or malicious instructions.
- Content compliance: locally generated content still needs compliance review. “It runs locally” is not a reason to skip it.
Also, “data stays local” should be understood as data not being transmitted to an external API, not as absolute security. If the machine itself is compromised, runs malicious scripts, or connects to untrusted plugins, data leakage can still occur.
7. Use Cases, Limitations, and the Local-vs-Cloud Tradeoff
The advantages of a low-cost integrated GPU or unified memory setup are clear: low hardware spend, no extra card to buy, data kept on the machine, offline operation, and no ongoing API charges. The limitations are equally clear: speed is capped by memory bandwidth, memory capacity determines the largest model you can host, and long contexts and high concurrency generally fall short of a professional cloud inference cluster.
The sensible approach is a layered combination:
- Local is a good fit for: privacy-sensitive workloads, offline use, high-frequency lightweight calls, document summarization, code assistance, knowledge-base Q&A, and personal agents.
- Cloud is a good fit for: high concurrency, very long contexts, very large models, and production tasks with strict requirements on time to first token and throughput.
Some quantifiable signals that it is time to move to the cloud: time to first token frequently above 2 seconds, a need for multi-user concurrency, contexts that exceed the local memory budget, model sizes beyond what local hardware can host, or tasks that require a stable SLA and elastic scaling.
If you keep a cloud fallback, mainstream public cloud GPU or CPU instances, object storage, logging, and monitoring and alerting can cover it. Local handles low-cost everyday inference; the cloud handles elasticity and heavy workloads.
A simplified comparison:
| Option | Cost structure | Available capacity | Speed characteristics | Best fit |
|---|---|---|---|---|
| Integrated GPU / unified memory, local | One-time machine purchase | System memory, 32 GB starting point, 64 GB more stable | Bound by memory bandwidth | Privacy, offline, light-to-moderate inference |
| Discrete GPU, local | Higher graphics card cost | VRAM usually 8–24 GB | Faster, but limited by VRAM | Lower latency and higher throughput |
| CPU only | Low hardware cost | Larger system memory | Usually slowest | Fallback, very small models |
| Cloud | Pay as you go | Highly elastic | Scales, strong concurrency | High concurrency, long context, heavy workloads |
8. FAQ and Troubleshooting Checklist
Can an integrated GPU run a large model?
Yes, provided three conditions are met at once: enough memory capacity, enough memory bandwidth, and adequate backend support. 32 GB usually suits only a 20 GB-class 4-bit model with little headroom; 64 GB is safer.
How much memory does local inference need?
Do not look at weight size alone. Estimate weights + quantization metadata + KV cache + system reserve. A 30B-class model at 4-bit has roughly 15–18 GB of weights, and once KV cache and system overhead are added it typically needs more than 32 GB; 64 GB is advisable for long contexts.
Why is local generation slow?
Check memory bandwidth, quantization bit width, context length, and the inference backend first. Slow first token usually means prefill is limited by compute or context length; slow generation usually means decode is limited by bandwidth.
4-bit or 8-bit?
4-bit is the sensible default starting point for local deployment because of its friendlier size and speed. 8-bit suits cases that are more quality-sensitive and have enough memory. If 4-bit shows obvious logic errors, malformed output, or degraded instruction following, try Q5_K_M or Q8_0, or move to a model with more parameters.
What if speed is far below expectations?
Work through this order: whether the integrated GPU backend is really being used; whether all layers are offloaded; whether memory frequency or dual-channel mode is misconfigured; whether background processes are competing for bandwidth; whether the context is too long; whether the quantization was loaded incorrectly; and whether thermal throttling is degrading performance.
Overall, the key to running large models on a low-cost machine is not blindly stacking VRAM, but doing the memory math first and then matching the integrated GPU, quantization, inference backend, and use case. With reasonable planning, an ordinary machine with plenty of system memory can serve as a usable local inference node.
