Run this model with HF Jobs
Run Youssofal/Qwen4-35B-A3B-MTPLX-Optimized-Speed on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.
Paste one of these prompts into your coding agent:
Fine-tune on my dataset
Use HF Jobs to fine-tune https://huggingface.co/Youssofal/Qwen4-35B-A3B-MTPLX-Optimized-Speed. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.
Run batch inference
Use HF Jobs to run batch inference with https://huggingface.co/Youssofal/Qwen4-35B-A3B-MTPLX-Optimized-Speed on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.
Evaluate on a benchmark
Use HF Jobs to evaluate https://huggingface.co/Youssofal/Qwen4-35B-A3B-MTPLX-Optimized-Speed. Ask me which benchmark to run, then save the scores and the per-example results to a new dataset repo. Run `hf jobs --help` first to learn the CLI.
Instructions to use Youssofal/Qwen4-35B-A3B-MTPLX-Optimized-Speed with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- MLX
How to use Youssofal/Qwen4-35B-A3B-MTPLX-Optimized-Speed with MLX:
# Make sure mlx-vlm is installed # pip install --upgrade mlx-vlm from mlx_vlm import load, generate from mlx_vlm.prompt_utils import apply_chat_template from mlx_vlm.utils import load_config # Load the model model, processor = load("Youssofal/Qwen4-35B-A3B-MTPLX-Optimized-Speed") config = load_config("Youssofal/Qwen4-35B-A3B-MTPLX-Optimized-Speed") # Prepare input image = ["http://images.cocodataset.org/val2017/000000039769.jpg"] prompt = "Describe this image." # Apply chat template formatted_prompt = apply_chat_template( processor, config, prompt, num_images=1 ) # Generate output output = generate(model, processor, formatted_prompt, image) print(output) - HERMES
How to use Youssofal/Qwen4-35B-A3B-MTPLX-Optimized-Speed with HERMES:
# No code snippets available yet for this library. # To use this model, check the repository files and the library's documentation. # Want to help? PRs adding snippets are welcome at: # https://github.com/huggingface/huggingface.js
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- LM Studio
- Atomic Chat
Coming in MTPLX v3 β Full native Apple Silicon support for Qwen4-35B-A3B (native speculative MTP decoding, full BF16 vision, 1M context window, concurrent batching, and automatic SSD/GPU n-gram memory) is shipping in MTPLX v3. Download at mtplx.com.
MTPLX: the fastest way to run Qwen 4 on a Mac. Native multi-token-prediction speculative decoding on Apple Silicon, exact at any temperature, with the complete untouched BF16 vision tower preserved.
Qwen 4 35B-A3B Optimized Speed
Dynamic 4-bit (g32) quant with 8-bit attention, embeddings, LM head, shared experts, and GDN output projections. Best quality-to-speed balance β recommended.
Qwen's 35B-A3B Qwen4 model (35B MoE with 3B activated, 20B n-gram embedding, 2B native MTP speculative head, 1M native context window, and full multimodal vision encoder), packaged for MTPLX v3.
Exact Quality vs Upstream BF16 (Qwen/Qwen4-35B-A3B)
Measured directly against the upstream BF16 Qwen/Qwen4-35B-A3B checkpoint across 256 assistant-completion positions (exact KL divergence KL(BF16 || quant) and greedy top-1 token agreement):
| Pack | Resident Weights (excl. SSD PLE) | Mean KL | Median KL | Top-1 Match | Vision Tower |
|---|---|---|---|---|---|
| Qwen 4 35B-A3B Bare Speed | 21.0 GiB (+11.9 GiB PLE) | 0.04495 | 0.00012 | 94.53% | 333 / 333 BF16 |
| Qwen 4 35B-A3B Optimized Speed (this pack) | 22.9 GiB (+11.9 GiB PLE) | 0.02937 | 0.00013 | 96.48% | 333 / 333 BF16 |
| Qwen 4 35B-A3B Optimized Quality | 36.7 GiB (+11.9 GiB PLE) | 0.01542 | 0.00006 | 97.27% | 333 / 333 BF16 |
Verified MTP Speculative Acceptance & Vision (Pre-Release MTPLX v3 Dev Build)
Measured locally on an Apple M5 Max (128 GB, fans locked at max) through live mtplx serve on a 768-token coding task and a live multimodal image prompt:
| Check | Result |
|---|---|
Official Qwen4 sampler (temperature=1.0, top_p=0.95, top_k=20) MTP draft acceptance |
45.6% (429/941) |
Greedy (temperature=0.0) MTP draft acceptance |
54.2% (449/828) |
| Vision tower verification (live PNG image turn) | PASS (333 / 333 BF16 vision_tower.* tensors verified in index & safetensors headers) |
| Native context window | 1,048,576 tokens (1M) |
(Full MTPLX v3 final release speed benchmarks will be posted upon MTPLX v3 launch.)
How It Is Built
- Routed MoE experts quantized to 4-bit affine (group size 32) for tight per-group precision.
- All Qwen Sparse Attention projections, GDN output projections,
embed_tokens,lm_head, shared experts, routers, and QSA indexers promoted to 8-bit affine (group size 64). - Hyper-connection weights, norms, GDN recurrence/conv parameters, and the complete 333-tensor vision tower stay untouched in BF16.
- MTP speculative draft head quantized to 4-bit affine (group size 32) in
mtp.safetensors; 20B n-gram table ships inngram-table.safetensors(4-bit g32, streams from SSD on 32β48 GB Macs or runs GPU-resident automatically on 64 GB+ Macs).
| Spec | Value |
|---|---|
Total download (includes 11.92 GiB ngram-table.safetensors) |
34.88 GiB |
| Resident weights (body + vision + MTP, n-gram streamed from SSD) | 22.93 GiB (21.56 body + 0.83 vision + 0.54 MTP) |
| Recommended Macs | 36 GB+ / 48 GB+ unified memory (64 GB+ runs the n-gram table GPU-resident automatically) |
| Context window | 1,048,576 tokens |
| Vision tower | Complete 333 / 333 untouched BF16 tensors (model-vision.safetensors) |
| Sampling contract | temperature=1.0, top_p=0.95, top_k=20 (official Qwen4 contract) |
Use It (Coming in MTPLX v3)
Mac app: download MTPLX v3 at mtplx.com and select Qwen 4 35B-A3B Optimized Speed.
Command line (MTPLX v3):
pip install -U mtplx
mtplx serve --model Youssofal/Qwen4-35B-A3B-MTPLX-Optimized-Speed
Sibling Packs
- Bare Speed β 4-bit g64 routed MoE β lightest & fastest build for 32 GB+ Macs
- Optimized Quality β full 8-bit g64 body & MTP β near-BF16 fidelity for 64 GB+ Macs
Base model: Qwen/Qwen4-35B-A3B (Apache 2.0; upstream model card preserved as README-upstream-qwen.md).
- Downloads last month
- 2,360
4-bit