Skip to main content

Mac LLM Memory Planner

Estimate Mac memory for reviewed Llama and Qwen MLX builds or your own dense, full-attention text model.

Processed in your browser

Memory units and run settings

Count system instructions, chat history, tools, and special tokens in the prompt. The allowance is the memory you leave for macOS and other apps.

Cache, prefill, and context sweep

The sweep keeps the new-token limit fixed and varies the prompt length.

Exact Mac details for matching a run

Use the CPU and GPU core counts reported for the chip. These fields help match an observation.

Import a saved estimate

Whole-run measurement

A whole-run measurement covers model load, prefill, and generation. Import an experiment to compare its settings with your plan.

How it works

How much memory does Llama 3.3 70B use at 128K on a 96 GB M5 Ultra?

The model and cache are estimated at 76.96 GiB for Llama 3.3 70B Instruct · 4-bit MLX at 131,072 tokens. After reserving 4 GiB for macOS and other apps, the Mac Studio M5 Ultra has a 92 GiB planning budget. The estimate leaves 15.04 GiB of modeled headroom.

The total includes 36.96 GiB for the model weights and 40 GiB for the FP16 KV cache. This example uses MLX-LM 0.32.2 · MLX 0.32.5, one stream, a 130,560-token prompt, and 512 new tokens.

Whole-run peak unmeasured. Model loading, prompt processing, and generation can use temporary memory beyond this estimate. Measure the peak on your Mac before relying on the result.

Select Try an example, then choose Try 96 GB to apply the 131,072-token comparison. Use Compare Mac costs to carry the modeled memory requirement into the Buy-or-Rent Planner. Back to the planner

Review the hardware, model, and cache sources. Apple Mac Studio specifications · Pinned model configuration · Pinned tensor index · MLX-LM cache allocation

What the estimate covers
The planner compares model weights and the key-value (KV) cache with your memory budget after the macOS and apps allowance. Enter 96 GiB for a Mac listed as 96 GB. Measure a whole run to account for temporary buffers.
Model size
We use verified tensor bytes when available and on-disk model file sizes otherwise. A label like “70B 4-bit” doesn’t tell you the file size. For a custom model, enter its size to include the weights in the estimate.
KV cache

For FP16, bytes per token are layers × KV heads × (key dimension + value dimension) × 2. The logical cache depends on the total token count, regardless of the prompt and output split. The reviewed MLX-LM runtime reserves extra cache capacity in 256-token steps.

Custom estimates cover one stream with FP16 and the same full-attention cache layout in every layer. Sliding-window and hybrid models need a different calculation.

Measure the whole-run peak
In a fresh process, load the model, process the prompt, and finish generation. Then read mlx.core.get_peak_memory() for the MLX allocator’s peak. Keep that measurement separate from the estimate. The planner compares an imported peak with the estimate when the model, runtime, Mac, and run settings match.

Sources

Catalog checked Nov 28, 2026.

Artifact and runtime references