Qwen4-35B-A3B locally: memory, hardware and measured speed
Alibaba released Qwen4-35B-A3B on 4 December 2026, the first open-weight Qwen 4 model, under the Apache 2.0 license, and it fits a 24 GB GPU at 4 bits because its n-gram table stays in system RAM: here is how much memory it needs, which hardware suits it and the measured speeds.


- 56.8 Bparameters in the files
- 3 Bactive parameters per token
- 1,048,576tokens of native context
- 248.7tokens per second on an RTX 5090
How was this article put together?
This article was put together from primary sources read on 4 December 2026: the official model card and its config.json file, the Hugging Face blog post, the vLLM and SGLang recipes, the Unsloth guide, the Ollama page, the Qwen Cloud price list and the Artificial Analysis page. File sizes come from the Hugging Face API, queried the same day.
We keep three kinds of figures apart: a measurement comes from a third party that describes its procedure, a calculation is ours and is labelled as such, and a claim comes from Alibaba, while screenshots are dated. This article also replaces our 16 November 2026 article on Qwen 4 27B, a model that still has no official weights or model card.
What is Qwen4-35B-A3B?
Qwen4-35B-A3B is a multimodal mixture of experts from Alibaba's Qwen team, and the first open model of the Qwen 4 generation, and reuses the architecture that Qwen3.8-Flash-Next introduced as a preview in August 2026. The table below follows its model card, as Alibaba publishes it on Hugging Face, completed by the repository's configuration file.
| Feature | Qwen4-35B-A3B |
|---|---|
| License | Apache 2.0, weights downloadable without a form |
| Parameters, per the model card | 35 billion with 3 billion active, plus 20 billion of n-grams and 2 billion for multi-token prediction |
| Parameters in the files | 56,823,261,843, per the Hugging Face API |
| Layers | 40, ten repeats of three Gated DeltaNet layers followed by one Qwen Sparse Attention layer |
| Experts | 256 per layer, 8 routed and 1 shared active per token |
| Context | 1,048,576 native tokens |
| Input and output | Text, image and video in, text out |
| Reasoning | Four levels, xhigh, high, low and off, high by default |
| Official weights | BF16 and FP8, from Qwen |
| Engines listed by Alibaba | Transformers, vLLM, SGLang, TokenSpeed, llama.cpp, Ollama, Unsloth, mlx-vlm, LiteRT-LM |
Sources: Qwen4-35B-A3B model card and its config.json file, read on 4 December 2026.

Two primary sources count the active parameters differently: Alibaba's model card says 3 billion, while the Hugging Face blog post says about 3.8 billion, and 20.5 billion for the n-gram table. Neither explains its count, so we keep the publisher's model card and flag the gap.

Why do 56 billion parameters fit on a 24 GB GPU?
The answer lies in the model's second layer, which holds a table of about 20 billion parameters that maps a vector to sequences of two and three tokens. For each token, the model reads only 16 rows of it, eight for the last two tokens and eight for the last three, according to the Hugging Face blog post.
A table read this rarely does not need the GPU's fast memory: the vLLM recipe keeps it in system RAM by default, while the Unsloth command reads it from disk on demand. The rest of the model, with its 256 experts, its attention layers and its prediction head, has the GPU to itself.
config.json and SGLang recipe.Attention follows a four-layer pattern repeated ten times: the first three are Gated DeltaNet layers, whose memory keeps a fixed size whatever the length of the text. The fourth, Qwen Sparse Attention, picks at most 2,048 tokens across the whole context, in groups of four located by a small indexer.

