The run in three numbers: model 368 GB on disk (4-bit MXFP4), decode about 12 tokens/sec (prefill about 140), and a crash at 74.5K tokens with about 16 GB of GPU headroom left.

Here is the whole rig. GLM-5.2 runs entirely on the Mac Studio and is served over Tailscale to my laptop, where it drives a coding agent (Pi) inside Cursor's terminal. Nothing leaves the building, and there is no per-token bill. Getting it running was not simple. It needed a custom runtime, then a change to how much memory macOS hands the GPU, and it kept dying on a five-minute timeout. I will walk through each of those, then what the model was actually like to use.

The setup

One machine, one very large model, quantized to 4-bit. Plain version of what that means: a 4-bit quant is the same model with its weights stored at lower precision. It is not a smaller model with fewer parameters, just the same one packed down to fit on disk.

Setup: Mac Studio M3 Ultra, 80-core GPU, 512 GB unified memory, about 800 GB/s; model GLM-5.2 (arch glm_moe_dsa, 78 layers); quant mlx-community/GLM-5.2-mxfp4 4-bit, 368 GB on disk; max context 1,048,576 tokens.

I also pulled pipenetwork/GLM-5.2-MLX-mixed-3_6bit earlier (~360 GB, experts at 3-bit, non-expert at 6-bit). Same architecture, so it ran into the same problem.

Why it won't load in LM Studio

The obvious first move is to load it in LM Studio. That does not work. LM Studio's MLX runtime (1.8.5 stable, 1.9.0 beta) cannot load this model. The problem is the architecture. The download is fine.

LM Studio runtime error: Missing 285 parameters (57 shared layers times 5 indexer tensors); the runtime doesn't implement IndexShare.
  • Same failure on both quants. This is an architecture problem, so the quant level does not change it.

  • llama.cpp added the arch but ignores the indexer entirely, falling back to dense attention.

The runtime that actually works

The fix is an unmerged pull request. I ran mlx-lm from PR ml-explore/mlx-lm #1410 (the glm-moe-dsa indexer-sharing branch) in a Python 3.12 venv. From there it serves cleanly, with a proxy in front to make it agent-friendly.

The working runtime: mlx_lm.server on 127.0.0.1 port 8080 with decode-concurrency 32 and prompt-concurrency 8, fronted by a proxy on 0.0.0.0 port 8090 reached over Tailscale.

Concurrent streams share one read of the weights, so throughput adds up instead of queueing. That batching is what lets a multi-agent loop actually use the machine.

Performance, measured

These are measured numbers from the working runtime. Two terms first, in plain words: prefill is the model reading your prompt, decode is the model writing its answer. Decode here is slow but steady. Prefill is the part that starts to hurt once the prompt gets big.

Measured performance: decode about 12 tokens/sec, prefill about 140 tokens/sec, model load 28 to 60 seconds warm, resident memory 368 GB, KV cache about 88 KB per token.

That KV cache line is the one to watch. The KV cache is the memory the model uses to hold the conversation so far. It is not reserved up front. It grows as the session fills, and at 1M tokens it wants 88 GB you may not have free:

KV cache size by context length: 22 GB at 256K, 26 GB at 300K, 35 GB at 400K, rising to 88 GB at 1M tokens.

The crash: a context ceiling

This was the biggest thing I ran into. During a Pi coding session the context grew to about 74,500 tokens and the server fell over:

Crash log: METAL Command buffer execution failed, Insufficient Memory (kIOGPUCommandBufferCallbackErrorOutOfMemory); crashed twice, LaunchAgent auto-restarted four times into a crash loop.

The cause is a default setting. macOS caps how much memory the GPU can use at about 75% of RAM (iogpu.wired_limit_mb = 0, which works out to ~384 GB here). The model takes 368 GB of that, leaving only about 16 GB for the GPU to work in. Prefilling 74.5K tokens needs more than 16 GB, so it runs out of memory and crashes. Here is the squeeze, drawn to scale against the full 512 GB:

The memory squeeze on 512 GB unified: the default cap of 384 GB leaves the 368 GB model only 16 GB of GPU headroom and triggers an out-of-memory crash; raising the cap to 480 GB gives 112 GB of headroom.

Each crash also carries a tax. It wipes the KV cache, so the model has to read the whole conversation again from scratch, and re-prefilling 74.5K tokens cold takes about nine minutes at 140 tok/s. A crash loop costs more than downtime. Every restart spends nine minutes re-reading the same conversation before the model can answer, until you raise the limit.

Pull quote: A 368 GB model on a 512 GB machine sounds like it fits. The default GPU cap means it barely does, and the first long session proves it.

The other failure: "terminated"

With the memory limit raised, a second error shows up. Turns die after about five minutes with error: terminated and zero output. The model is fine here. The cause is a timeout on the client side.

  • A 300-second HTTP timeout (Node/undici fetch defaults, headersTimeout / bodyTimeout = 300,000 ms) inherited by JS agents.

  • Measured: failed turns ran 300–317 sec, then died with 0 output. It fires whenever a single generation streams longer than 5 min at 12 tok/s.

  • OpenCode Desktop can't override it (bug #26602). Pi auto-retries, so it quietly self-heals.

Tools tested

Most of the front-ends I tried either can't load the model or can't survive the timeout. Pi in Cursor's terminal is where I landed.

Tools tested: LM Studio can't load; OpenCode Desktop works but a 5-minute timeout cuts big turns; OpenCode CLI honors the timeout config; Continue didn't work well; Cursor can't reach the private tailnet IP; Aider is viable and calls locally; Pi is where I settled, with local files and auto-retries.

Quant and model options

For the curious: the 4-bit MXFP4 run is the best-quality MLX option but the tightest on memory. There are faster, lighter paths if you'll trade quality, and a much smaller coder model that may simply be the better tool for code.

Quant and model options: GLM-5.2 mxfp4 4-bit, 368 GB, mlx-lm — best MLX quality; GLM-5.2 2-bit (Unsloth UD-IQ2) about 241 GB, llama.cpp — faster but quality drop and DSA ignored; Qwen2.5-Coder-32B 4-bit about 18 GB — fastest and likely better for code.

So is it any good?

I gave it the same test I gave Fable 5: build an Age-of-Empires-style game from a single prompt. Fable 5 nailed it from one sentence. GLM-5.2 local 4-bit did not, even after I re-prompted it a few times. The graphics were off and so was the gameplay.

Speed was not the dealbreaker. At ~12 tok/s it was still fast enough to get something working within about an hour. For a real-time chat agent that lag is painful; for batch and coding work it is usable. The strange part is the gap between thinking and doing.

Pull quote: The model clearly thinks a lot, and the reasoning itself looked genuinely good. The code it actually wrote did not match the quality of the thinking.

Two honest open questions before anyone takes this as a verdict on GLM-5.2 itself:

  • The cloud / full-precision version may be a lot better. I have not run the same prompt against it yet. Planning to.

  • The harness matters. Pi may not be the right agent loop for this model; a stronger or more controlled harness might pull more out of it.

  • It is heavy on the machine. Loading ~368 GB really puts the Mac to work and eats most of the RAM, which is the whole reason the crash happened in the first place.

Net: people raving about GLM-5.2 for coding are likely on the cloud version; the local 4-bit experience was a clear step below frontier cloud models on the same task. It's still worth investing in local gear — just raise the GPU memory limit before you start.