GLM-5.3-mtp-affine4

4-bit affine (group_size=64) Multi-Token Prediction (MTP) draft head extracted from zai-org/GLM-5.3 (layer 78, revision ba32f8c19c87) for exact speculative decoding of Full 744B GLM-5.3 on Apple Silicon with botdevhq/mlx-serve.

This repository is a speculative draft head (5.6 GB), not a standalone language model. Pair it with:

What's inside

.
โ”œโ”€โ”€ LICENSE                         # Z.AI GLM-5.3 License (verbatim from zai-org/GLM-5.3)
โ”œโ”€โ”€ README.md
โ”œโ”€โ”€ SHA256SUMS
โ””โ”€โ”€ mtp/
    โ”œโ”€โ”€ config.json                 # Source model config from zai-org/GLM-5.3
    โ””โ”€โ”€ mtp-residents.safetensors   # Layer 78 MTP weights (32 tensors; routed experts quantized affine 4-bit, group_size=64)

The mtp/ subdirectory matches the exact layout expected by mlx-serve's mtp_pack setting, so you can point mtp_pack directly at the downloaded repository folder.

Measured performance (Apple M5 Ultra, 512 GB)

Measured on a single 512 GB Apple M5 Ultra Mac Studio running Full 744B mlx-community/GLM-5.3-4bit (zero-copy snapbank, all 75 routed MoE layers resident) on botdevhq/mlx-serve (v26.11.4-botdev.5), greedy T=0, exact row-exact verification (0 greedy & seeded stochastic diffs vs. plain drafting-off decode):

Metric Method Measured result
Single-user decode (drafted, hybrid Q4 MTP + Q4 DFlash2) mtp_depth=3, mtp_quant4=true, dflash_bits=4, dflash_block_size=8, hybrid_drafter=true, greedy T=0 48โ€“58 tok/s (up to 58 tok/s on structured code)
Single-user decode baseline (drafting off / plain) Same 744B pack, drafting off, greedy T=0 27 tok/s (plain)
Concurrent batched spec (N=2 / N=3 / N=4) max_slots=4, kv_pool_gib=24, --max-concurrent 4, batched MTP draftBatch + hybrid vqmv, greedy T=0 52.7 / 58.3 / 61.8โ€“62.2 tok/s aggregate (2.3ร— plain, 0 greedy & seeded diffs)
JSON-schema & <think> spec (response_format) Argmax-first constrained spec (prepareArgmax), strict schemas + json_object, greedy T=0 41.5โ€“43.3 tok/s agg (1.37โ€“1.43ร—) ยท 46.6 strict schema ยท 55.2 json_object (1.81ร—, 0 diffs)
4-chat alternating warm prefix reuse 4 separate ~550-token chats alternating turns, parked-slot reuse (>=64 tok strong hit) 0.13 s TTFT on all 4 chats (0.79 s cold)
Cold prompt prefill (8K exact / 8K opt-in INT8 / 32K) Resident NAX MoE prefill + dequantized MLA, 0% cached 982 tok/s (exact) / 1,030 tok/s (INT8) / 961 tok/s (32K)
Output fidelity Row-exact target verification (hybrid vqmv / vqmv3d) & batched spec vs. plain serial decode, greedy T=0 0 diffs (bit-exact greedy, solo, batched & JSON)
Memory footprint 262,144 context window, 32,768 max output, 4-slot KV pool (24 GiB), all 75 MoE layers + Q4 MTP + Q4 DFlash2 resident ~407โ€“409 GiB peak wired (under 444 GiB safe ceiling on 512 GB)

Quickstart with botdevhq/mlx-serve

  1. Build botdevhq/mlx-serve (macOS 26.2+, Xcode 26.2+ with Metal Toolchain, Homebrew):
git clone --recurse-submodules https://github.com/botdevhq/mlx-serve
cd mlx-serve
brew bundle install --file=Brewfile
./scripts/fetch-zig.sh
./scripts/fetch-llama.sh
./scripts/build-mlx.sh
./.zig-toolchain/zig build -Doptimize=ReleaseFast
  1. Download the base 744B weights, this MTP drafter, and (optionally) DFlash2, then build the zero-copy snapbank (takes ~41 s on Mac Studio SSD; keeps the 91 upstream shards in place and writes only the 9.9 GB resident pack + 4.6 MB manifest):
hf download mlx-community/GLM-5.3-4bit --revision 81ad9b73c6188f808737dbb52458f082d249dcbe --local-dir ./GLM-5.3-4bit
hf download botdevhq/GLM-5.3-mtp-affine4 --local-dir ./GLM-5.3-mtp-affine4
hf download incoai/GLM-5.3-DFlash2 --local-dir ./GLM-5.3-DFlash2
python3 scripts/glm53_pack.py snapshot --src ./GLM-5.3-4bit --dst ./GLM-5.3-4bit-snapbank --bits 4
  1. Configure ~/.mlx-serve/model-settings.json keyed by the resolved absolute path of ./GLM-5.3-4bit-snapbank (setting max_slots: 4 and kv_pool_gib: 24 enables the multi-slot concurrent decode pool โ€” solo traffic runs full hybrid DFlash2 + MTP drafting, 2โ€“4 overlapping streams automatically run bit-exact batched speculative decoding, and returning to 1 stream immediately resumes solo hybrid drafting):
{
  "/abs/path/to/GLM-5.3-4bit-snapbank": {
    "ctx_size": 262144,
    "max_output": 32768,
    "prompt_cache_gib": 8,
    "resident_scratch": true,
    "fused_router": true,
    "decode_expert_major": true,
    "decode_commit_stride": 12,
    "prefill_call_rows": 16384,
    "resident_prefill": true,
    "prefill_nax_moe": true,
    "prefill_deq_mla": true,
    "mtp_depth": 3,
    "mtp_pack": "/abs/path/to/GLM-5.3-mtp-affine4",
    "mtp_quant4": true,
    "mtp_adaptive_p": 0.72,
    "mtp_adaptive_cum_p": 0.9,
    "dflash_pack": "/abs/path/to/GLM-5.3-DFlash2",
    "dflash_bits": 4,
    "dflash_block_size": 8,
    "dflash_adaptive": true,
    "dflash_pld": false,
    "hybrid_drafter": true,
    "max_slots": 4,
    "kv_pool_gib": 24
  }
}
  1. Raise the GPU wired limit (resets on reboot) and launch with the same resolved absolute path:
sudo sysctl iogpu.wired_limit_mb=458752
MLX_ENABLE_INT8_QMM=1 ./zig-out/bin/mlx-serve \
  --model /abs/path/to/GLM-5.3-4bit-snapbank \
  --serve \
  --host 127.0.0.1 \
  --port 8080 \
  --ctx-size 262144 \
  --max-concurrent 4

Provenance & Credits

Downloads last month
-
MLX
Hardware compatibility
Log In to add your hardware

Quantized

Inference Providers NEW
This model isn't deployed by any Inference Provider. ๐Ÿ™‹ Ask for provider support

Model tree for botdevhq/GLM-5.3-mtp-affine4

Base model

zai-org/GLM-5.3
Quantized
(129)
this model