Skip to content
Llama Builds

Recommendations · October 2026

The best local LLMs for the M5 Ultra 512GB

Every model worth running on 512GB of unified memory (about 384GB usable by the GPU by default), which quantization to pick, and how fast each one generates text.

By Updated

Our picks at a glance

  • Best overall (also coding, reasoning, vision): GLM-5.3-Flash (Q6_K, ~25 tokens/sec)
  • Runner-up: DeepSeek V4 Flash (FP4, ~45 tokens/sec)
  • Fastest good model: gpt-oss-20b (MXFP4, ~105 tokens/sec)
  • Largest model that fits: GLM-5.3 (Q3_K_M, ~19 tokens/sec)

We may earn a commission when you buy through links on this page. It never changes what we recommend. How we make money

01 · Best overall · also coding, reasoning, vision

GLM-5.3-Flash

Runs well320B (18B active)Z.aiMIT license

GLM-5.3-Flash (320B (18B active)) fits comfortably in the M5 Ultra 512GB's memory at Q6_K, using about 273GB with 8K context and generating ~25 tokens/sec. It is the most capable model in our catalog that runs well on this card. It is also our top pick for coding, reasoning and working with images.

GLM-5.3-Flash is Z.ai's August 2026 mid-size model and its first natively multimodal one: 320B total parameters with 18B active, a 1M-token context, a thinking mode, and an MIT license. It ranks just behind the largest open models on the Artificial Analysis Intelligence Index while needing well under half their memory. Most of its layers use linear attention with a fixed-size state, so long contexts are cheap. Expect about 200GB at Q4_K_M with 8K context, which means a 256GB Mac Studio or a multi-GPU server; the smallest 1-bit GGUF is 93GB and fits 128GB machines, at a clear quality cost.

Quantization
Q6_K
Memory used
272.6 GB
Speed (est.)
~25 tok/s
Max context
~1M

02 · Runner-up

DeepSeek V4 Flash

Runs well284B (13B active)DeepSeekMIT license

DeepSeek V4 Flash (284B (13B active)) fits comfortably in the M5 Ultra 512GB's memory at FP4, using about 168GB with 8K context and generating ~45 tokens/sec. It is the next-best model that runs well here, and the one to try if the top pick doesn't suit you.

DeepSeek V4 Flash is the smaller model of DeepSeek's April 2026 V4 generation: 284B total parameters, 13B active, a 1M-token context, and a toggleable thinking mode, refreshed with improved 0731 weights in July. Its compressed attention makes long contexts remarkably cheap, and its expert weights ship natively in FP4, so the full-quality build is only about 162GB. Running it at full quality takes a 256GB Mac Studio or a multi-GPU server with about 170GB of memory; 3-bit dynamic builds of roughly 103GB to 110GB fit 128GB machines with some quality loss. DeepSeek's September V4.1 Flash is larger (552B, including 196B of Engram memory), so V4 Flash remains the easier DeepSeek to run locally.

Quantization
FP4
Memory used
167.5 GB
Speed (est.)
~45 tok/s
Max context
~1M

03 · Fastest good model

gpt-oss-20b

Runs well20.9B (3.6B active)OpenAIApache 2.0 license

gpt-oss-20b (20.9B (3.6B active)) fits comfortably in the M5 Ultra 512GB's memory at MXFP4, using about 15GB with 8K context and generating ~105 tokens/sec. Pick it when responsiveness matters more than squeezing out maximum quality.

gpt-oss-20b is OpenAI's small open-weight reasoning model, a 21B mixture-of-experts with 3.6B active parameters whose expert weights ship natively in 4-bit MXFP4. OpenAI has not released a successor, and it remains one of the best reasoning and tool-calling models that fits a 16GB GPU. The native weights take about 14GB, so 16GB cards and Macs with 24GB or more run it fully in memory, and 12GB cards run it with a little CPU offload. Reasoning effort is adjustable (low, medium, high) but cannot be turned off.

Quantization
MXFP4
Memory used
15.0 GB
Speed (est.)
~105 tok/s
Max context
~128K
$ ollama run gpt-oss:20bModel details →

04 · Largest model that fits

GLM-5.3

Fits, tight744B (40B active)Z.aiGLM-5.3 custom license

