Qwen3.8-27B-pi-adapted for Apple Silicon (MLX, 2.5-bit)

harness-hub/Qwen3.8-27B-pi-adapted (revision e786f84) merged into Qwen/Qwen3.8-27B (revision 3756181) and converted to MLX with mlx-vlm, Qwen's MTP layer included. This is a text-only build: the vision encoder is removed. The MLP gate and up projections are 2-bit, the down projections 3-bit, every attention and linear-attention (Gated DeltaNet) projection 4-bit, and the token embedding and output layer 4-bit (affine, group 64), about 3.65 bits per weight overall. Size: 11.8 GB.

harness-hub trained this LoRA with reinforcement learning (AsyncGRPO in TRL) to be the model behind the pi coding agent on software-engineering and terminal tasks. Their published results, under pi with thinking off: Terminal-Bench 2.1 39.5% โ†’ 55.8% and SWE-bench Pro (hard 51) 29.4% โ†’ 62.7% against the base model, with 55-64% fewer tool calls per task. See the original adapter card for the method, data and full results.

Build Size Same next token as bf16 KL vs bf16
netprojects/Qwen3.8-27B-pi-adapted-MLX-6bit (recommended) 23.1 GB 99.0% 0.0015
netprojects/Qwen3.8-27B-pi-adapted-MLX-8bit 30.0 GB 99.1% 0.0004
netprojects/Qwen3.8-27B-pi-adapted-MLX-4bit 16.3 GB 95.6% 0.0201
netprojects/Qwen3.8-27B-pi-adapted-MLX-3bit 13.8 GB 91.4% 0.0884
netprojects/Qwen3.8-27B-pi-adapted-MLX-2.5bit 11.8 GB 85.5% 0.2363
netprojects/Qwen3.8-27B-pi-adapted-MLX-bf16 55.6 GB reference reference
netprojects/Qwen3.8-27B-pi-adapted-MLX-adapter 638 MB LoRA only, for mlx-lm on any Qwen3.8-27B MLX build

The 6-bit build is the recommended balance of size and fidelity; 8-bit is closest to bf16; 4-bit, 3-bit and the text-only 2.5-bit are for Macs with less memory (3-bit and 2.5-bit fit 24 GB Macs).

Use with pi

The adapter was trained and evaluated with thinking off, so keep it off. Serve the model with mlx-lm's OpenAI-compatible server:

pip install -U "mlx-lm>=0.32.2"
mlx_lm.server --model netprojects/Qwen3.8-27B-pi-adapted-MLX-2.5bit --port 8000 \
  --chat-template-args '{"enable_thinking": false}'

Add it to ~/.pi/agent/models.json:

{
  "providers": {
    "local": {
      "baseUrl": "http://localhost:8000/v1",
      "api": "openai-completions",
      "apiKey": "dummy",
      "models": [{ "id": "netprojects/Qwen3.8-27B-pi-adapted-MLX-2.5bit" }]
    }
  }
}

"api": "openai-completions" matters: the adapter was trained and evaluated with the Chat Completions API, not the Responses API. Then:

pi --provider local --model netprojects/Qwen3.8-27B-pi-adapted-MLX-2.5bit --print "Find out why the tests in tests/test_parser.py fail and fix the bug."

Use from Python

Text only, with mlx-lm:

from mlx_lm import load, generate

model, tokenizer = load("netprojects/Qwen3.8-27B-pi-adapted-MLX-2.5bit")
messages = [{"role": "user", "content": "Write a Python function that parses '1.5M' into bytes."}]
prompt = tokenizer.apply_chat_template(messages, add_generation_prompt=True, enable_thinking=False, tokenize=False)
print(generate(model, tokenizer, prompt=prompt, max_tokens=512))

The tokenizer and chat template are harness-hub's files, unchanged (same vocabulary and tool-call format as Qwen3.8-27B). Tool calls use Qwen's XML format (<tool_call><function=...><parameter=...>), which mlx-lm's server returns as OpenAI tool_calls.

Faster decoding with MTP

This build keeps Qwen3.8-27B's own multi-token-prediction (MTP) layer in model-mtp.safetensors, quantized to 4-bit and declared in config.json as mtplx_mtp_quantization. The adapter does not change that layer. mlx-vlm uses it as a built-in draft model when you pass the same repository as --draft-model:

mlx_vlm.generate --model netprojects/Qwen3.8-27B-pi-adapted-MLX-2.5bit --draft-model netprojects/Qwen3.8-27B-pi-adapted-MLX-2.5bit \
  --draft-kind mtp --temperature 0 --max-tokens 512 --prompt "Write a Python function that checks whether a number is prime."

Every drafted token is checked by the full model. With greedy decoding the text matches plain decoding until a near-tie, where the batched check can round the other way, so long answers can diverge slightly.

What was checked

On a MacBook Pro M5 Max (128 GB), 19 November 2026, with mlx 0.32.4, mlx-lm 0.32.2 and mlx-vlm 0.7.11. The build was made from netprojects/Qwen3.8-27B-pi-adapted-MLX-bf16 (every file checked against the Hub's SHA-256 hashes).

  • Quantization. The build is checked to be exactly the affine (group 64) quantization of the bf16 build, with the bit widths described above.
  • Agreement with bf16 (12 short prompts, 9 with thinking off and 3 with thinking on, 961 teacher-forced positions): same next token as bf16 on 85.5% of positions (mean KL 0.2363).
  • Tool calling and coding (thinking off, the included chat template): one agent-style prompt with bash and read tools produced a well-formed tool call; three short Python tasks run against asserts: 3/3.
  • GSM8K, 50 fixed test questions (thinking off, greedy, 512-token cap): 45/50, against 44/50 for the bf16 build.
  • Thinking (two short maths prompts): the reply closes </think> once and the answer is right: 2/2.
  • Memory. Peak 13.8 GB with an 8K-token prompt (mlx-lm, text), so a Mac with 24 GB+ of memory runs it with the default GPU memory limit (about two thirds of RAM up to 36 GB). On a Mac just below that you can raise the limit until the next restart (sudo sysctl iogpu.wired_limit_mb=...), leaving several GB for macOS, and use short contexts.
  • Text-only. The vision tensors are removed and config.json sets language_model_only; the build loads in mlx-lm and mlx-vlm.
  • MTP layer. The bundled MTP tensors equal Qwen3.8-27B's mtp.* weights quantized to 4-bit; the build loads in mlx-lm and mlx-vlm with the extra file present and decodes with its bundled MTP head.

Credits

The adapter is by harness-hub; the base model is Qwen3.8-27B by the Qwen Team, Alibaba Cloud. If you use the model, please cite their work (see the adapter card and the Qwen3.8-27B card).

License

Apache-2.0, as Qwen3.8-27B and the harness-hub adapter. LICENSE is the Apache-2.0 text from the Qwen3.8-27B repository and NOTICE describes the conversion and credits harness-hub and the Qwen Team (Alibaba Cloud).

Published by NetProjects (Internet Projects Ltd). Not affiliated with Hugging Face, harness-hub or Alibaba.

More MLX builds from NetProjects: huggingface.co/netprojects ยท netprojects.com

Downloads last month
19
Safetensors
Model size
28B params
Tensor type
U32
ยท
BF16
ยท
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/Qwen3.8-27B-pi-adapted-MLX-2.5bit

Base model

Qwen/Qwen3.8-27B
Quantized
(18)
this model

Collection including netprojects/Qwen3.8-27B-pi-adapted-MLX-2.5bit