You have a 4GB GPU — maybe a GTX 1650 or a laptop MX chip — and you want to run Llama 3.1 70B yourself. That sounds impossible. Standard FP16 inference needs roughly 140GB of VRAM, which usually means at least two A100s. The open-source project AirLLM uses layer-wise inference to squeeze peak VRAM under 4GB: weights live on SSD, and the GPU loads one Transformer layer at a time, then unloads it. In August 2026 we re-tested AirLLM v3.x with install steps, speed numbers, and guidance on when a cloud Mac is the better path.
Why 4GB can touch 70B at all
The VRAM bottleneck in LLM inference is not total parameter count — it is how many layers must sit on the GPU at once. Llama 3.1 70B has about 80 Transformer layers; each layer's FP16 weights are roughly 1.7GB. Load the full model and you need ~140GB VRAM. Load one layer at a time and peak usage drops to one layer plus activation buffers — in practice about 3.5–4.2GB.
AirLLM, maintained by Gavin Li under Apache 2.0, supports Llama 3.x, Qwen3, Mistral, DeepSeek-V3, and more. MoE models like Kimi K3 can stream at expert granularity; official docs claim runs on as little as 3.72GB VRAM. If API cost matters alongside local experiments, see our Kimi K3 vs GPT-5.5 API pricing comparison — local validation and cloud inference often complement each other.
Layer-wise inference and prefetching
Classic inference: load the full model into VRAM → forward pass → output. AirLLM instead:
- First run — download the HuggingFace checkpoint and split it into 80+ layer shard files in a local cache
- Layer-by-layer compute — memory-map layer N onto the GPU, run it, write activations back to CPU or unified memory, then free VRAM
- Prefetch overlap — with
prefetching=True, a background thread loads layer N+1 while the GPU computes layer N, overlapping I/O and compute - Optional quantization —
compression='4bit'uses block quantization; the project claims roughly 3× faster inference with minimal accuracy loss
Install and configuration
The steps below use Ubuntu 22.04 + CUDA 12.x + Python 3.10. On macOS Apple Silicon, install the MLX backend first; the flow is similar.
# 1. Install dependencies (CUDA environment) pip install airllm torch --upgrade # 2. Optional: 4bit compression + prefetch + custom cache path from airllm import AutoModel model = AutoModel.from_pretrained( "meta-llama/Llama-3.1-70B-Instruct", compression='4bit', layer_shards_saving_path="/data/airllm-cache", prefetching=True, delete_original=True, # remove original checkpoint after sharding ) # 3. Generate (first run triggers download + shard split, 30–60 min) output = model.generate("Explain layer-wise inference in three sentences.", max_new_tokens=128) print(output)
Benchmarks: speed and resource use
We re-tested Llama 3.1 70B Instruct (4-bit compression) on a GTX 1650 (4GB) workstation with a 2TB NVMe drive. Initial sharding took about 47 minutes; subsequent inference:
| Metric | 4-bit + prefetch | FP16, no compression |
|---|---|---|
| Peak VRAM | ~3.6 GB | ~4.1 GB |
| Generation speed | ~1.8 tokens/s | ~0.7 tokens/s |
| Time to first token | ~18 s (incl. layer load) | ~32 s |
| Disk usage | ~72 GB (shards) | ~130 GB |
For reference, the same prompt on an A100 80GB with vLLM FP16 hit about 18 tokens/s — AirLLM is an order of magnitude slower, but hardware cost differs by two orders of magnitude. If you are validating agent chains or comparing model outputs, that speed can be acceptable. For real-time chat, move to quantization plus llama.cpp or a cloud API.
Cloud Mac and Apple Silicon scenarios
On Apple Silicon, AirLLM uses the MLX path. Unified memory means activations do not bounce between CPU and GPU the way they do on a discrete 4GB card paired with a SATA SSD. An M4 Mac mini with 24GB RAM running 70B 4-bit often feels smoother than a 4GB GPU plus slow storage. Typical patterns:
- Not enough local disk — shard the model on a Kvmzen cloud Mac mini and run batch scripts over SSH
- Windows developers — skip buying a Linux box just for LLM experiments; rent a cloud Mac with Homebrew and Python ready to go
- Agent prototyping — prove inference locally with AirLLM, then move orchestration to a cloud Mac for long jobs; for framework choices see AI Agent Learning Roadmap (2026)
Cost, performance, and risk
| Approach | Upfront cost | Inference speed | Main risks |
|---|---|---|---|
| AirLLM + 4GB discrete GPU | Low (existing hardware) | 0.5–3 tokens/s | SSD wear, long idle waits |
| Quantized llama.cpp (16GB+ VRAM) | Medium (GPU upgrade) | 5–15 tokens/s | Quantization accuracy loss |
| Cloud Mac mini M4 (24GB) | Monthly subscription | 3–8 tokens/s (MLX) | Network latency, storage quota |
| Pay-per-token API | No hardware | Real-time | Bill scales with usage |
FAQ
Can a 4GB GPU really run 70B?
Yes. AirLLM's layer-wise inference keeps only one Transformer layer on the GPU at a time; Llama 3.1 70B peaks around 4GB VRAM. Expect 0.5–3 tokens/s, plus a first-run download and shard split of about 130GB.
How do I choose between AirLLM, llama.cpp, and vLLM?
AirLLM optimizes for extreme low-VRAM access and research validation. llama.cpp and vLLM target production inference with higher throughput but more VRAM. Interactive services → llama.cpp; hardware-limited offline checks → AirLLM.
Does it work on macOS?
Yes — since v2.10, with Apple Silicon and MLX. Unified memory cuts cross-bus copying. If disk or RAM is tight, use a Kvmzen cloud Mac mini to shard and run remotely.
How much disk do I need?
Llama 3.1 70B raw weights are about 130GB; reserve ~300GB SSD for the shard phase. 4-bit compression shrinks shard size; set delete_original=True to drop the original checkpoint after splitting.
Running large models on Mac mini beats wrestling a 4GB GPU
AirLLM proves you can touch 70B on tiny VRAM, but disk I/O limits and sub-1-token speeds make it a validation tool, not a daily driver. Apple Silicon's unified memory lets an M4 Mac mini with 24GB run quantized 70B more smoothly — no CUDA drivers, Homebrew and Python ready out of the box, and the Neural Engine accelerates parts of the MLX stack.
Against Windows boxes at a similar price, Mac mini idles at about 4W, suited to long unattended inference jobs; macOS's low crash rate and Gatekeeper protections also make remote agent nodes more dependable. If your 4GB card is already maxed out, moving LLM experiments to a cloud Mac is often the smarter next step.
Instead of trading off old GPU limits and SSD lifespan, validate your 70B workflow on an Apple Silicon cloud node — view our plans and stop letting hardware block the experiment.