This design shrinks the context cache sharply, since only ten of the forty layers keep one. The model also ships a multi-token prediction head, which acts as a draft for speculative decoding: it proposes several tokens, which the model checks in a single pass, and the vLLM, SGLang and llama.cpp recipes enable it with three proposed tokens.
How much memory does it need?
At 4 bits, the weights need about 32 to 36 GB of memory, split between the GPU and system RAM, plus 20 KiB of cache per context token in BF16, while the FP8 version needs 60 GB and the BF16 version 114 GB, n-gram table included.
File sizes
Hugging Face gives sizes in decimal gigabytes, while GPU memory is sold in binary units, so we give both, the conversion to gibibytes (GiB) being a calculation. The last column shows where the engines place the n-gram table, according to their own recipes.
| Format and repository | Size | Published split |
|---|---|---|
| BF16, Qwen | 113.65 GB, or 105.84 GiB | vLLM: 72.7 GB on the GPU, 41 GB of table in system RAM |
| FP8, Qwen | 60.17 GB, or 56.03 GiB | vLLM: 39.7 GB on the GPU, 20.5 GB of table in system RAM |
| NVFP4, RadixArk | 46.88 GB, or 43.66 GiB | SGLang on an RTX 5090: experts on the GPU, table in FP8 in system RAM, about 25 GiB |
| GGUF Q8_0, ggml-org | 59.40 GB, or 55.32 GiB | One file, table included |
| GGUF Q6_K, ggml-org | 51.01 GB, or 47.51 GiB | One file, table included |
| GGUF Q4_K_M, ggml-org | 36.01 GB, or 33.54 GiB | One file, table included |
| GGUF UD-IQ4_XS, Unsloth | 32.04 GB in two files, or 29.84 GiB | Unsloth: table on disk or in system RAM, set by its application |
| MLX 4-bit, mlx-community | 32.15 GB, or 29.94 GiB | For Mac, no published detail |
Sizes read on 4 December 2026 from the Hugging Face API, by adding up each repository's weight files. The FP8 repository stores 53.50 billion parameters in FP8 and 3.33 billion in BF16, according to the same API. Splits: vLLM recipe, SGLang recipe, Unsloth guide.
These sizes match SGLang's, which gives about 106 GiB in BF16, 56 GiB in FP8 and 44 GiB in NVFP4, table included. The ggml-org GGUF files come with a 0.90 GB vision projector and a 1.29 to 3.76 GB prediction draft, to be loaded on top for images or speculative decoding.

Ollama offers the model as qwen4, with a default variant of 36 to 37 GB, a 114 GB BF16 variant and a 36 GB NVFP4 variant in MLX format. Unsloth, for its part, publishes a table of total memory, GPU and system RAM combined, from 10 GB at 1 bit to 41 GB at 8 bits.

The context cache
Our calculation starts from the configuration file, where ten layers keep a cache: 10 × 2 key-value heads × 256 dimensions × 2 for key and value × 2 bytes gives 20 KiB per token in BF16, which is 0.625 GiB at 32,768 tokens, 5 GiB at 262,144 and 20 GiB at one million tokens.
The indexer adds 640 bytes per token in BF16, or 0.625 GiB at one million, and the thirty Gated DeltaNet layers keep a fixed state of 30 × 32 heads × 128 × 128 × 4 bytes, or 60 MiB per conversation in FP32. For comparison, Qwen3.8-27B needed 64 KiB per token, 3.2 times more, according to our 16 November calculation.
The vLLM recipe adds another lever: the model was trained for a cache in NVFP4 format, about 3.6 times smaller than BF16 according to vLLM, so one million tokens fit in about 5.6 GiB, by our calculation. This format requires an NVIDIA Blackwell GPU, and the indexer cache stays in FP8.
Which machine should you choose for Qwen4-35B-A3B?
The recipes published on 4 December 2026 draw a clear ladder, from the 16 GB gaming card to the 128 GB desktop box. The diagram below sums it up, then the table gives, for each machine, the recommended format, the source and the price our calculator uses, with a "size only" note flagging a machine with no published recipe.
| Machine (memory) | What the recipes say | Price used by QDNA |
|---|---|---|
| 16 GB GPU (RTX 5080, Radeon RX 9070 XT) and 64 GB of system RAM | Unsloth recommends 2 or 3 bits. SGLang offers an experimental paged-experts recipe, with 30 of 256 experts kept on the GPU, not yet validated on a real 16 GB card | Not used |
| 24 GB GPU (RTX 4090, Radeon RX 7900 XTX) or 24 GB Mac | Unsloth recommends starting with the UD-IQ4_XS GGUF, with the table on disk or in system RAM | Not used |
| RTX 5090 (32 GB) | SGLang serves NVFP4, experts on the GPU, table in system RAM (about 25 GiB), peak of 27.7 GiB on the GPU; BF16 and FP8 do not fit | Workstation: €11,400 to €14,100 excl. VAT, €12,700 excl. VAT used |
| H100 (80 GB) | vLLM serves FP8 on it, 39.7 GB on the GPU | Sold in four- or eight-GPU servers |
| RTX PRO 6000 Blackwell (96 GB) | Everything fits on the GPU in NVFP4 with the table in FP8 (46.9 GiB peak per SGLang); vLLM also serves FP8 on it | Workstation: €19,000 to €23,000 excl. VAT, €23,000 excl. VAT used |
| DGX Spark or GB10 box (128 GB unified) | SGLang serves NVFP4 and FP8 with the table in unified memory, and BF16 with the table read from the NVMe drive | €6,600 excl. VAT with 1 TB, €8,400 excl. VAT with 4 TB |
| Mac Studio M5 Max (128 GB) | oMLX runs the model with its own Metal kernels, supports images and multi-token prediction, and can leave the table on disk | €5,158 excl. VAT (Apple Store France, 28 November 2026) |
| Strix Halo (128 GB) | Size only: the 33.54 GiB Q4_K_M GGUF fits in the 96 GiB the integrated GPU can address | €4,350 excl. VAT |
Recipes: SGLang, vLLM, Unsloth and the Hugging Face blog post for oMLX, read on 4 December 2026. Prices: shared assumptions of the QDNA calculator, excluding VAT.

