Edge0-120B MLX

An MLX inference port of Edge0/Edge0-120B-q3k (120B total / 8.64B active parameters, derived from Qwen/Qwen3.8-Flash-Next).

This repository contains the port's code, tests, measured results, findings, and a self-contained HTML explainer. It does not re-upload the official 86.8 GiB weight pack. The loader reads that pack in place, losslessly repacking Q8_0 / Q4_0 / Q2_0 tensors into MLX affine quantizations at load time.

See FINDINGS.md for the full write-up and explainer/index.html for the interactive report.

This port is also published at austindixson/Edge0-120B-MLX and mlx-community/Edge0-120B-MLX.

License

  • Model weights and Edge0-specific model materials remain under the Edge0 Community Model License 1.0, with upstream materials under Qwen Community License 1.0. See NOTICE and release-scope.json. Both licenses must be followed. Selling the model, offering paid model inference or fine-tuning as a service, or offering an independent commercial coding or office assistant requires a separate written license from Edge0 and from Qwen, as applicable.
  • MLX port code and tests in this repository are licensed under Apache License 2.0. That grant covers only the port, not the weights.

This repo is a community inference tool plus published benchmark results. It is not a Commercial Model Offering.

Measured results

Hardware: an M3 Max MacBook Pro, 128 GB unified memory (400 GB/s). Software: MLX 0.32.5, Python 3.13.15. Latent dense projections at Q4_0 unless noted.

Correctness

  • Dequant unit tests: 8/8 passed, max abs error 0.0 on Q3_K, IQ4_NL, Q8_0, Q4_0, and Q2_0; fused Metal MoE max relative error 2.06e-7 (gate+up+SiLU) and 3.05e-7 (down-proj).
  • 48/48 layers finite (0 NaN/Inf) after a 22.7 s load.
  • WikiText-2 test perplexity (n = 32,752 scored tokens, 16 Γ— 2048-token windows): Q8_0 5.9392 vs Q4_0 6.0271. Delta = 6.0271 βˆ’ 5.9392 = +0.0879 = +1.48%.
  • Greedy coherence: 7/8 prompts passed the strict substring check; all 8 were factually correct. MTP k=3 and k=4 matched non-MTP greedy tokens on the exact-match prompts reported in the findings.

Speed (greedy, du=Q4_0)

Setting Without MTP With MTP Math
Agent decode, 512 tokens 27.08 tok/s 54.27 tok/s (k=3) 54.27 / 27.08 = 2.00Γ— (+27.19 tok/s, +100.4%)
Chat decode, 512 tokens 24.46 tok/s 39.67 tok/s (k=4) (39.67 βˆ’ 24.46) / 24.46 = +62.2%
Prefill, 4K tokens β€” 413.7 tok/s TTFT 9.901 s; peak 46.30 GB
Prefill, 16K tokens β€” 348.2 tok/s TTFT 47.069 s; peak 46.18 GB

Peak MLX memory across these Q4_0 workloads is 46.30 GB.

Cross-hardware context only (not a same-machine baseline). Edge0's published Metal figures were measured on an M2 Ultra (800 GB/s, 2.0Γ— this machine's bandwidth) with a different engine and prompt suite:

  • Agent decode: 54.27 / 63.0 = 86.1% of the published M2 Ultra number.
  • Prefill at 4K: 413.7 / 867.6 = 47.7% of the published M2 Ultra number.

Prefill is the gap that remains. Bandwidth-normalized ratios and the full protocol are in FINDINGS.md Β§4.

Usage

Apple Silicon is required. Download the official pack, then point the port at it.

hf download Edge0/Edge0-120B-q3k --local-dir ./models/Edge0-120B-q3k
python3 -m venv .venv && source .venv/bin/activate
pip install -r requirements.txt
export EDGE0_MODEL_DIR=./models/Edge0-120B-q3k

python src/run_generate.py --prompt "The capital city of France is" --max-tokens 32 --mtp --spec-k 3
python src/run_generate.py --chat --prompt "Write a short note about latent MoE." --max-tokens 128 --mtp

--model-dir can be used instead of EDGE0_MODEL_DIR. Default latent dense precision is Q4_0; pass --du-bits 8 for Q8_0.

The install pins mlx==0.32.5 and the mlx-lm commit used for these numbers (0c4c991, which provides mlx_lm.models.qwen4_exp).

Tests and benches

# Synthetic dequant tests always run. Spot-checks against the real pack run when EDGE0_MODEL_DIR is set.
pytest tests/test_dequant.py

python src/verify_layers.py --du-bits 4
python src/eval_coherence.py --du-bits 4 --spec-k 3
python src/eval_ppl.py --also-q4 --data /path/to/wikitext2_test.txt
python src/bench_speed.py --du-bits 4 --also-q8

WikiText-2 test text is the public Salesforce/wikitext wikitext-2-raw-v1 test split. It is not shipped in this repo.

What's in the port

  • Read-only loader for the official Strata/GGUF pack (model-skeleton.gguf, experts.bin, latent_dense_q{4,8}.bin, ple-fp8.gguf, MTP, tokenizer).
  • Custom Metal kernels for Q3_K / IQ4_NL dequant and fused latent MoE.
  • Chunked prefill, BF16 or INT8 KV cache, and MTP speculative decode with cache rollback.
  • Architecture coverage: 48 hybrid GatedDeltaNet + QSA layers, 4-stream Hyper-Connections, 512-expert latent MoE, memory-mapped FP8 E4M3 n-gram PLE, and the 1.26B Q2_0 MTP draft head.

Files

Path What it is
src/ Loader, model, kernels, generate loop, eval and bench scripts
tests/test_dequant.py Dequant and fused-kernel unit tests
results/*.json Recorded correctness and speed measurements
FINDINGS.md Full results, protocol, and limitations
explainer/index.html Self-contained visual explainer
prompts/coherence_prompts.json Fixed greedy-coherence suite

Acknowledgments

Edge0 for the model and published Metal reference numbers. The Qwen team for Qwen3.8-Flash-Next. The MLX and mlx-lm maintainers for the Apple Silicon stack this port builds on.

Downloads last month

-

Downloads are not tracked for this model. How to track
Inference Providers NEW
This model isn't deployed by any Inference Provider. πŸ™‹ Ask for provider support

Model tree for mlx-community/Edge0-120B-MLX

Finetuned
(2)
this model