Qwen3.6-35B-A3B — MLX VQ (trained-codebook) @2.6 bpw, custom Metal kernel

Vector-quantized (AQLM-style, trained codebooks + GPTQ compensation) MLX build of Qwen/Qwen3.6-35B-A3B — to our knowledge the first trained-codebook VQ model served on Apple Silicon, via the bundled mx.fast.metal_kernel implementation (code/). 11.53 GB, measurably better than scalar quantization at the same size.

⚠️ Not loadable by stock mlx-lm / LM Studio / Ollama / oMLX — the experts use a VQ format that needs the bundled loader + Metal kernel (~400 lines of Python, mlx>=0.31 only, no compilation).

The scalar-vs-VQ tradeoff this build wins

build size think-ja PPL vs bf16 multilingual
GPTQ-3.5bpw (scalar) 15.35 GB +6.6% +6.9%
GPTQ-2.7bpw (scalar) 12.03 GB +17.5% +15.4%
VQ-2.4bpw — for 16 GB Macs 10.49 GB +19.5% +21.6%
this (VQ) 11.53 GB +12.4% +12.2%

Smaller and significantly better than the scalar 2.7bpw build — the point of codebook quantization at low bits.

Recipe

  • Experts (91.7% of params): per-(layer,tensor) bits {2bit: 69, 3bit: 11 tensors} chosen by Fisher/gxw MCKP; Qwen-native codebooks (d=4, K=256 / K=4096; k-means on group-normalized subvectors — GLM-fit books measurably transfer worse, so refit); GPTQ error compensation (pooled per-layer input Hessians, ja-centric calibration). Expert avg 2.38 bpw + fp16 group scales.
  • Spine: GPTQ 4bit gs64 (linear-attention qkv/z/out, attention q/k/v/o, shared experts), lm_head 6bit, routers 8bit, embeddings 4bit — inherited from the 2.7bpw scalar build.
  • Vision tower: unquantized bf16.
  • Format: switch_mlp.*.vq_codes (LSB-first packed 8/12-bit indices, int32) + vq_scales (fp16 per-128 group) + vq_codebooks.safetensors; metadata in config.json["vq"].

Speed (M-series, measured on 48 GB)

  • decode ~66 tok/s, prefill ~213 tok/s — fused Metal kernels (gate+up+SiLU in one dispatch; simdgroup-per-row GEMV with half4 loads).

Run (Apple Silicon, ≥16 GB unified memory)

pip install "mlx>=0.31" "mlx-lm>=0.31"
hf download aquaman164/Qwen3.6-35B-A3B-MLX-VQ-2.6bpw --local-dir qwen-vq

# OpenAI-compatible server
python qwen-vq/code/vq_serve.py --model qwen-vq --port 8090
# then: curl http://127.0.0.1:8090/v1/chat/completions -d '{"model":"qwen-vq", ...}'
#       (use the model id returned by /v1/models)

# or a one-shot generation test
python qwen-vq/code/vq_generate.py qwen-vq 100

code/vq_switch.py exposes load_vq_model(path) -> (model, config) if you want to embed it. Thinking mode is on by default (Qwen3.6 native); pass enable_thinking=False via the chat template for direct answers.

Provenance / license

Base model © Alibaba Cloud, Apache-2.0. Quantization pipeline: loss-aware allocation + GPTQ-VQ encode built on OneCompression; serving adapter published as model #3 of vqmoe.

Downloads last month
93
Safetensors
Model size
5B params
Tensor type
U32
·
I32
·
BF16
·
F16
·
MLX
Hardware compatibility
Log In to add your hardware

4-bit

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

Model tree for aquaman164/Qwen3.6-35B-A3B-MLX-VQ-2.6bpw

Quantized
(807)
this model