Qwen4-35B-A3B GGUF Local Quantization & llama.cpp Deployment Guide

Unsloth Dynamic v3.1 GGUF quantizations shrink Qwen4-35B-A3B (35B MoE with 3B active parameters, 20B n-gram Engram embeddings, and 2B MTP head) from 105.06 GiB BF16 down to 21.79 GiB (UD-IQ2_XXS) or 33.75 GiB (UD-Q4_K_XL). Combined with SSD n-gram offloading and llama.cpp serving, teams can run native 1M-context multimodal coding agents on local workstations.
Qwen4-35B-A3B GGUF Local Quantization & llama.cpp Deployment Guide: Unsloth Dynamic v3.1 GGUF quantizations shrink Qwen4-35B-A3B (35B MoE with 3B active parameters, 20B n-gram Engram embeddings, and 2B MTP head) from 105.06 GiB BF16 down to 21.79 GiB (UD-IQ2_XXS) or 33.75 GiB (UD-Q4_K_XL). Combined with SSD n-gram offloading and llama.cpp serving, teams can run native 1M-context multimodal coding agents on local workstations. Designed as a zero-dependency, open-source TypeScript architecture under the MIT License with native Model Context Protocol (MCP) support and deterministic phase state machines.
- 3B Active Compute With 256-Expert MoE: Routes 8 routed + 1 shared expert per token across 40 layers (10 x 3 Gated DeltaNet + 1 Qwen Sparse Attention).
- SSD Engram Offloading for Low-RAM Hosts: Offloads the 20B 10M-entry n-gram lookup table to NVMe SSD, allowing 3-bit Dynamic v3.1 quants on 18 GB RAM systems.
- Built-In 1.87 GiB MTP Speculative Head: Every Unsloth GGUF tier includes optional Multi-Token Prediction weights (mtp-Qwen4-35B-A3B-Q8_0.gguf) for faster local decode.
- Native 1,048,576-Token Context Window: Hybrid linear-sparse attention keeps KV cache compact for full-repository coding and visual agent trajectories.
import { createAgent } from '@smoke-monkey/harness';// Connect Smoke Monkey Harness to local llama.cpp serving Unsloth Qwen4-35B-A3B GGUFconst agent = createAgent({agentId: 'qwen4-gguf-local-coder',provider: 'openai-compatible',baseUrl: 'http://127.0.0.1:8080/v1',model: 'unsloth/Qwen4-35B-A3B-GGUF:UD-Q4_K_XL',workspacePath: process.cwd(),permissions: {read_file: 'allow',write_file: 'allow',run_command: 'ask',},});async function main() {const result = await agent.run('Audit src/ for unhandled Promise rejections, patch error boundaries, and run npm test.');console.log('Qwen4 GGUF Agent Result:', result.summary);}main().catch(console.error);
Watch: Related Video Guides
Qwen3 27B on Llama.cpp — 67 to 120 Tokens/sec with MTP + Ngram
Qwen3.8-27B GGUF: Run It Local with llama.cpp, Ollama & LM Studio
What Is Unsloth Dynamic v3.1 GGUF Quantization for Qwen4-35B-A3B?
Unsloth Qwen4-35B-A3B GGUF is a suite of mixed-precision GGUF quantizations for Alibaba's 56B-parameter (35B MoE with 3B active, 20B n-gram embedding, and 2B MTP) multimodal model. Unlike uniform 4-bit rounding, Dynamic v3.1 keeps sensitive Gated DeltaNet projections, attention router gates, and vision encoder weights (mmproj-BF16.gguf) at higher bit-widths.
Because Qwen4-35B-A3B allocates 20B parameters to a 10,000,000-entry bigram/trigram Engram table at layer 2 alongside 256 MoE experts (expert intermediate dimension 512), naively quantizing all tensors degrades tool-calling XML formatting (<tool_call><function=...>) and long-horizon reasoning. Selecting the exact GGUF shard tier lets developers match available VRAM, system RAM, and NVMe SSD bandwidth:
| Quantization Variant | Shards | Total Disk Size | Primary Hardware Target | Key Trade-off |
|---|---|---|---|---|
| BF16 (Reference) | 3 shards | 105.06 GiB | Multi-GPU 128 GB+ VRAM | Lossless baseline weights |
| Q8_0 | 2 shards | 55.87 GiB | 64 GB Mac Unified / Dual 32 GB GPU | Near-lossless perplexity and tool syntax |
| UD-Q4_K_XL | 2 shards | 33.75 GiB | 48 GB VRAM or 48–64 GB Unified RAM | Dynamic mixed-bit protection on gates/attn |
| UD-Q4_K_M | 2 shards | 32.77 GiB | 40–48 GB VRAM / Apple Silicon | Balanced speed and reasoning fidelity |
| UD-IQ4_XS | 2 shards | 29.84 GiB | 32–40 GB VRAM + RAM hybrid | Compact non-linear 4-bit quantization |
| UD-Q3_K_XL | 2 shards | 28.76 GiB | 32 GB GPU or 18 GB RAM + SSD Engram | Runs with SSD n-gram offload |
| UD-Q2_K_XL | 2 shards | 25.78 GiB | 24 GB GPU + CPU offload | Preserves critical layers at higher precision |
| UD-IQ2_XXS | 2 shards | 21.79 GiB | Tight 24 GB single-GPU footprint | Minimum footprint dynamic quant |
| MTP Head (Q8_0) | 1 shard | 1.87 GiB | Optional add-on for all quants | Enables multi-step speculative token draft |
Serving Qwen4-35B-A3B GGUF Locally with llama.cpp and Thinking Control
In production agent harnesses, Qwen4's chat template exposes two key runtime controls: reasoning_effort (xhigh, high, low, off) and preserve_thinking (default true). Unsloth recommends temperature=1.0, top_p=0.95, top_k=20 for thinking mode and temperature=0.7, top_p=0.80, presence_penalty=1.5 for non-thinking mode.
To avoid excessive retries on multi-turn tool calls, keep reasoning_effort="high" for code refactoring loops and run llama serve directly against the Hugging Face repo:
# 1. Install llama.cpp (macOS / Linux) and launch Qwen4-35B-A3B Dynamic 4-bit server
brew install llama.cpp
llama serve -hf unsloth/Qwen4-35B-A3B-GGUF:UD-Q4_K_M --port 8080
# 2. Verify tool-capable chat completion with reasoning_effort=high
curl -s http://127.0.0.1:8080/v1/chat/completions \
-H "Content-Type: application/json" \
-d '{
"model": "unsloth/Qwen4-35B-A3B-GGUF:UD-Q4_K_M",
"messages": [{"role": "user", "content": "Return a TypeScript binary search with strict types."}],
"temperature": 1.0,
"top_p": 0.95,
"top_k": 20
}'Beware Lowering Reasoning Effort on Multi-Turn Agents
Per the Qwen4 model card, setting reasoning_effort to low or off can increase total task latency on agentic loops because shallow single-turn planning causes tool syntax errors and repeated retries.
Frequently Asked Questions
Q:How large is Qwen4-35B-A3B GGUF across different quantization levels?
On Hugging Face, unsloth/Qwen4-35B-A3B-GGUF spans from 105.06 GiB (BF16) and 55.87 GiB (Q8_0) down to 33.75 GiB (UD-Q4_K_XL), 32.77 GiB (UD-Q4_K_M), 28.76 GiB (UD-Q3_K_XL), and 21.79 GiB (UD-IQ2_XXS), plus a 1.87 GiB Q8_0 MTP shard.
Q:Can Qwen4-35B-A3B GGUF run on 18 GB RAM machines?
Yes. Because Qwen4 stores 20B parameters in a layer-2 n-gram Engram table, Unsloth Desktop can offload the Engram table to NVMe SSD, allowing 3-bit Dynamic GGUFs to run on 18 GB RAM systems.
Q:What attention and MoE layout does Qwen4-35B-A3B use?
It uses 40 layers arranged as 10 blocks of three Gated DeltaNet linear-attention MoE layers followed by one Qwen Sparse Attention MoE layer, activating 8 routed plus 1 shared expert out of 256 total experts.
Q:What sampling parameters prevent loops in Qwen4-35B-A3B GGUF?
Use temperature=1.0, top_p=0.95, top_k=20, and presence_penalty=0.0 in thinking mode, or temperature=0.7, top_p=0.80, top_k=20, and presence_penalty=1.5 in non-thinking mode.
Related Alternatives & Comparisons
Related Architecture Guides
View all guidesBest Open Source Coding Agents in 2026: Free, Local & Fully Hackable Harnesses
MCP Server Security Best Practices: Hardening Model Context Protocol Agents in 2026
Open Source Coding Agent Harness: Build a Forkable, Local AI Engineering Runtime
Build with Smoke Monkey Harness
Zero dependencies. 24 built-in tools. Human-in-the-loop safety. 100% open source under the MIT License.