Alibaba’s Qwen team released Qwen4-35B-A3B on 4 December 2026. It is the first open-weight model in the Qwen4 family. Until now you could only use Qwen4 through the hosted Qwen4-Max flagship. The weights are on Hugging Face under the Apache 2.0 license, and the same model is live on Qwen Cloud as qwen4-35b-a3b.

This guide covers what the model is, how to call it through Qwen Cloud’s OpenAI-compatible API, how to serve it yourself with vLLM, SGLang or llama.cpp, and how to use its new reasoning_effort control. All details come from the official model card, the Qwen Cloud model page and the Hugging Face launch post.

What Qwen4-35B-A3B is

It is a Mixture-of-Experts (MoE) model with vision. MoE means most of the weights sit idle for any one token, so it runs much more cheaply than its total size suggests. The model card lists:

  • Parameters: 35B total with 3B activated per token, plus 20B of n-gram embeddings and 2B for multi-token prediction (MTP).
  • Experts: 256 experts, with 8 routed plus 1 shared expert active per token.
  • Attention: a hybrid of Gated DeltaNet (linear attention) and Qwen Sparse Attention, laid out as 10 blocks of three DeltaNet layers followed by one sparse attention layer.
  • Context: 1,048,576 tokens natively.
  • Inputs: text, images and video. Output is text.

The hybrid attention design matters for long prompts. Linear attention layers don’t keep a growing key-value cache the way standard attention does, so memory use for a 500-page document stays much lower. Qwen says the model beats its own dense Qwen3.8-27B and comes close to Qwen3.8-Flash-Next at roughly a third of the size. Those are vendor claims, so test it on your own tasks before you switch.

Option 1: Call it on Qwen Cloud

The quickest way to try it is the hosted API. Qwen Cloud exposes an OpenAI-compatible Chat Completions endpoint, so the official openai Python package works without changes.

pip install -U openai
export DASHSCOPE_API_KEY="your-qwen-cloud-key"
import os
from openai import OpenAI

client = OpenAI(
    api_key=os.environ["DASHSCOPE_API_KEY"],
    # Singapore region; see Qwen Cloud docs for other regions
    base_url="https://ap-southeast-1.maas.qwencloudapi.com/compatible-mode/v1",
)

resp = client.chat.completions.create(
    model="qwen4-35b-a3b",
    messages=[
        {"role": "system", "content": "You are a concise senior Python reviewer."},
        {"role": "user", "content": "Review: def avg(xs): return sum(xs)/len(xs)"},
    ],
)
print(resp.choices[0].message.content)

The environment variable name is only an example. Use whatever key name your Qwen Cloud console gives you, and check the regions guide if you’re outside Singapore.

Limits and pricing

Qwen Cloud’s model page lists a 1,000,000-token context window. Max output is 128K tokens without thinking and 256K with thinking. The two maxima can’t both be used in the same request. International pricing on the page is $0.06 per million input tokens and $0.36 per million output tokens, cache hits are cheaper, and batch calls cost half. Prices change, so check the page before you budget.

Option 2: Self-host the open weights

Because the weights are Apache 2.0, you can run them on your own hardware. The Hugging Face post published tested recipes. Both of these serve the BF16 checkpoint on one NVIDIA H200 (141 GB), with MTP speculative decoding, tool calling and reasoning parsing turned on.

vLLM

docker run --gpus all --shm-size 16g -p 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}'

SGLang

docker run --gpus all --shm-size 16g -p 30000:30000 \
  -v ~/.cache/huggingface:/root/.cache/huggingface \
  -e HF_TOKEN \
  lmsysorg/sglang:qwen4 \
  python3 -m sglang.launch_server \
  --model-path Qwen/Qwen4-35B-A3B \
  --host 0.0.0.0 --port 30000 \
  --trust-remote-code \
  --tool-call-parser qwen4 \
  --reasoning-parser qwen4

The full SGLang recipe in the launch post adds more flags for the sparse-attention indexer and speculative decoding, so copy it from the official post when you need top speed. Both servers expose an OpenAI-compatible API, so the Python client above works if you set base_url to http://localhost:8000/v1 (vLLM) or http://localhost:30000/v1 (SGLang) and use Qwen/Qwen4-35B-A3B as the model name.

Laptop or desktop: llama.cpp

You don’t need a data-centre GPU to experiment. The ggml team published GGUF builds in Q4_K_M, Q6_K and Q8_0:

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

The --spec-type draft-mtp flag turns on the model’s built-in multi-token prediction drafter. The Hugging Face team reported faster generation with 3 draft tokens on Apple Silicon. Your speed-up will depend on your hardware and quant. Ollama, Unsloth and MLX builds are linked from the model card too.

Controlling how much the model thinks

Qwen4 replaces the old on/off thinking switch with reasoning effort levels:

  • xhigh for hard tasks where quality matters most
  • high for normal tasks (the default)
  • low for fast answers with little thinking
  • off to disable thinking

enable_thinking=False still works and means the same as off. On a self-hosted server, pass the level through chat_template_kwargs:

from openai import OpenAI

client = OpenAI(base_url="http://localhost:8000/v1", api_key="EMPTY")

stream = client.chat.completions.create(
    model="Qwen/Qwen4-35B-A3B",
    messages=[{"role": "user", "content": "Write a SQL query for the top 5 customers by revenue."}],
    extra_body={"chat_template_kwargs": {"reasoning_effort": "low"}},
    stream=True,
)

for chunk in stream:
    if not chunk.choices:
        continue
    delta = chunk.choices[0].delta
    text = getattr(delta, "content", None)
    if text:
        print(text, end="", flush=True)

The model card warns about one trap. In multi-turn agent tasks, lower effort can mean faster turns but more mistakes and retries. That can make the whole task slower and more expensive. Measure end-to-end task time, not per-turn latency.

Recommended sampling settings

The model card suggests these values:

  • Thinking mode: temperature=1.0, top_p=0.95, top_k=20, presence_penalty=0.0
  • Non-thinking mode: temperature=0.7, top_p=0.80, top_k=20, presence_penalty=1.5

If the model starts repeating itself, raise presence_penalty (0 to 2). Very high values can cause language mixing.

Images and video

Because the model is natively multimodal, you send images with the standard image_url content part:

messages = [{
    "role": "user",
    "content": [
        {"type": "image_url", "image_url": {"url": "https://example.com/invoice.png"}},
        {"type": "text", "text": "Extract the invoice number and total as JSON."},
    ],
}]

Video uses a video_url part in the same way. For hour-long videos, the model card recommends raising longest_edge in video_preprocessor_config.json so the model samples more frames.

When should you use it?

  • Long documents and codebases: the 1M context and cheap linear attention suit RAG-free “read the whole thing” workflows.
  • Cost-sensitive agents: with only 3B active parameters per token, it’s cheap to host and very cheap on the API.
  • Private or on-prem deployments: Apache 2.0 weights mean no licence negotiation for commercial use.

Stick with a larger model if your evals show it struggling on deep reasoning. A small active parameter count is a trade-off, whatever the benchmarks say.

Key takeaways

  • Qwen4-35B-A3B is the first open-weight Qwen4 model: 35B total, 3B active, 1M context, Apache 2.0.
  • Use qwen4-35b-a3b on Qwen Cloud through any OpenAI-compatible client, or self-host with vLLM, SGLang or llama.cpp.
  • Tune reasoning_effort for each task, and measure total task cost rather than per-turn speed.
  • Check the model card for the full serving recipes before you run it in production.