Can It Run?
Home โ€บ Llama 3.1 405B โ€บ M3 Ultra 512GB

Can an M3 Ultra 512GB Mac run Llama 3.1 405B?

M3 Ultra ยท 512 GB unified memory ยท 819 GB/s ยท Mac Studio (M3 Ultra)

Yes โ€” Llama 3.1 405B runs on an M3 Ultra 512GB Mac.

At Q4_K_M it needs about 247.3 GiB, leaving 248.7 GiB spare out of the ~496.0 GiB macOS will let you use. Expect roughly 3 tokens/sec โ€” too slow for interactive use.

Weights
231.0 GiB
405B params @ Q4_K_M
KV cache
3.9 GiB
8K context, FP16
Overhead
12.4 GiB
runtime + activations
Total needed
247.3 GiB
of ~496.0 GiB usable
Est. speed
3 tok/s
819 GB/s bandwidth
Max context
128K tokens
at Q4_K_M

Where the memory goes

Three things occupy memory when a model is loaded: the weights themselves, the KV cache that holds the conversation, and the runtime's own working buffers. Only the first is fixed โ€” the KV cache grows with every token in your context.

QuantisationWeightsTotalTok/sFits?
FP16754.4 GiB796.8 GiB1No
Q8_0400.8 GiB425.5 GiB2Yes, but tight
Q6_K311.2 GiB331.5 GiB2Yes, comfortably
Q5_K_M268.7 GiB286.9 GiB2Yes, comfortably
Q4_K_M231.0 GiB247.3 GiB3Yes, comfortably
Q3_K_M183.9 GiB197.8 GiB3Yes, comfortably
Q2_K141.4 GiB153.3 GiB4Yes, comfortably

The default. Best quality-per-gigabyte for most people.

How long a context fits

The KV cache is often what breaks a setup that looked fine at load time. Quantising it to 8-bit roughly halves its footprint with little measurable quality cost.

ContextKV cacheTotalFP16 KVQ8 KV
2K1.0 GiB244.1 GiBYes, comfortablyYes, comfortably
4K2.0 GiB245.2 GiBYes, comfortablyYes, comfortably
8K3.9 GiB247.3 GiBYes, comfortablyYes, comfortably
16K7.9 GiB251.6 GiBYes, comfortablyYes, comfortably
32K15.8 GiB260.0 GiBYes, comfortablyYes, comfortably
128K63.0 GiB310.9 GiBYes, comfortablyYes, comfortably

How to run it

Ollama is the shortest path. It picks a quantisation automatically โ€” usually Q4_K_M, which is what the numbers above assume.

brew install ollama
ollama serve &
ollama run llama3.1:405b

For MLX โ€” Apple's own array framework, typically a little faster than llama.cpp on Apple Silicon:

pip install mlx-lm
mlx_lm.generate --model mlx-community/Llama-3-1-405B-4bit --prompt "Hello"

Macs that run Llama 3.1 405B comfortably

The smallest configuration that handles it is the M3 Ultra 512GB (Mac Studio (M3 Ultra)).

MacMemoryBandwidthTok/s
M3 Ultra 512GB512 GB819 GB/s3

Common questions

Can an M3 Ultra 512GB Mac run Llama 3.1 405B?
Yes. At Q4_K_M it needs about 247.3 GiB of the roughly 496.0 GiB available, generating around 3 tokens per second.
How fast is Llama 3.1 405B on an Mac?
Around 3 tokens per second. Token generation on Apple Silicon is limited by memory bandwidth, and this machine has 819 GB/s.
How much memory does Llama 3.1 405B need?
231.0 GiB for the weights at Q4_K_M, plus 3.9 GiB for an 8K-token KV cache and about 12.4 GiB of runtime overhead โ€” 247.3 GiB in total.