--- library_name: mlx license: apache-2.0 pipeline_tag: image-text-to-text tags: - mlx - apple-silicon - speculative-decoding - qwen - qwen3 - qwen3-next - mtp - mtplx - local-ai - vision-language - multimodal base_model: - Youssofal/Qwen3.6-27B-MTPLX-Optimized-Speed - Qwen/Qwen3.6-27B --- # Qwen3.6-27B MTPLX Optimized Speed (Vision-Enabled) A unified local model that both codes at the Qwen3.6-27B level and processes images/videos, packaged for Apple Silicon via **MTPLX** native speculative decoding with Multi-Token-Prediction (MTP). This repository restores the multimodal vision tower that is typically stripped in text-only MLX/MTPLX conversions. ## Architecture - **Body**: 4-bit affine, group size 64 (from [Youssofal/Qwen3.6-27B-MTPLX-Optimized-Speed](https://huggingface.co/Youssofal/Qwen3.6-27B-MTPLX-Optimized-Speed)) - **MTP sidecar (mtp/weights.safetensors)**: Prequantized MTP heads with a 3-bit affine group-64 draft-only LM head. - **Vision tower (vision_tower.safetensors, 333 tensors, bf16 unquantized)**: Extracted verbatim from the official checkpoint's own `model.visual.*` weights (shards 7 and 8 of [Qwen/Qwen3.6-27B](https://huggingface.co/Qwen/Qwen3.6-27B)) and renamed to the `vision_tower.*` prefix for MTPLX native VLM compatibility (~879 MB). ## Usage (MTPLX) ```bash mtplx start --model --port 8092 \ --chat-template-path /chat_template.jinja ``` Serves an OpenAI-compatible endpoint supporting both text and image input payloads via `POST /v1/chat/completions`. The MTPLX CLI defaults to `mtp_history_policy=committed`, which this model requires for healthy deep-position acceptance. The model's recommended draft sampler is temperature 0.7 (see `recommended_draft_sampler` in `mtplx_runtime.json`); pass `--draft-temperature 0.7` to match. ## Performance (measured) Apple M5 Pro 64 GB, MTPLX 1.0.4, temperature 0.6, `mtp_history_policy=committed`, `--draft-temperature 0.7` (model recommended), thinking OFF, warm (4 warmup prompts discarded), 8 measured prompts from the calibration_coding suite, max_tokens=192, median tok/s. | Depth | tok/s (wall-clock e2e) | tok/s (decode-only) | speedup vs AR (e2e) | acceptance pos1/2/3 | |---|---|---|---|---| | AR (`--no-mtp`) | 13.7 | 14.5 | 1.00x | - | | MTP depth 1 | 19.7 | 20.9 | 1.44x | 0.923 | | MTP depth 2 | 19.9 | 20.8 | 1.46x | 0.950 / 0.753 | | MTP depth 3 | 18.1 | 19.7 | 1.32x | 0.900 / 0.759 / 0.648 | Two throughput definitions are reported: - **tok/s (wall-clock e2e)** = `generated_tokens / total_elapsed`, includes prompt prefill. The real end-to-end speed and the honest denominator for the speedup ratio. - **tok/s (decode-only)** = `generated_tokens / decode_elapsed`, excludes prefill. Acceptance is stable across runs: greedy draft (temp 0.0) gives 0.874/0.740/0.636, recommended draft (temp 0.7) gives 0.900/0.759/0.648, both within noise. Vision graft has zero acceptance cost relative to the text-only source (Youssofal/Qwen3.6-27B-MTPLX-Optimized-Speed measures identical acceptance 0.874/0.740/0.636 under the same config). Earlier baked `mtplx_runtime.json` figures (acceptance 1.0/0.98/0.94, ~63 tok/s) were measured on Apple M5 Max 128 GB and are not reproducible on M5 Pro 64 GB due to lower memory bandwidth; they are preserved in the `historical_m5max` field of `mtplx_runtime.json` for traceability. The vision tower is lazy-loaded (only when a request carries an image), so text-only throughput is unaffected by it. Numbers are indicative, not a benchmark suite. ## Sources And Attribution | Component | Source | Revision / License | |---|---|---| | Base model | `Qwen/Qwen3.6-27B` | Apache-2.0 | | Quantized Text/MTP repo | `Youssofal/Qwen3.6-27B-MTPLX-Optimized-Speed` | Apache-2.0 | | MTPLX conversion | `youssofal/mtplx` | Apache-2.0 |