Alibaba has released Qwen4-35B-A3B, the first open model in its Qwen4 family: a mixture-of-experts model with 35 billion parameters, about 3 billion active per token, a one-million-token context window, text, image and video input, and an Apache 2.0 licence. Our sister site noticias.ai covers what the model is (in Spanish). This guide is for whoever has to run it: how much memory it really needs, which engine to pick and how to leave it running as an internal OpenAI-compatible API.

First: it is bigger than its name

The “35B” is misleading. On top of those parameters the model carries an n-gram embedding table of about 20.5 billion parameters and a 2-billion-parameter MTP module. That is roughly 57 billion in total, and all of it has to be loaded even though only a few billion do work per token. It generates fast, but you need the memory.

VersionSizeWhere it fits
BF16 (official)114 GBOne 141 GB GPU (H200) or several GPUs
FP8 (official)~60 GBAn 80 GB GPU with vLLM or SGLang
GGUF Q8_049 GBllama.cpp with lots of unified memory or two GPUs
GGUF Q4_K_M / Ollama33-37 GBA 48 GB GPU, a 48-64 GB Mac or GPU plus RAM

Add the KV cache on top. The hybrid architecture (three linear-attention layers for every sparse-attention layer) shrinks it a lot, but contexts of hundreds of thousands of tokens still need headroom. For an internal service, capping the context at what you actually use is the easiest way to save memory.

Option 1: vLLM in Docker

For a server with NVIDIA GPUs and several users, vLLM is the most direct option. There is a dedicated image tagged qwen4. This is the recipe Hugging Face published for a single H200, with multi-token prediction (MTP), tool calling and reasoning enabled:

docker run --gpus all --shm-size 16g -p 127.0.0.1:8000:8000 
  -v ~/.cache/huggingface:/root/.cache/huggingface 
  -e HF_TOKEN 
  vllm/vllm-openai:qwen4 
  --model Qwen/Qwen4-35B-A3B 
  --trust-remote-code 
  --max-model-len auto 
  --kv-cache-dtype nvfp4 
  --attention-config.indexer_kv_dtype fp8 
  --enable-auto-tool-choice 
  --tool-call-parser qwen4 
  --reasoning-parser qwen4 
  --speculative-config '{"method": "mtp", "num_speculative_tokens": 2, "index_share_for_mtp_iteration": true}'Code language: JavaScript (javascript)

We changed one thing from the original recipe: the port is published on 127.0.0.1 only, so it is not left open to the network without authentication. According to Hugging Face, this setup generates about 330 tokens per second for a single request and sustains about 2,660 tokens per second across 64 concurrent requests. On a GPU with less memory, use Qwen/Qwen4-35B-A3B-FP8 and set --max-model-len to a fixed value instead of auto.

Option 2: SGLang

SGLang also has its own image (lmsysorg/sglang:qwen4) and an official recipe. In Hugging Face’s tests it was slightly slower than vLLM on the same machine (about 260 tokens per second per request and 2,180 across 64), but if your platform already runs it there is no need to switch. It serves the API on port 30000.

Option 3: llama.cpp as a service

For a server without a big GPU, a box with a consumer GPU and lots of RAM, or a Mac, llama.cpp already supports the model, with GGUF builds published by ggml-org and the MTP module to speed up generation. With three draft tokens Hugging Face measured 22% faster generation on an M5 Mac:

llama serve -hf ggml-org/Qwen4-35B-A3B-GGUF:Q4_K_M --spec-type draft-mtp --spec-draft-n-max 3

To run it as a service on Linux, a systemd unit with an unprivileged user, listening on localhost only:

# /etc/systemd/system/qwen4.service
[Unit]
Description=Qwen4-35B-A3B (llama.cpp)
After=network-online.target

[Service]
User=llm
Environment=HF_HOME=/srv/llm/hf
ExecStart=/usr/local/bin/llama serve -hf ggml-org/Qwen4-35B-A3B-GGUF:Q4_K_M 
  --host 127.0.0.1 --port 8080 --spec-type draft-mtp --spec-draft-n-max 3
Restart=on-failure
NoNewPrivileges=true
ProtectSystem=strict
ReadWritePaths=/srv/llm

[Install]
WantedBy=multi-user.targetCode language: PHP (php)

Adjust the binary path to your install. The first start downloads about 33 GB of model plus the MTP and vision modules, so pre-fetch it and check disk space first.

Option 4: Ollama

If you already run Ollama, for instance behind Open WebUI, the model is in its library as qwen4:35b-a3b (about 36-37 GB), with BF16 and NVFP4 variants:

ollama pull qwen4:35b-a3bCode language: CSS (css)

Before going to production

  • trust_remote_code: vLLM, SGLang and the official tokenizer need it, which means running Python code shipped with the model. Always pull from the official Qwen repository, pin the revision with --revision and review changes before updating.
  • Authentication: none of these servers should be exposed as is. Put them behind a reverse proxy with TLS and an API key, or use vLLM’s --api-key option.
  • Reasoning level: it reasons at high by default. Change it per request with reasoning_effort (xhigh, high, low or off) inside chat_template_kwargs. Qwen warns that lowering it for agents can end up costing more time through retries.
  • Chat template: the Jinja template ships for compatibility only and can produce token IDs that differ from the official tokenizer. If third-party tools give odd answers, start there.
  • Versions: Qwen4 support is days old in every engine. Use the qwen4-tagged images or recent releases and record which one you run.

Any OpenAI API client works for a quick test:

curl http://127.0.0.1:8000/v1/chat/completions -H "Content-Type: application/json" -d '{
  "model": "Qwen/Qwen4-35B-A3B",
  "messages": [{"role": "user", "content": "Summarise in three lines what systemd-journald does"}],
  "chat_template_kwargs": {"reasoning_effort": "low"}
}'Code language: JavaScript (javascript)

If you have already run Qwen3.8-Flash-Next on vLLM, this is the same architecture family and the procedure will feel familiar.

FAQ

What GPU do I need for Qwen4-35B-A3B?

The original version needs about 114 GB for the weights alone, for example a 141 GB H200. The FP8 version fits an 80 GB GPU and the 4-bit GGUF fits a 48 GB GPU, or can be split between GPU and RAM with llama.cpp.

Can I use it commercially?

Yes. The licence is Apache 2.0.

Which engine should I choose?

vLLM to serve many users on NVIDIA GPUs; llama.cpp or Ollama for a modest server, a consumer-GPU box or a Mac.

Sources: noticias.ai; Qwen4-35B-A3B model card; Hugging Face blog on Qwen4; ggml-org GGUF builds; Ollama.

Scroll to Top