QDNA Send a message

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.

Qwen4-35B-A3B: 35 billion parameters, 3 billion active, on the GPU, a 20-billion n-gram table in system RAM, and four machines, a 24 GB GPU, the RTX 5090, the RTX PRO 6000 and the DGX Spark. Qwen4-35B-A3B: 35 billion parameters, 3 billion active, on the GPU, a 20-billion n-gram table in system RAM, and four machines, a 24 GB GPU, the RTX 5090, the RTX PRO 6000 and the DGX Spark.
Qwen4-35B-A3B keeps its 35 billion parameters on the GPU and its n-gram table in system RAM. QDNA diagram based on the official model card and the vLLM and SGLang recipes.
Short answer. Qwen4-35B-A3B has 35 billion parameters, 3 billion of them active per token, plus a 20-billion n-gram table that is barely read. At 4 bits, a 24 GB GPU is enough if that table stays in system RAM. SGLang measures 248.7 tokens per second on an RTX 5090, and the DGX Spark takes every format.
  • 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.

FeatureQwen4-35B-A3B
LicenseApache 2.0, weights downloadable without a form
Parameters, per the model card35 billion with 3 billion active, plus 20 billion of n-grams and 2 billion for multi-token prediction
Parameters in the files56,823,261,843, per the Hugging Face API
Layers40, ten repeats of three Gated DeltaNet layers followed by one Qwen Sparse Attention layer
Experts256 per layer, 8 routed and 1 shared active per token
Context1,048,576 native tokens
Input and outputText, image and video in, text out
ReasoningFour levels, xhigh, high, low and off, high by default
Official weightsBF16 and FP8, from Qwen
Engines listed by AlibabaTransformers, 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.

Hugging Face model card of Qwen4-35B-A3B: Apache 2.0 license, 35 billion parameters with 3 billion active, plus 20 billion of n-grams and 2 billion for multi-token prediction, 40 layers.
The model card states 35 billion parameters with 3 billion active, and the 40-layer pattern. Screenshot of the official model card on Hugging Face, taken on 4 December 2026 at 7:08 a.m. Paris time.

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.

Hugging Face blog post of 4 December 2026 on Qwen 4: about 35 billion main parameters with about 3.8 billion active, and about 20.5 billion for the n-gram table.
The blog post counts about 3.8 billion active parameters, where the model card states 3. Screenshot of the Hugging Face blog post page, taken on 4 December 2026 at 7:08 a.m. Paris time.

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.

Qwen4-35B-A3B architecture: 35 billion parameters on the GPU, a 20-billion n-gram table in system RAM with 16 rows read per token, 40 layers alternating three Gated DeltaNet layers and one sparse attention layer, and a cache limited to 10 of 40 layers. Qwen4-35B-A3B architecture: 35 billion parameters on the GPU, a 20-billion n-gram table in system RAM with 16 rows read per token, 40 layers alternating three Gated DeltaNet layers and one sparse attention layer, and a cache limited to 10 of 40 layers.
Why the model fits a small GPU: the n-gram table stays in system RAM, and only 10 of 40 layers keep a cache that grows with context. Source: official 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.

Excerpt of the Qwen4-35B-A3B config.json file: 1,048,576-token context, 256 experts with 8 active, 40 layers, 16 attention heads and 2 key-value heads.
The 2 key-value heads and the 40 layers underpin our cache calculation. Screenshot of the official configuration file, taken on 4 December 2026 at 7:08 a.m. Paris time.

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 repositorySizePublished split
BF16, Qwen113.65 GB, or 105.84 GiBvLLM: 72.7 GB on the GPU, 41 GB of table in system RAM
FP8, Qwen60.17 GB, or 56.03 GiBvLLM: 39.7 GB on the GPU, 20.5 GB of table in system RAM
NVFP4, RadixArk46.88 GB, or 43.66 GiBSGLang on an RTX 5090: experts on the GPU, table in FP8 in system RAM, about 25 GiB
GGUF Q8_0, ggml-org59.40 GB, or 55.32 GiBOne file, table included
GGUF Q6_K, ggml-org51.01 GB, or 47.51 GiBOne file, table included
GGUF Q4_K_M, ggml-org36.01 GB, or 33.54 GiBOne file, table included
GGUF UD-IQ4_XS, Unsloth32.04 GB in two files, or 29.84 GiBUnsloth: table on disk or in system RAM, set by its application
MLX 4-bit, mlx-community32.15 GB, or 29.94 GiBFor 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 qwen4 page: the ollama run qwen4 command and seven variants, from 36 GB in NVFP4 to 114 GB in BF16, all with a one-million-token context.
The variants Ollama publishes and their sizes. Screenshot of the Ollama page, taken on 4 December 2026 at 7:08 a.m. Paris time.

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.

