Quantized Qwen/Qwen3-Coder-Next using mlx-lm to 6-bit with group_size 128 for main weights and fine-grained group_size 64 for MoE weights, with the aim of maximum accuracy for 6bit quantization.
Testing with mlx_lm.evaluate using mmlu_pro with 50 Qs for each topic, comparing the 6-bit g128 quant with the 6-bit g64 quant:
1import mlx_lm
2from mlx_lm.sample_utils import make_sampler
3
4model_path = "petergilani/qwen3-coder-next-6bit-g128"
5model, tokenizer = mlx_lm.load(model_path)
6
7sampler = make_sampler(temp=1.0, top_p=0.95, top_k=40)
8
9prompt = "Write a Python function to calculate the factorial of a number."
10response = mlx_lm.generate(
11 model,
12 tokenizer,
13 prompt=prompt,
14 sampler=sampler,
15 max_tokens=512
16)
17print(response)