{"slug": "qwen-4-35b-a3b-12gbvram-files", "title": "Qwen-4-35B-A3B-12gbvram-files", "summary": "A developer published a llama.cpp configuration that runs the Qwen4-35B-A3B mixture-of-experts model (UD-IQ4_XS GGUF) on a 12GB RTX 4070 at 63 tokens per second, using 10.8GB of VRAM and about 24GB of system RAM. The setup offloads 27 MoE layers to the CPU, uses q8_0 KV cache quantization, a 65,536-token context, and MTP speculative decoding, and is wrapped in a llama-swap config for on-demand model loading.", "body_md": "|  | # Qwen 4 35B-A3B (IQ4_XS) — 63 t/s on RTX 4070 (12GB) | \n|  | - **Model:** [unsloth/Qwen4-35B-A3B-GGUF](https://huggingface.co/unsloth/Qwen4-35B-A3B-GGUF) (`Qwen4-35B-A3B-UD-IQ4_XS-00001-of-00002.gguf`) | \n|  | - **GPU:** RTX 4070 12GB (`10.8 GB` total VRAM used incl. Windows) | \n|  | - **RAM:** 32GB DDR5 (`24 GB` total RAM used; Windows 11 + browser = `10 GB`) | \n|  | - **Speed:** `63 t/s` generation speed on `llama.cpp` (1-shot in normal chat, no harness) | \n|  | ## Prompt | \n|  | ``` text | \n|  | Create a single-file HTML Three.js (three.min.js CDN) semi-realistic 3D room diorama (100vw x 100vh, overflow: hidden, full native resolution). Build procedural 3D models (MeshStandardMaterial with subtle procedural CanvasTexture surfaces) for a dimly lit room with a desk, PC tower, and monitor whose glowing CanvasTexture screen clearly reads \"Qwen 4 35b moe\". Through a large window, show drifting clouds, distant trees, and warm yellowish street lights that turn on at night. Use ACESFilmicToneMapping, PCFSoftShadowMap, FogExp2, and subtle mouse-parallax camera sway. Keep the interior dark, lit mainly by the monitor's cool PointLight glow and changing daylight/moonlight through the window. Add a compact translucent HUD with Time of Day and Auto-Speed sliders, plus weather buttons (Clear, Rain, Thunderstorm with lightning flashes, Snow). | \n|  | ``` | \n|  | ## `llama.cpp` Launch Command | \n|  | ``` bash | \n|  | llama-server -m \"Qwen4-35B-A3B-UD-IQ4_XS-00001-of-00002.gguf\" --no-mmproj -ngl 99 -fit off -np 1 -c 65536 -fa on --cache-type-k q8_0 --cache-type-v q8_0 --cache-ram 0 -t 8 -tb 12 -b 2048 -ub 512 -lm dio -ot \"per_layer_token_embd=CPU\" --n-cpu-moe 27 --spec-type draft-mtp --spec-draft-n-max 2 --jinja --temp 1.0 --top-p 0.95 --top-k 20 --min-p 0.0 --presence-penalty 0.0 --repeat-penalty 1.0 | \n|  | ``` | \n|  | ## `llama-swap` Config (`config.yaml`) | \n|  | ``` yaml | \n|  | healthCheckTimeout: 120 | \n|  | macros: | \n|  | \"llama-base\": > | \n|  | llama-cpp\\llama-server.exe | \n|  | --host 127.0.0.1 | \n|  | --port ${PORT} | \n|  | -ngl 99 | \n|  | -fa on | \n|  | --cache-type-k q8_0 | \n|  | --cache-type-v q8_0 | \n|  | --jinja | \n|  | models: | \n|  | \"qwen4-35b\": | \n|  | ttl: 600 | \n|  | cmd: > | \n|  | ${llama-base} | \n|  | -m \"C:\\YourFolder\\Qwen4-35B-A3B-UD-IQ4_XS-00001-of-00002.gguf\" | \n|  | --no-mmproj | \n|  | -fit off | \n|  | -np 1 | \n|  | --cache-ram 0 | \n|  | -c 65536 | \n|  | -t 8 | \n|  | -tb 12 | \n|  | -b 2048 | \n|  | -ub 512 | \n|  | -lm dio | \n|  | -ot \"per_layer_token_embd=CPU\" | \n|  | --n-cpu-moe 27 | \n|  | --spec-type draft-mtp | \n|  | --spec-draft-n-max 2 | \n|  | --temp 1.0 | \n|  | --top-p 0.95 | \n|  | --top-k 20 | \n|  | --min-p 0.0 | \n|  | --presence-penalty 0.0 | \n|  | --repeat-penalty 1.0 | \n|  | ``` |", "url": "https://wpnews.pro/news/qwen-4-35b-a3b-12gbvram-files", "canonical_source": "https://gist.github.com/anshulsingh8326/3151a35c4494bc1abd1d4e101dda6db3", "published_at": "2026-12-04 14:33:18+00:00", "updated_at": "2026-12-04 19:16:45.600390+00:00", "lang": "en", "topics": ["large-language-models", "ai-infrastructure", "ai-tools", "mlops"], "entities": ["Qwen4-35B-A3B", "llama.cpp", "llama-swap", "RTX 4070", "Unsloth", "Hugging Face"], "also_reported_by": [], "takeaway": "Offloading 27 MoE layers to CPU with --n-cpu-moe while keeping -ngl 99 and q8_0 KV cache lets a 35B-A3B IQ4_XS model hit 63 t/s on a 12GB RTX 4070.", "recommendation": {"advice": "On a 12GB GPU running a large MoE GGUF, offload MoE layers to CPU with --n-cpu-moe and quantize the KV cache to q8_0 to fit a 65k context while keeping generation fast.", "playbook": "inference-serving", "playbook_url": "https://wpnews.pro/playbooks/inference-serving"}, "alternates": {"html": "https://wpnews.pro/news/qwen-4-35b-a3b-12gbvram-files", "markdown": "https://wpnews.pro/news/qwen-4-35b-a3b-12gbvram-files.md", "text": "https://wpnews.pro/news/qwen-4-35b-a3b-12gbvram-files.txt", "jsonld": "https://wpnews.pro/news/qwen-4-35b-a3b-12gbvram-files.jsonld"}}