Unsloth guide for Qwen4-35B-A3B: UD-IQ4_XS GGUF recommended on a 24 GB Mac or GPU, and a total-memory table from 10 GB at 1 bit to 41 GB at 8 bits.
Total memory adds up the GPU and system RAM. Screenshot of the Unsloth guide page, taken on 4 December 2026 at 7:14 a.m. Paris time.

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.

Machines that can run Qwen4-35B-A3B by memory size: 16 GB at 2 or 3 bits, 24 GB at 4 bits with the table in system RAM, 32 GB on an RTX 5090 in NVFP4, 96 GB on an RTX PRO 6000 with everything on the GPU, 128 GB of unified memory on a DGX Spark or Mac. Machines that can run Qwen4-35B-A3B by memory size: 16 GB at 2 or 3 bits, 24 GB at 4 bits with the table in system RAM, 32 GB on an RTX 5090 in NVFP4, 96 GB on an RTX PRO 6000 with everything on the GPU, 128 GB of unified memory on a DGX Spark or Mac.
Which memory for which format: from the still experimental 16 GB GPU to 128 GB of unified memory that takes the BF16 weights. Sources: Unsloth guide, vLLM and SGLang recipes.
Machine (memory)What the recipes sayPrice used by QDNA
16 GB GPU (RTX 5080, Radeon RX 9070 XT) and 64 GB of system RAMUnsloth 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 cardNot used
24 GB GPU (RTX 4090, Radeon RX 7900 XTX) or 24 GB MacUnsloth recommends starting with the UD-IQ4_XS GGUF, with the table on disk or in system RAMNot 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 fitWorkstation: €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 GPUSold 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 itWorkstation: €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.

vLLM recipe for Qwen4-35B-A3B: GPUs from the H100 to the RTX Pro 6000, a 39.7 GB FP8 model on the GPU and a 20.5 GB n-gram table in host memory.
vLLM splits the model on the GPU from the n-gram table in host memory. Screenshot of the vLLM recipe, taken on 4 December 2026 at 7:08 a.m. Paris time.

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.

GPUTableEnd-to-end throughputMedian decodeFirst tokenPeak on the GPU
RTX PRO 6000 (96 GB)On the GPU204.17 tokens/s400.91 tokens/s2.096 s46.89 GiB
RTX PRO 6000 (96 GB)System RAM199.75 tokens/s381.53 tokens/s2.094 s27.86 GiB
RTX 5090 (32 GB)System RAM248.74 tokens/sNot published1.381 s27.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.

Table from section 2.7 of the SGLang recipe: NVFP4 throughput with 8K input and 1K output tokens on the RTX PRO 6000 and RTX 5090.
The original table, including the accepted length per step that our table leaves out. Screenshot of the SGLang recipe, taken on 4 December 2026 at 7:14 a.m. Paris time.

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.

BenchmarkQwen4-35B-A3BQwen3.8-Flash-NextQwen3.8-27BInkling2 Mini
DeepSWE v1.161.858.742.248.2
Terminal Bench 4.121.224.25.65.6
FrontierCode-AA 2.016.127.114.915.1
AutomationBench-AA57.955.948.241.8
APEX Agents v1.159.061.047.550.9
AA-Briefcase v1.1 (Elo)1,4861,5671,3911,263
Chartography27.824.627.822.1
HealthBench Professional47.434.829.845.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.

Artificial Analysis summary for Qwen4-35B-A3B: Intelligence Index of 25, 238 tokens per second, first token after 13.66 seconds, $0.55 per task.
Measured through Alibaba's API, not on a local machine. Screenshot of the Artificial Analysis page, taken on 4 December 2026 at 7:16 a.m. Paris time.

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.

Qwen4-35B-A3B page on Qwen Cloud: $0.06 per million input tokens, $0.36 output, $0.003 cached, up to 991K input tokens.
Prices as published in dollars, before conversion. Screenshot of the Qwen Cloud page, taken on 4 December 2026 at 7:16 a.m. Paris time.

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

Further reading