GLM-5.3 (744B (40B active)) fits, with little room to spare in the M5 Ultra 512GB's memory at Q3_K_M, using about 375GB with 8K context and generating ~19 tokens/sec. It is the largest model that runs fully on this GPU.

GLM-5.3 is Z.ai's flagship, released as open weights in August 2026, and it scores 44 on the Artificial Analysis Intelligence Index v4.3, level with Kimi K3 and among the highest of any open-weight model. It is a 744B mixture-of-experts with 40B active parameters, a 1M-token context, and a thinking mode, aimed at agentic coding and long-horizon tasks. At Q4_K_M it needs roughly 465GB with 8K context, so local use realistically means a 512GB Mac Studio or a multi-GPU server; the smallest community GGUFs start above 200GB. Unlike earlier GLM releases it uses a custom license with a revenue threshold, so check the terms before commercial use.

Quantization
Q3_K_M
Memory used
374.9 GB
Speed (est.)
~19 tok/s
Max context
~0

The full list

Every model that runs on the M5 Ultra 512GB

#ModelBest quantMemorySpeedFit
1GLM-5.3-Flash320B (18B active)Q6_K272.6 GB~25 tok/sRuns well
2DeepSeek V4 Flash284B (13B active)FP4167.5 GB~45 tok/sRuns well
3Qwen3.8 27B27BQ8_031.6 GB~22 tok/sRuns well
4Qwen3.5 122B-A10B122B (10B active)Q8_0134.3 GB~33 tok/sRuns well
5Qwen3.6 35B-A3B35B (3B active)Q8_041.0 GB~83 tok/sRuns well
6GLM-5.3744B (40B active)Q3_K_M374.9 GB~19 tok/sFits, tight
7Gemma 4 31B31BQ8_035.9 GB~20 tok/sRuns well
8gpt-oss-120b117B (5.1B active)MXFP468.3 GB~93 tok/sRuns well
9Gemma 4 26B A4B26B (3.8B active)Q8_029.5 GB~73 tok/sRuns well
10GLM-4.5-Air106B (12B active)Q8_0118.1 GB~28 tok/sRuns well
11gpt-oss-20b20.9B (3.6B active)MXFP415.0 GB~105 tok/sRuns well
12Qwen3.5 9B9BQ8_012.0 GB~57 tok/sRuns well
13Gemma 4 E4B8BQ8_010.5 GB~64 tok/sRuns well
14Llama 4 Scout109B (17B active)Q8_0120.2 GB~21 tok/sRuns well
15Phi-414.7BQ8_018.3 GB~41 tok/sRuns well

Ranked by our capability score, adjusted for quantization and speed. Memory includes 8K context. Speeds are estimates for a single user; seemethodology.

Setup

Best settings and software for the M5 Ultra 512GB

Macs run local models through Metal, and MLX gives the best speed on Apple silicon. With GLM-5.3-Flash at Q6_K, you can fit roughly 1M tokens of context with a 16-bit KV cache; an 8-bit KV cache about doubles that.

  • LM Studio (MLX): the fastest point-and-click option on a Mac.
  • Ollama: simple CLI and API, runs GGUF models on Metal.
  • mlx-lm: Apple's own framework, for scripting and fine-tuning.
  • llama.cpp: broadest model and quantization support on Metal.

New to quantization? Q4_K_M is the safe default; read our quantization explainer to see when Q5, Q6, or Q8 is worth the extra memory.

Thinking of buying one?

Apple Mac Studio M5 Ultra 512GB

Specs, benchmarks, and our full take

Frequently asked questions

What is the best LLM for the M5 Ultra 512GB?

GLM-5.3-Flash is the best all-round model for the M5 Ultra 512GB. At Q6_K it uses about 273GB with 8K context and generates ~25 tokens/sec.

What quantization should I use on the M5 Ultra 512GB?

Use the highest-precision quant that leaves room for your context. Q4_K_M is the best default: it is about a quarter the size of the original 16-bit weights with only a small quality loss. If a model fits at Q5_K_M, Q6_K, or Q8_0 with room to spare, use that instead. Avoid going below Q3 except for very large models.

How much context can I use with GLM-5.3-Flash on the M5 Ultra 512GB?

At Q6_K with a 16-bit KV cache, roughly 1M tokens fit in 512GB unified memory. Quantizing the KV cache to 8-bit (for example with llama.cpp's --cache-type-k q8_0 --cache-type-v q8_0) roughly doubles that.