On a unified-memory machine, the question changes, because a DGX Spark puts weights, table and cache in the same 128 GB space: the SGLang FP8 recipe leaves about 29 GiB free there. On a GPU workstation, the computer's system RAM matters as much as the GPU, since it holds the table: plan for at least 64 GB.
What speeds have been measured?
SGLang publishes the only detailed measurement so far, in which each request reads 8,192 tokens and generates 1,024, one at a time, after a warm-up, over ten synthetic prompts, in NVFP4 with multi-token prediction proposing three tokens, and the table below gives its figures as published.
| GPU | Table | End-to-end throughput | Median decode | First token | Peak on the GPU |
|---|---|---|---|---|---|
| RTX PRO 6000 (96 GB) | On the GPU | 204.17 tokens/s | 400.91 tokens/s | 2.096 s | 46.89 GiB |
| RTX PRO 6000 (96 GB) | System RAM | 199.75 tokens/s | 381.53 tokens/s | 2.094 s | 27.86 GiB |
| RTX 5090 (32 GB) | System RAM | 248.74 tokens/s | Not published | 1.381 s | 27.72 GiB |
Measurements by SGLang, section 2.7 of its recipe, read on 4 December 2026. End-to-end throughput divides the 10,240 generated tokens by the total time, prefill included.

