Qwen3.8-27B-think-pi-adapted-MLX-adapter
MLX adapter for optimized Qwen3.8 reasoning
2 min read
This LoRA adapter (a lightweight add-on for the base model) ports the weights of the harness-hub/Qwen3.8-27B-think-pi-adapted model to the mlx-lm library format for running on Apple Silicon devices. The model is trained using reinforcement learning for the pi coding agent with reasoning mode enabled. It delivers results comparable to the original on benchmarks while using significantly fewer reasoning tokens. This adapter is useful for developers and Mac users running large language models locally via MLX.
Key features
- Adapter rank 32 with a scale of 2.0, covering 256 attention modules and layers of Qwen3.8.
- Uses approximately 35–42% fewer tokens for output in programming tasks compared to alternatives.
- Compact adapter weight size of just 638 MB.
- Full compatibility with the standard mlx-lm library and server launch utilities.
What you can do
- Run local code generation with reasoning mode enabled on a Mac using Python or the command line.
- Attach the adapter on top of a base quantized model (such as 4-bit) to save RAM.
- Set up a local server to work with the pi coding agent via mlx_lm.server.
Example
from huggingface_hub import snapshot_download
from mlx_lm import load, generate
adapter = snapshot_download("netprojects/Qwen3.8-27B-think-pi-adapted-MLX-adapter")
model, tokenizer = load("mlx-community/Qwen3.8-27B-4bit", adapter_path=adapter)
prompt = tokenizer.apply_chat_template([{"role": "user", "content": "Hello"}], add_generation_prompt=True,
enable_thinking=True, tokenize=False)
print(generate(model, tokenizer, prompt=prompt, max_tokens=4096))Read more
DetailsBenchmarks: SWE-bench Pro (hard 51) — 76.5%, Terminal-Bench 2.1 — 57.5%.
Hardware requirements: compatible with MLX builds of Qwen3.8 (the 4-bit version requires at least 32 GB of Mac memory).
Training details: trained using AsyncGRPO in TRL within the pi coding agent with reasoning enabled.
License: Apache-2.0.










Comments