Run this model with HF Jobs

Run netprojects/Qwen4-35B-A3B-LayerFit-MLX-2.5bit on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.

Paste one of these prompts into your coding agent:

Fine-tune on my dataset

Use HF Jobs to fine-tune https://huggingface.co/netprojects/Qwen4-35B-A3B-LayerFit-MLX-2.5bit. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.

Run batch inference

Use HF Jobs to run batch inference with https://huggingface.co/netprojects/Qwen4-35B-A3B-LayerFit-MLX-2.5bit on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.

Evaluate on a benchmark

Use HF Jobs to evaluate https://huggingface.co/netprojects/Qwen4-35B-A3B-LayerFit-MLX-2.5bit. Ask me which benchmark to run, then save the scores and the per-example results to a new dataset repo. Run `hf jobs --help` first to learn the CLI.

Qwen4-35B-A3B · LayerFit MLX 2.5-bit

An Apple Silicon (MLX) build of Qwen/Qwen4-35B-A3B, the Qwen team's mixture-of-experts vision-language model (35B parameters, 3B active, plus a 20B n-gram embedding and a native MTP head), from upstream revision 849378c8db0d4537b7c6731738147378729d8920. Built and tested by NetProjects on 4 December 2026.

Weights: 27.8 GB in 6 shards. Text, image input, tool calling and the MTP head are included.

How it is quantized

LayerFit 2.5-bit spends bits where measured sensitivity says they matter most:

  • Always-on paths at 8-bit: attention and linear-attention projections, shared experts, hyper-connection mixers, n-gram key/value projections, the embedding table and the output head.
  • Routed experts at 2-bit (group 64), with expert down-projections at 3-bit in the 16 most sensitive layers: they hold most of the parameters, and only 8 of 256 run per token.
  • Importance-matrix rounding: 1,024 calibration samples x 512 tokens collected on the original BF16 weights, one layer at a time.
  • The 12.8 GB n-gram table is affine 4-bit (group 32) and can be memory-mapped.
  • Built with oMLX 0.8.5 (oq, enhanced mode, streamed calibration).

Fidelity to the original BF16 model

Measured on 4 December 2026 against the upstream BF16 weights, with the same token ids on both sides:

Test set Positions Top-1 agreement Mean KL (top-64)
Plain text and code (24 windows) 7,488 76.7% 0.283
Chat answers (12 prompts) 451 83.8% 0.353

Run it (Apple Silicon)

Qwen4 support is not in stock mlx-lm / mlx-vlm yet, so this build uses the Qwen4 runtime that ships with the oMLX 0.8.5 Homebrew installation (tested). Serve it with oMLX, or use the included offline runner run_qwen4.py (greedy decoding, one request at a time). The tokenizer and chat processor in processor/ are the upstream Qwen4 files, loaded locally:

PY="$(brew --prefix jundot/omlx/omlx)/libexec/bin/python"
uv pip install --target "$PWD/.processor-deps" --python "$PY" \
  'transformers==5.25.1' 'xgrammar==0.2.9' 'torch==2.15.0' 'torchvision==0.29.2'
HF_HUB_OFFLINE=1 PYTHONPATH="$PWD/.processor-deps" "$PY" -B run_qwen4.py \
  --prompt 'Which shape is blue? Answer with the shape only.' --image /path/to/image.png

Remove --image for text-only prompts. This exact package passed text generation, an image question, a structured tool call and use of the tool's result.

Smaller Macs: n-gram on SSD + MoE expert offload

oMLX 0.8.5 can keep the 12.8 GB n-gram table on SSD and keep only part of each layer's routed experts in memory, reading the rest from the model files when the router picks them. Routing is unchanged, so quality holds (within rounding); the trade is speed. Model settings in oMLX:

qwen4_ple_ssd_offload: true
moe_expert_offload_enabled: true
moe_expert_offload_resident_fraction: 0.25

The same settings work with this build and need less memory than the 3-bit, which was measured on an M5 Max with the MLX memory limit set to 10 GB (4 December 2026):

Experts in memory Peak MLX memory Chat top-1 vs BF16 (3-bit) Decode (indicative)
100% 16.7 GB 91.1% ~100 tok/s
25% 6.8 GB 90.5% ~29 tok/s
15% 5.5 GB 90.9% ~24 tok/s

Other builds

Licence and attribution

Qwen4-35B-A3B is created by the Qwen team (Alibaba Group) and released under the Apache License 2.0; the licence is included as LICENSE. This repository contains quantized weights derived from it; the tokenizer and processor code are the unmodified upstream files. Quantization and packaging by NetProjects. Not affiliated with Alibaba Group or the Qwen team.

@misc{qwen4-35ba3b,
    title  = {{Qwen4-35B-A3B}},
    author = {{Qwen Team}},
    month  = {December},
    year   = {2026},
    url    = {https://huggingface.co/Qwen/Qwen4-35B-A3B}
}
Downloads last month
-
Safetensors
Model size
57B params
Tensor type
U32
·
BF16
·
I64
·
MLX
Hardware compatibility
Log In to add your hardware

2-bit

Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for netprojects/Qwen4-35B-A3B-LayerFit-MLX-2.5bit

Quantized
(292)
this model

Collections including netprojects/Qwen4-35B-A3B-LayerFit-MLX-2.5bit