Local LLM Deployment on ARM + Unified Memory: A Practical Guide
This guide walks through running local inference and agents on ARM desktop platforms with large unified memory. It explains why the shared address space matters, how to estimate memory needs for a given model and context length, which aarch64-native toolchain to use, a working llama.cpp server configuration, baseline metrics and troubleshooting steps, an agent-driven environment setup workflow, and the network and authentication boundaries a local inference service needs before anyone else can reach it.
1. Why ARM + Unified Memory Is Worth Choosing
Decades of PC progress largely amounted to users being forced to upgrade their skills: where software gets installed, which menu layer hides a setting, how dependencies are configured, how errors are diagnosed — the learning cost was silently pushed onto the person using the machine. Now that local model capability has caught up, that default can be rewritten. Deterministic work such as environment preparation can be handed to the machine, while people keep judgment and accountability. This article focuses on one concrete technical problem: getting local inference and agents running on an ARM-based desktop platform with large unified memory, with steps you can follow directly.
There are two reasons to choose this form factor.
1. Data movement disappears. Under traditional architectures, the CPU and a discrete GPU each have their own memory, and weights are copied back and forth between system memory and VRAM. Unified memory lets the CPU, GPU, and NPU share the same address space, so copy overhead goes away and total system memory capacity directly becomes the ceiling on model size.
2. Capacity determines how large a model you can run. Only at the hundred-gigabyte level of unified memory can “a quantized large-parameter model + long-context KV cache + multiple models resident in parallel” hold true on the same desktop machine.
Unified memory vs. CPU + dedicated VRAM
| Dimension | Unified memory (ARM desktop / mini PC) | CPU + dedicated VRAM (traditional x86 workstation) |
|---|---|---|
| Data path | Shared address space, weights are not moved across devices | Weights must be copied back and forth between system memory and VRAM |
| Capacity ceiling | Total system memory, up to the hundred-GB range | Limited by per-card VRAM; exceeding it requires splitting or a different card |
| Long context | KV cache can directly use remaining system memory | KV cache competes with weights for VRAM and OOMs sooner |
| Frequent small-model concurrency | Generally weaker than a discrete GPU | Stronger VRAM bandwidth and throughput |
| Multiple models resident in parallel | Relatively straightforward | Requires manual VRAM partitioning |
Capacity estimation: three formulas decide how much memory to buy
Weight footprint (GB) ≈ parameters (B) × average bits per weight ÷ 8
Typical average bits per weight for common quantizations: Q4_K_M ≈ 4.5, Q5_K_M ≈ 5.5, Q8_0 ≈ 8.5, FP16 = 16.
KV cache (GB) ≈ 2 × layers × KV heads × head_dim × context length × bytes per element ÷ 1024³
An FP16 KV cache uses 2 bytes per element; quantizing KV to q8_0 roughly halves it.
Worked examples (illustrative — verify against your own startup logs):
- Qwen2.5-32B-Instruct with Q4_K_M: weights are roughly 19–20 GB. The model has 64 layers, GQA with 8 KV heads, and head_dim 128, so at a 32K context the KV cache is 2 × 64 × 8 × 128 × 32768 × 2 B = 8 GB. Add the compute graph, tokenizer, and system overhead and the resident footprint lands around 30 GB. → 32 GB is workable but tight; 48–64 GB is the recommendation.
- A 70B-class model at Q4_K_M: weights are around 39 GB. At 80 layers / 8 KV heads / head_dim 128 / FP16 KV, a 32K context needs about 10 GB of KV cache, for a total of roughly 50 GB. → 96 GB is the starting point; 128 GB is more comfortable.
| Model size (Q4_K_M) | Approximate weight footprint | Recommended memory with a 32K context |
|---|---|---|
| 7B–14B | 4–9 GB | 32 GB (can host several in parallel) |
| 32B | 18–22 GB | 48–64 GB |
| 70B | 38–42 GB | 96–128 GB |
| 120B–235B (MoE) | 60–140 GB | 128 GB or more |
Note that even though a MoE model only activates part of its parameters, all weights must stay resident, so size it by the full parameter count. KV layout, default quantization strategy, and whether flash attention is enabled all shift the real numbers — treat your own startup logs as authoritative and do not copy the figures above.
Capacity is only the entry ticket. Whether the setup runs stably over the long term depends on thermals, sustained power delivery, and driver and inference-framework maturity — that is where the real engineering difficulty of local AI lies.
2. Engineering Setup Checklist for a New Machine
1. Virtual memory (page file)
No matter how much physical memory you have, do not blindly disable the page file. It decides whether memory pressure causes graceful degradation or a hard crash:
- Reserve headroom for long-running services so momentary peaks do not trigger an OOM;
- Watch the free space and write endurance of the disk it lives on — do not put it on a drive that is nearly worn out.
2. ARM64-native toolchain
The biggest hidden cost on ARM is using the wrong build. The same tool often ships as an x86 build (running under emulation) and a native aarch64 build, with significant differences in performance and stability.
- Hold to one hard rule: is there an official aarch64 build? Prefer native.
- For compute-intensive components, confirm native support for the underlying instruction set.
- Maintain a verified list of native tools so the same pitfalls are not rediscovered.
3. Local inference service (a configuration you can copy)
A combination that works in practice is llama.cpp’s llama-server (aarch64-native build + GGUF weights + OpenAI-compatible HTTP API):
# Native build (ARM64) — do not download x86 prebuilt packagesgit clone https://github.com/ggml-org/llama.cppcmake -B build -DCMAKE_BUILD_TYPE=Releasecmake --build build --config Release -j"$(nproc)"# Bind the server to loopback only, so it is not exposed to the network by defaultexport LOCAL_LLM_KEY="$(openssl rand -hex 24)"./build/bin/llama-server \-m ./models/qwen2.5-32b-instruct-q4_k_m.gguf \-c 32768 \ # context window-ngl 99 \ # offload all layers to GPU; under unified memory this is the same physical memory as the CPU-fa on \ # flash attention--cache-type-k q8_0 --cache-type-v q8_0 \--host 127.0.0.1 --port 8080 \--api-key "$LOCAL_LLM_KEY"
Flag names drift between versions (for example the accepted values of -fa, or how --host is spelled), so check ./build/bin/llama-server --help before upgrading. The framework, quantization (Q4_K_M), and context length (32768) here are a starting point, not the only option; vLLM, SGLang, and Ollama are equally valid choices, and the selection criterion is simply whether aarch64-native support exists.
Record your baseline before going live — capacity planning and multi-device scheduling both depend on it:
| Metric to record | Why it matters |
|---|---|
| Actual memory footprint / resident size from the startup logs | Validates the estimation formulas in section 1 |
| Time to first token and tokens/s (note batch, context length, concurrency) | The only trustworthy basis for cross-device comparison |
| Maximum usable concurrency | Sets the threshold for routing policy |
| Model hash and quantization filename | Environment reproducibility |
Unified memory architectures have no discrete VRAM, so record memory footprint and resident size only. Do not fall back to a VRAM-based accounting, or the capacity math will come out wrong.
4. Troubleshooting checklist
| Symptom | Check first | Fix |
|---|---|---|
| OOM on load / process killed | OOM killer entries in system logs; measured resident size vs. estimate | Lower -c; switch KV to q8_0; drop a quantization level; reduce -ngl |
| Throughput far below expectations | Whether an x86 emulated build was used by mistake | Confirm aarch64 with file ./build/bin/llama-server; rebuild natively |
| Service will not start | Port usage via ss -lntp; bind failures in the log |
Change port or free it; check whether --host was set to an unusable address |
| Long conversations get progressively slower | KV cache grows with context | Cap context and concurrency, or shorten sessions |
| Speed drops under sustained load | Thermal limits, power limits, fan policy | Improve airflow; record steady-state power and temperature |
| Calls return 401/403 | Client is not sending the key | Inject it uniformly on the client side; do not hardcode it |
3. Let an AI Coding Agent Automate Environment Setup
Hand this checklist to an AI coding agent and let it execute, instead of writing an internal document and asking colleagues to install by hand and escalate to IT when they get stuck. A reusable workflow:
1. Environment audit: detect OS architecture, installed tools and versions, disk and memory state2. Gap analysis: compare against the target checklist and list missing or version-mismatched components3. Selection: pick the aarch64-native build for each component, record the source and checksum (sha256)4. Installation: install step by step, verifying exit codes and artifact paths at each step5. Self-check and repair: validate the result, roll back and retry a limited number of times on failure6. Report: output "environment ready" plus a version snapshot and checksums, ready for the business side to use
Key constraints: step 3 must record checksums, and step 5 must be able to roll back — otherwise the agent walks you into an environment whose provenance nobody can explain.
4. Multi-Device Coordination and Security Boundaries
When several machines are available on a desk, coordination beats putting everything on one box: keep local models and the low-latency path on the unified-memory host, hand heavy workloads to a higher-compute device, and program against a single unified API at the top.
Security prerequisite: a local inference service is by default an HTTP endpoint with no authentication. Once it listens on a non-loopback address, anyone on the same network segment can call it, consume your compute, and read the prompts you send through it. So you must:
- Minimize the bind scope: bind
127.0.0.1for single-machine use; for cross-device calls, bind a specific internal address, not0.0.0.0, and do not port-forward it to the public internet; - Enforce authentication: enable an API key (
--api-key) or put a reverse proxy in front for Basic/mTLS; keep the key in environment variables or a secrets manager, not in code or repositories; - Minimize ports: firewall rules should open only the one port that is genuinely needed and close the rest; carry cross-device traffic over TLS;
- Segment the network: assume the LAN may also be untrusted, and place inference nodes in a separate VLAN or behind a host-firewall allowlist;
- Apply least privilege: run the service as a non-root user, keep model directories read-only, and avoid logging full prompts.
Illustrative routing logic with authentication:
import os, requestsREMOTE = "https://gpu-node.lan.internal/v1" # internal-only reachability, TLS encryptedKEY = os.environ["INFER_KEY"] # never written into codedef route_request(task, messages):headers = {"Authorization": f"Bearer {KEY}"}if task["prompt_tokens"] > 20000 and \requests.get(REMOTE + "/health", headers=headers, timeout=1.0).ok:r = requests.post(REMOTE + "/chat/completions",json={"model": "qwen2.5-72b", "messages": messages},headers=headers, timeout=120)return r.json()["choices"][0]["message"]["content"]return local_model.chat(messages) # local service listens on 127.0.0.1 only
The local device guarantees low latency and data privacy; the higher-compute device absorbs heavy load; the two are decoupled behind one interface: devices are replaceable resources, while the working environment and business logic are the durable assets.
Role boundaries shift accordingly. Business owners define objectives, provide inputs, and accept results; specialists handle model selection, quality assurance, and risk assessment; the automation layer handles environment preparation, installation, dependency repair, and service orchestration. Deterministic, standardizable, repetitive work goes to automation; work that needs judgment and accountability stays with specific people.
5. FAQ
Which inference framework on ARM? Start with llama.cpp / Ollama: aarch64-native, active communities, and a complete GGUF ecosystem. If you need an OpenAI-compatible API plus high-concurrency batching, evaluate how mature vLLM / SGLang ARM support has become — their official wheels and operator coverage often lag x86, so validate at small scale before committing. On Apple Silicon, MLX is worth considering. There is only one decision criterion: whether an official aarch64 build exists.
How do you pick a quantization level? Q4_K_M is the general-purpose starting point; move to Q5_K_M or Q6_K for precision-sensitive tasks such as long-document summarization and code generation. Using q8_0 for the KV cache roughly halves it with minimal quality loss.
Is 64 GB enough? Run the formulas: typically no more than 45–50 GB is left for the model, which covers a 32B-class model at Q4 with a long context, or a 70B-class model at Q4 with a short context. For 70B with a 32K context, 128 GB is the safer choice.
Can I open the service up for others to use? Not until the four items from section 4 — binding, authentication, ports, and segmentation — are done.
6. Conclusion
The value of this practice does not lie in any single hardware spec but in a reproducible engineering path: unified memory makes local large models possible, capacity estimation makes sizing decisions defensible, a native toolchain plus baseline records makes the environment reproducible, an AI coding agent makes environment management automated, and multi-device coordination with authentication boundaries makes compute schedulable on demand and safely. Once trivia like “where does the software get installed” and “how are dependencies configured” is taken over by machines, attention can return to what actually matters: defining the problem, making the judgment, and owning the result.
