Alibaba's Qwen4-35B-A3B Runs Locally on 24 GB With 1M Token Context
Unsloth has shipped Dynamic GGUF quantizations of Alibaba's new Qwen4-35B-A3B, letting the 1M-context MoE run locally on consumer hardware.
Takeaways
- Unsloth released Dynamic GGUFs for Alibaba's new Qwen4-35B-A3B under Apache 2.0.
- Sparse MoE: 35B total, 3B active, 256 experts, native 1M-token context window.
- Hybrid linear + sparse attention plus 20B n-gram embeddings and built-in MTP speculative decoding.
- Beats Qwen3.8-27B on 10 of 12 benchmarks; big gains on DeepSWE (61.8) and Terminal Bench (21.2).
- Quants span 21 GB (1-bit) to 62 GB (8-bit); UD-Q4_K_M at 35 GB is the sweet spot.
- New
reasoning_effortknob with four levels (xhigh/high/low/off) controls thinking depth.
Alibaba has released Qwen4-35B-A3B, the first open-weights model in the Qwen4 series, and Unsloth published local inference builds within hours. The Unsloth release ranges from 21.3 GB at its lowest precision to 62.3 GB at 8-bit precision, giving developers several options for GPUs, workstations, and Apple silicon.
GGUF packages model weights for the llama.cpp ecosystem, while quantization reduces their numerical precision to save memory. Unsloth’s Dynamic method assigns different precisions to tensors according to their sensitivity. These files target inference; fine-tuning typically starts from the original model weights.
What 3B active means for storage
The Qwen model card describes a sparse Mixture-of-Experts model with 35 billion backbone parameters and about 3 billion active for each token. Every layer routes a token through a small subset of experts, reducing computation while retaining the full expert pool in memory.
Additional components raise the listed footprint to roughly 56 billion parameters: a 20-billion-parameter n-gram embedding table and a 2-billion-parameter Multi-Token Prediction head. The model ships under Apache 2.0, which permits commercial use and modification subject to the license terms, and supports a native context window of 1,048,576 tokens.
Linear and sparse attention split the work
Qwen4’s 40-layer stack combines Gated DeltaNet linear-attention blocks with Qwen Sparse Attention blocks in a 3-to-1 ratio. Linear attention maintains a compact representation of earlier tokens, while periodic sparse-attention layers retrieve selected positions from the wider context. Each block also contains a 256-expert feed-forward layer that activates eight routed experts and one shared expert per token.
- N-gram embeddings: A 10-million-entry table of bigrams and trigrams enters the network at layer 2. The lookup adds substantial stored capacity with little per-token arithmetic. Unsloth also exposes table substitutions for developers willing to trade accuracy for a smaller memory footprint.
- Multi-Token Prediction: The auxiliary head learns to predict several future tokens. Compatible runtimes can use those predictions for speculative decoding, accepting multiple tokens during one verification step. Unsloth includes the head in every quant, while the speedup depends on runtime support.
- Budgeted sparse attention: An indexer selects a limited portion of the earlier context, capped at 512 blocks or 2,048 tokens per sparse-attention operation. That budget helps control the cost of processing a million-token window.
Early scores favor code and agents
Alibaba’s model card says its full benchmark reporting remains in progress. Launch charts and third-party trackers nevertheless provide preliminary comparisons, with the largest reported gains appearing in coding and agent evaluations.
| Comparison model | Result across 12 tests | Selected scores |
|---|---|---|
| Qwen3.8-27B | 10 wins, 1 tie, 1 loss | Terminal Bench 4.1: 21.2 vs. 5.6; DeepSWE: 61.8 vs. 42.2 |
| Qwen3.8-Flash-Next | 6 wins, 6 losses | DeepSWE: 61.8 vs. 58.7; AutomationBench-AA: 57.9 vs. 55.9 |
Artificial Analysis gives Qwen4-35B-A3B a score of 25 on Intelligence Index v5.0.2. The same index lists Qwen4-Max at 43, Claude Opus 5.5 at 59, Gemini 4 Carbon at 60, and GPT-6.2 Astra at 62. The index combines several capability evaluations, so comparisons should use the same index version. These results place the open model well below larger proprietary systems on aggregate capability while preserving its advantages in local deployment, cost control, and data handling.
Quant size sets the memory floor
| Quant | Size | Practical target |
|---|---|---|
| UD-IQ1_S / UD-IQ1_M | 21.3 / 22.3 GB | 24 GB systems with minimal headroom or CPU offload |
| UD-Q2_K_XL | 27.7 GB | 32 GB unified memory or GPU plus system-memory offload |
| UD-Q4_K_M | 35.2 GB | 48 GB VRAM or 64 GB unified memory |
| UD-Q6_K_XL | 52.2 GB | 64 GB or larger systems |
| UD-Q8_K_XL | 62.3 GB | 80 GB or larger systems |
Runtime memory also covers the context cache, temporary buffers, the host application, and operating-system use. Longer prompts increase those requirements even with Qwen4’s reduced cache design. Apple silicon shares unified memory with macOS, while partial GPU offload shifts some layers into system RAM at the cost of generation speed.
In one 12-case community test on a 24 GB Mac mini, Qwen4-35B-A3B at UD-IQ2_M recorded one strict pass and five passes after code fences were removed, with a median response time of 1.7 seconds. Qwen3.8-27B at UD-Q4_K_M recorded eight strict passes with an 8.6-second median. The small sample cannot establish general model quality, but it illustrates the accuracy cost of pushing a larger model into an extremely low-bit quant.
Bring a current runtime
Recent versions of llama.cpp, LM Studio, Ollama, Jan, and Unsloth’s desktop application can load the GGUF builds. Older releases may lack support for Qwen4’s architecture, chat template, or Multi-Token Prediction head, so the runtime should be updated before troubleshooting model output.
The current llama.cpp commands can download and launch the recommended UD-Q4_K_M build directly from Hugging Face:
llama-server -hf unsloth/Qwen4-35B-A3B-GGUF:UD-Q4_K_M
llama-cli -hf unsloth/Qwen4-35B-A3B-GGUF:UD-Q4_K_M
Compatible chat servers expose graded reasoning through the reasoning_effort parameter. Available values are xhigh, high, low, and off, with high as the default. Lower settings can reduce analysis tokens per attempt, although tool-using agents may consume more total tokens when shallow plans cause retries.
| Mode | Temperature | Top-p | Top-k | Presence penalty |
|---|---|---|---|---|
| Thinking | 1.0 |
0.95 |
20 |
Default |
| Non-thinking | 0.7 |
0.80 |
Runtime default | 1.5 |
Long local jobs are the target
Qwen4’s 3 billion active parameters give it a compute profile closer to a small dense model than to a dense 35-billion-parameter model. Actual throughput still depends on memory bandwidth, expert-routing support, quantization level, context length, and the number of layers offloaded to the GPU.
The Unsloth guide suggests budgets of up to 262,000 tokens for reasoning and 131,000 for final output within the one-million-token context. Those figures are upper allocations for unusually long jobs. Prompt ingestion, cache growth, and generated output still consume time and memory as the context expands.
Likely workloads include repository-scale code analysis, multi-step tool use, frontend generation, and long-document processing. Local execution can also keep prompts and retrieved documents on the developer’s machine, provided the surrounding tools and API integrations remain local.
Developers moving from Qwen3-30B-A3B should account for Qwen4’s larger stored footprint even though the active-parameter counts are similar. Qwen4-35B-A3B is best suited to systems that can hold a moderate quant comfortably and benefit from long context, private inference, and repeated agent actions. Larger proprietary models retain a substantial lead on the cited aggregate intelligence index.