Keeping the table in system RAM costs almost nothing: on the same RTX PRO 6000, decoding drops from 400.91 to 381.53 tokens per second, 4.8% less by our calculation, for 19 GiB freed on the GPU, although SGLang warns that its synthetic prompts produce repetitive text, which can flatter speculative decoding.
With RadixArk's DFlash2 draft, SGLang measures on an RTX PRO 6000 with ShareGPT conversations 320.3 tokens per second for one user, 1,167.8 for eight and 1,757.2 for thirty-two. These aggregate figures show what a single card serves to a team, with a different procedure from the table above.
Unsloth claims that its on-GPU expert cache reaches 131 to 138 tokens per second on 24 GB against 69 to 72 without it, 127 against 70 on 16 GB and 95 against 53 on 8 GB, but it publishes neither the card, nor the quantization, nor the input length: these figures give an order of magnitude, not a comparable measurement.
On Mac, the Hugging Face blog post reports a 22% gain in generation speed with three proposed tokens, using a 4-bit GGUF on an Apple M5 chip, without giving the baseline speed. Through Alibaba's API, Artificial Analysis measures 238 tokens per second and a first answer token after 13.66 seconds, reasoning included.
How do you run it?
The shortest path is Ollama: ollama run qwen4 downloads the default variant of 36 to 37 GB. Ollama can also plug the model into coding agents, for example ollama launch claude --model qwen4 for Claude Code or ollama launch opencode --model qwen4 for OpenCode.
With llama.cpp, you need a build made after Qwen 4 support landed in pull request 33626, and Unsloth gives the following command, which keeps the n-gram table on the CPU and reads it from disk on demand:
./llama.cpp/llama-server \
-hf unsloth/Qwen4-35B-A3B-GGUF:UD-Q4_K_XL \
--load-mode mmap --lazy-mode on -ot per_layer_token_embd=CPU \
--temp 1.0 --top-p 0.95 --top-k 20 --min-p 0.0
For a shared service, vLLM provides a dedicated image, vllm/vllm-openai:qwen4, which serves FP8 with an NVFP4 cache and multi-token prediction. SGLang generates its command for the GPU you pick on its page, from the RTX 5090 to the B300, and both engines expose an OpenAI-compatible API, with the qwen4 tool-call and reasoning parsers.
Alibaba recommends a temperature of 1.0, a top_p of 0.95 and a top_k of 20 in reasoning mode, then 0.7, 0.80 and 20 with a presence penalty of 1.5 without reasoning. Watch the name of the level that turns reasoning off: off in the model, but none in the vLLM API.
How does it compare with other models?
Alibaba compares Qwen4-35B-A3B with Qwen3.8-Flash-Next, Qwen3.8-27B and Inkling2 Mini on eight benchmarks. Some scores come from Artificial Analysis and Mercor, according to the model card notes, the rest from Alibaba, and we take them from the image in the Hugging Face blog post, without having measured them.
| Benchmark | Qwen4-35B-A3B | Qwen3.8-Flash-Next | Qwen3.8-27B | Inkling2 Mini |
|---|---|---|---|---|
| DeepSWE v1.1 | 61.8 | 58.7 | 42.2 | 48.2 |
| Terminal Bench 4.1 | 21.2 | 24.2 | 5.6 | 5.6 |
| FrontierCode-AA 2.0 | 16.1 | 27.1 | 14.9 | 15.1 |
| AutomationBench-AA | 57.9 | 55.9 | 48.2 | 41.8 |
| APEX Agents v1.1 | 59.0 | 61.0 | 47.5 | 50.9 |
| AA-Briefcase v1.1 (Elo) | 1,486 | 1,567 | 1,391 | 1,263 |
| Chartography | 27.8 | 24.6 | 27.8 | 22.1 |
| HealthBench Professional | 47.4 | 34.8 | 29.8 | 45.7 |
Scores published by the Qwen team and reproduced in the Hugging Face blog post of 4 December 2026. Qwen3.8-Flash-Next has 180 billion parameters, about three times the 56.8 billion in the new model's files.
The new model matches or beats its bigger sibling Qwen3.8-Flash-Next on five benchmarks, and trails it in coding on FrontierCode-AA. Against Qwen3.8-27B, which it naturally replaces for local use, it gains clearly in agents and coding, with 61.8 against 42.2 on DeepSWE and 21.2 against 5.6 on Terminal Bench.

The only independent evaluation comes from Artificial Analysis: 25 on its Intelligence Index 5.0.2, at maximum reasoning, above the median of 9 for open models of 40 to 150 billion parameters. The same page notes a verbose model, with 175 million tokens generated for the index against a median of 95.9 million.
API or local machine: what does a million tokens cost?
Qwen Cloud charges $0.06 per million input tokens, $0.36 per million output tokens and $0.003 for cached input, which at the European Central Bank rate of 3 December 2026, €1 for $1.0827, comes to €0.055 and €0.333 per million, by our calculation.

Take the workload measured by SGLang, 8,192 tokens read and 1,024 generated per request, which costs about 0.08 euro cents through the API, without caching. An RTX 5090 workstation completes one request every 4.1 seconds at 248.74 tokens per second, or about 629,600 requests a month if it runs non-stop.
That volume would cost about €500 a month through the API, against €353 for the €12,700 excl. VAT workstation amortized over three years. The workstation only becomes cheaper above about 71% utilization, before electricity, upkeep and API caching, according to calculations you should redo with your own prompts.
The case for local hardware therefore rests less on price than on control: data never leaves the machine, the model does not change without your consent, and the Apache 2.0 license allows commercial use and modification. Our cost comparator redoes this calculation with your volumes.
What about Qwen 4 27B and Qwen4-Max?
As of 4 December 2026, Alibaba has not released any 27-billion-parameter Qwen 4, and the new model's card only says that the open Qwen 4 series "is on the way". The "Qwen4-27B" repositories visible on Hugging Face, such as InterpreticAI's, do not come from the Qwen team and are not official models.
Qwen4-Max, the series flagship, came out on 16 November 2026 through the API only, with no public weights. Alibaba describes it as a mixture of experts with 2.4 trillion parameters, 71 billion of them active, priced at $1.413 to $1.5 per million input tokens and $4.24 to $4.5 per million output tokens depending on the region.
Qwen4-35B-A3B reuses its architecture and training techniques, according to its model card, but at a size a desktop workstation can host. It is therefore this model, and not a hypothetical 27B, that replaces Qwen3.8-27B for local use today, until the other open sizes in the series appear.
Points to watch
Five points need watching before you build a service on Qwen4-35B-A3B, all drawn from the sources cited above and read on 4 December 2026: they can change quickly, as inference engines add support week after week.
- The SGLang recipe for 16 GB GPUs remains experimental and has not been validated on a real card of that size.
- Official mlx-lm support has been announced but is not yet merged into its repository.
- The reference tokenizer requires
trust_remote_code=True; the Jinja chat template, provided for compatibility, can produce different token IDs. - SGLang's speeds cover synthetic prompts and a single user, to be confirmed on your real workloads.
- Alibaba announces more open models in the Qwen 4 series, with no date or size.
Frequently asked questions
Which GPU do you need for Qwen4-35B-A3B?
A 24 GB GPU, such as the RTX 4090 or the Radeon RX 7900 XTX, is enough at 4 bits according to Unsloth, if the n-gram table stays in system RAM or on disk. The 32 GB RTX 5090 serves the NVFP4 format under SGLang, at 248.7 tokens per second measured end to end.
Does Qwen4-35B-A3B run on a DGX Spark?
Yes. The SGLang recipe covers the DGX Spark and its 128 GB of unified memory in NVFP4 and FP8, with the n-gram table in unified memory, and in BF16 by reading the table from the NVMe drive. No speed has been published on this machine yet.
How large is Qwen4-35B-A3B?
113.65 GB in BF16, 60.17 GB in FP8, 46.88 GB in NVFP4 and 36.01 GB in GGUF Q4_K_M, n-gram table included. Ollama's default variant weighs 36 to 37 GB. The context cache adds 20 KiB per token in BF16.
Does Qwen 4 27B exist?
No. As of 4 December 2026, Alibaba has not released any 27-billion-parameter Qwen 4. The first open model of the series is Qwen4-35B-A3B. Repositories named Qwen4-27B on Hugging Face do not come from the Qwen team.
What is the license of Qwen4-35B-A3B?
Apache 2.0, as stated by the model card and Artificial Analysis. This license allows commercial use, modification and redistribution, provided the license and copyright notices are kept. The weights download without a form.
How do you install Qwen4-35B-A3B with Ollama?
The command ollama run qwen4 downloads and starts the default variant, 36 to 37 GB, with text and image input. To use it in Claude Code, Ollama provides ollama launch claude --model qwen4.
Is the API or a local machine better?
On price alone, the Qwen Cloud API, at $0.36 per million output tokens, stays cheaper as long as an RTX 5090 workstation runs less than about 71% of the time, by our calculation. Local hardware is mainly justified by confidentiality and control over the model.
Official sources
- Qwen4-35B-A3B model card and FP8 repository, Alibaba's Qwen team, December 2026.
- Welcome Qwen 4: Cutting-edge intelligence on-device, Hugging Face blog post of 4 December 2026.
- vLLM recipe for Qwen4-35B-A3B, updated on 4 December 2026.
- SGLang recipe for Qwen4-35B-A3B, with its measurements on the RTX 5090 and RTX PRO 6000.
- Unsloth guide to running Qwen4-35B-A3B locally and its GGUF files.
- ggml-org GGUF and RadixArk NVFP4.
- Ollama qwen4 page.
- Qwen4-35B-A3B page and prices on Qwen Cloud.
- Artificial Analysis evaluation of Qwen4-35B-A3B, read on 4 December 2026.
- European Central Bank reference exchange rates.
Further reading
- LLM memory calculator: size Qwen4-35B-A3B machine by machine
- Qwen3.8 Flash Next measured on an RTX PRO 6000 and a MacBook Pro M5 Max
- DGX Spark, DGX Station GB300, RTX PRO 6000 or Mac Studio: the comparison
- Prefill, decode and KV cache: choosing hardware for an LLM
- LLM inference engines compared in 2026
- How much does an AI server cost?