Xylolabs

Qwen4-35B-A3B-GGUF

Quantized llama.cpp weights from Qwen/Qwen4-35B-A3B (849378c8db0d4537b7c6731738147378729d8920), with multimodal vision projectors (mmproj), MTP sidecar weights, VRAM+RAM scenario presets, and swappable --ple engram tables.

Files

Quant Parts Size Notes
Q8_0 2 59.08 GB
Q6_K 2 51.75 GB
Q5_K_M 1 42.06 GB
Q4_K_M 1 35.10 GB
IQ4_NL 1 32.96 GB
Q4_K_S 1 34.00 GB
IQ4_XS 1 31.95 GB
Q3_K_M 1 30.85 GB below 4.5 bits per weight: for memory-limited use
IQ3_S 1 29.77 GB below 4.5 bits per weight: for memory-limited use
IQ3_XXS 1 28.70 GB below 4.5 bits per weight: for memory-limited use
Q2_K 1 27.65 GB below 4.5 bits per weight: for memory-limited use
IQ2_M 1 26.58 GB below 4.5 bits per weight: for memory-limited use
IQ2_S 1 25.51 GB below 4.5 bits per weight: for memory-limited use
IQ2_XS 1 24.45 GB below 4.5 bits per weight: for memory-limited use
IQ2_XXS 1 23.36 GB below 4.5 bits per weight: for memory-limited use
IQ1_M 1 22.32 GB below 4.5 bits per weight: for memory-limited use
IQ1_S 1 20.57 GB below 4.5 bits per weight: for memory-limited use
32GB-VRAM-Q8E 2 51.30 GB VRAM body + Q8_0 engram (-ot per_layer_token_embd=CPU)
24GB-VRAM-Q8E 1 44.83 GB VRAM body + Q8_0 engram (-ot per_layer_token_embd=CPU)
16GB-VRAM-Q8E 1 36.37 GB VRAM body + Q8_0 engram (-ot per_layer_token_embd=CPU)
12GB-VRAM-Q8E 1 32.10 GB VRAM body + Q8_0 engram (-ot per_layer_token_embd=CPU)
ple-Q8_0 1 21.76 GB Swappable --ple engram table (Q8_0, for CPU RAM offload)
ple-IQ4_NL 1 11.52 GB Swappable --ple engram table (IQ4_NL, compact CPU RAM offload)
mmproj-BF16 1 903 MB Multimodal vision projector (BF16)
mmproj-Q8_0 1 614 MB Multimodal vision projector (Q8_0)
mtp-BF16 1 3.76 GB MTP speculative drafter sidecar (BF16)
mtp-Q8_0 1 2.02 GB MTP speculative drafter sidecar (Q8_0)
mtp-Q4_K_M 1 1.30 GB MTP speculative drafter sidecar (Q4_K_M)
imatrix 1 389 MB Importance matrix

How to run

Requires llama.cpp build b12969 or newer (with Qwen4 --ple support for external engram sidecars).

llama-cli -m Qwen4-35B-A3B-Q4_K_M.gguf --jinja

For vision inputs, pass --mmproj mmproj-Qwen4-35B-A3B-BF16.gguf. For GPU VRAM + CPU RAM engram split presets (*-VRAM-Q8E), pass -ot per_layer_token_embd=CPU.

For swappable per-layer engram precision (keep higher-precision engram tables in system RAM with any smaller body quant):

llama-cli -m Qwen4-35B-A3B-Q3_K_M.gguf   --ple ple-Qwen4-35B-A3B-Q8_0.gguf   -ot per_layer_token_embd=CPU --jinja

Accuracy

Evaluated at full GPU (-ngl 99) against the exact BF16 reference on WikiText-2, held-out chat, and held-out Korean/code chunks. Built with Full-Hessian Block-OBS + Intra-Block GPTQ on routed experts, dense projections, and output head, with full-precision control tensors (norms, router, conv1d).

Quant Size WikiText-2 KL top-1 Chat KL Held-out KL top-1 Answer check Notes
Xylolabs Q8_0 59.078 GB 0.029014 93.21% 0.014375 0.031739 93.90% 7/7
Xylolabs Q6_K 51.751 GB 0.031585 92.77% 0.013721 0.032931 93.73% 7/7
Xylolabs 32GB-VRAM-Q8E 51.296 GB 0.032128 93.00% 0.014542 0.033824 93.80% 7/7
Xylolabs 24GB-VRAM-Q8E 44.831 GB 0.044796 91.50% 0.021152 0.050666 92.40% 7/7
Xylolabs Q5_K_M 42.063 GB 0.034930 92.56% 0.018715 0.041523 92.78% 7/7
Xylolabs 16GB-VRAM-Q8E 36.366 GB 0.141960 85.40% 0.070135 0.167660 85.90% 7/7 below 4.5 bits per weight: for memory-limited use
Xylolabs Q4_K_M 35.102 GB 0.046629 91.20% 0.024423 0.057103 91.94% 7/7
Xylolabs Q4_K_S 33.997 GB 0.051783 90.89% 0.025724 0.063460 91.49% 7/7
Xylolabs IQ4_NL 32.961 GB 0.053540 90.66% 0.027098 0.066892 91.07% 7/7
Xylolabs 12GB-VRAM-Q8E 32.100 GB 0.341104 77.20% 0.174691 0.400883 77.96% 7/7 below 4.5 bits per weight: for memory-limited use
Xylolabs IQ4_XS 31.954 GB 0.060692 90.12% 0.032506 0.075309 91.17% 7/7
Xylolabs Q3_K_M 30.851 GB 0.068516 89.33% 0.033526 0.082097 90.22% 7/7 below 4.5 bits per weight: for memory-limited use
Xylolabs IQ3_S 29.769 GB 0.080187 88.59% 0.038845 0.097043 89.48% 7/7 below 4.5 bits per weight: for memory-limited use
Xylolabs IQ3_XXS 28.695 GB 0.094902 87.76% 0.041497 0.111441 89.01% 7/7 below 4.5 bits per weight: for memory-limited use
Xylolabs Q2_K 27.646 GB 0.117958 86.95% 0.053734 0.139842 87.29% 7/7 below 4.5 bits per weight: for memory-limited use
Xylolabs IQ2_M 26.579 GB 0.134092 85.87% 0.064952 0.161943 86.28% 7/7 below 4.5 bits per weight: for memory-limited use
Xylolabs IQ2_S 25.515 GB 0.160142 84.02% 0.076956 0.186577 85.14% 7/7 below 4.5 bits per weight: for memory-limited use
Xylolabs IQ2_XS 24.449 GB 0.198857 82.27% 0.092359 0.219902 83.70% 7/7 below 4.5 bits per weight: for memory-limited use
Xylolabs IQ2_XXS 23.363 GB 0.259689 80.34% 0.126054 0.303739 81.14% 7/7 below 4.5 bits per weight: for memory-limited use
Xylolabs IQ1_M 22.316 GB 0.298541 78.78% 0.151069 0.350763 79.54% 7/7 below 4.5 bits per weight: for memory-limited use
Xylolabs IQ1_S 20.570 GB 0.238625 81.33% 0.167703 0.403533 79.19% 7/7 below 4.5 bits per weight: for memory-limited use

Full scored table including external baselines: BENCHMARKS.md and accuracy-by-size.csv.

Mean KL divergence by quant file size Top-1 agreement by quant file size

Which file for your hardware

Hardware Memory File Context
12 GB GPU + 32 GB RAM 12 GB VRAM + RAM Qwen4-35B-A3B-12GB-VRAM-Q8E.gguf (32.1 GB, offload engram¹) 32K
16 GB GPU + 32 GB RAM 16 GB VRAM + RAM Qwen4-35B-A3B-16GB-VRAM-Q8E.gguf (36.4 GB, offload engram¹) 32K
RTX 4090 / RTX 3090 24 GB VRAM (+ RAM) Qwen4-35B-A3B-24GB-VRAM-Q8E.gguf (44.8 GB, offload engram¹) 32K
RTX 5090 32 GB VRAM (+ RAM) Qwen4-35B-A3B-32GB-VRAM-Q8E-00001-of-00002.gguf (51.3 GB, offload engram¹) 32K
RTX 6000 Ada, or 2 x 24 GB 48 GB Qwen4-35B-A3B-Q4_K_M.gguf (35.1 GB) 32K
One H100 80 GB Qwen4-35B-A3B-Q8_0-00001-of-00002.gguf (59.1 GB) 128K
RTX PRO 6000 Blackwell (GDDR7) 96 GB Qwen4-35B-A3B-Q8_0-00001-of-00002.gguf (59.1 GB) 128K
DGX Spark 128 GB unified Qwen4-35B-A3B-Q8_0-00001-of-00002.gguf (59.1 GB) 128K
Mac Studio / MacBook Pro M5 Max 128 GB unified Qwen4-35B-A3B-Q8_0-00001-of-00002.gguf (59.1 GB) 128K
One B200 192 GB Qwen4-35B-A3B-Q8_0-00001-of-00002.gguf (59.1 GB) 256K
Mac Studio M5 Ultra 256 GB unified Qwen4-35B-A3B-Q8_0-00001-of-00002.gguf (59.1 GB) 256K
One B300 (HBM3e) 288 GB Qwen4-35B-A3B-Q8_0-00001-of-00002.gguf (59.1 GB) 256K
Mac Studio M5 Ultra 512 GB unified Qwen4-35B-A3B-Q8_0-00001-of-00002.gguf (59.1 GB) 256K

¹ Offload the 21.76 GB Q8_0 per-layer engram table to system RAM with -ot per_layer_token_embd=CPU so all 40 active layers stay in GPU VRAM.

License and notices

Apache License 2.0, copied in LICENSE. We converted the weights to GGUF and quantized them.

Updates

  • 2026-12-05: Upgraded sub-4-bit ladder (IQ1_S through Q3_K_M) with Full-Hessian OBS v3, added four GPU VRAM + Q8_0 RAM engram presets (12GB to 32GB), and added swappable --ple engram tables (Q8_0, IQ4_NL).
  • 2026-12-04: Published full 17-level ladder (IQ1_S through Q8_0), mmproj, mtp sidecars, and imatrix.

Qwen4-35B-A3B

This repository contains model weights and configuration files for the post-trained model in the Hugging Face Transformers format.

These artifacts are compatible with Hugging Face Transformers, vLLM, SGLang, TokenSpeed, etc.

For users seeking managed, scalable inference without infrastructure maintenance, the official Qwen API service is provided by Qwen Cloud.

In particular, Qwen4-35B-A3B is served under the model name qwen4-35b-a3b, with more production features, e.g., official built-in tools. For more information, please refer to the Qwen4-35B-A3B Overview.

Since the release of Qwen3.8-Flash-Next, the community has embraced the Qwen4 architecture with remarkable creativity. Built for efficient inference, the Qwen4 architecture has already found its way into a wide range of new use cases through community-driven work, especially in local, self-hosted deployment.

Meanwhile, we've been pushing hard to unlock the full potential of this next-generation architecture, culminating in Qwen4-Max, the flagship of the Qwen4 series: an ultra-sparse model designed for long-horizon agentic applications, with cost-effectiveness optimized across the board.

Building on the same architecture and training techniques, the Qwen4 open model series is now on its way, making the latest advances in Qwen's frontier AI available to an ever-wider community.

Qwen4 Highlights

Qwen4 features the following enhancement:

  • Efficient model architecture design: Built on a hybrid of linear attention and sparse attention, the Qwen4 architecture delivers outstanding efficiency in long-sequence scenarios — with faster inference and a drastically reduced cache footprint, enabling a native 1,000,000-token context window. Combined with n-gram embeddings, the architecture improves model quality without extra compute or accelerator memory overhead.

  • Significantly enhanced long-horizon agentic capabilities: Real-world productivity spans virtually every industry and profession. Throughout Qwen4's development, we went deep into the workflows of knowledge work, continually expanding the model's knowledge and capability boundaries, and achieved substantial progress in scenarios that demand sustained, long-term task delivery, with the goal of becoming a truly capable work assistant. Qwen4 also delivers stronger performance in coding for visual and creative deliverables, such as frontend development, 3D modeling, and game development with professional software & tools.

  • Improved token efficiency: Qwen4 substantially lowers the overall cost of task completion. Tasks require fewer interaction rounds, and within each round, thinking is markedly more concise across all effort levels, with the levels now clearly better separated. Paired with the architectural gains in inference efficiency, tasks complete faster and at lower cost.

Model Overview

  • Type: Causal Language Model with Vision Encoder
  • Training Stage: Pre-training & Post-training
  • Language Model
    • Number of Parameters: 35B with 3B activated, plus 20B n-gram embedding and 2B MTP
    • Hidden Dimension: 2048
    • Token Embedding: 248320 (Padded)
    • N-gram Embedding: 10,000,000 (bigrams/trigrams at layer 2)
    • Number of Layers: 40
    • Hidden Layout: 10 × (3 × (Gated DeltaNet → MoE) → 1 × (Qwen Sparse Attention → MoE))
    • Gated DeltaNet:
      • Number of Linear Attention Heads: 32 for V and 16 for QK
      • Head Dimension: 128
    • Qwen Sparse Attention:
      • Number of Attention Heads: 16 for Q and 2 for KV
      • Head Dimension: 256
      • Rotary Position Embedding Dimension: 64
      • Indexer Structure: MQA with 4 Query Heads and 1 Shared Key Head
      • Indexer Head Dimension: 128
      • Budget: 512 blocks or 2048 tokens
    • Mixture Of Experts
      • Number of Experts: 256
      • Number of Activated Experts: 8 Routed + 1 Shared
      • Expert Intermediate Dimension: 512
    • Gated Residual:
      • Number of Branches: 4
      • Bottleneck Rank: 256
    • LM Output: 248320 (Padded)
    • MTP: 1 layer, trained with multi-steps
  • Context Length: 1,048,576 natively.

Benchmark Results

Qwen4-35B-A3B Benchmark Results

1. Terminal Bench 4.1, FrontierCode-AA 2.0, AA-Briefcase v1.1 and AutomationBench-AA: Scores are cited from Artificial Analysis.
2. APEX-Agents v1.1: Scores are cited from the Mercor leaderboard.
3. Work360: Our built-in benchmark for evaluating models' capabilities across industrial and professional workflows.
4. ChartoGraphy: The scores of our models were obtained with min_pixels set to 4096×32×32.

Quickstart

For streamlined integration, we recommend using Qwen4-35B-A3B via APIs.

Serving Qwen4-35B-A3B

Inference efficiency and throughput vary significantly across frameworks. We recommend using the latest framework versions to ensure optimal performance and compatibility. For production workloads or high-throughput scenarios, dedicated serving engines such as SGLang, vLLM, and TokenSpeed are strongly recommended.

Qwen4-35B-A3B can be deployed with popular inference frameworks for production-level serving, e.g.:

For local deployment, model repositories in compatible formats can be found in the model tree on the right. The Qwen4 architecture is supported by general-purpose inference engines such as llama.cpp, ollama, unsloth, mlx-vlm, and LiteRT-LM as well as by specialized inference engines for Qwen4.

Qwen4 Tokenizer

Along with the model weights, we release a reference implementation of the Qwen4 Tokenizer/Processor. It ships with the original BPE vocabulary and provides methods for formatting messages into token sequences and parsing messages from generated token sequences. The implementation additionally depends on tiktoken, and trust_remote_code=True is required when creating the tokenizer instance. We recommend using this implementation.

For ecosystems that rely on Jinja chat templates, we include one in tokenizer-compat/ for backward compatibility only. Please note that although it produces the same formatted text, the resulting token IDs can be different, since the reference implementation distinguishes control tokens from regular tokens at the ID level.

See README-tokenizer.md for details.

API Usage

We recommend using the following sets of sampling parameters for generation:

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

Please note that the support for sampling parameters varies according to inference frameworks.

Thinking Control

Qwen4 supports controlling thinking behavior via reasoning_effort and preserve_thinking. By default, Qwen4 operates in thinking mode reasoning_effort="high" and preserve_thinking enabled.

The supported reasoning effort levels are:

  • xhigh: for complex tasks where quality matters most
  • high: for common tasks (default)
  • low: for fast responses with minimal thinking
  • off: disables thinking entirely

The enable_thinking switch can still be used and enable_thinking=False is equivalent to reasoning_effort="off". Please also note that the model may judge a task simple enough to answer directly without thinking, even at non-off reasoning effort levels.

In multi-turn agentic tasks, lower reasoning effort does not always reduce overall task completion time. Although it may produce faster per-turn responses, it can also lead to insufficient analysis, more failures, and repeated retries, which may increase total latency and token consumption.

Chat Completions API

The Chat Completions API is available in most inference frameworks, as well as on Qwen Cloud. You can call the API directly from your application, or connect it to agentic tools such as Qoder CLI and Qwen Code.

Below we show an example of calling the API directly. For connecting agentic applications, please refer to the respective guides for each tool.


Before starting, make sure it is installed and the API key and the API base URL is configured, e.g.:

pip install -U openai

# Set the following accordingly
export OPENAI_BASE_URL="http://localhost:8000/v1"
export OPENAI_API_KEY="EMPTY"
from openai import OpenAI
# Configured by environment variables
client = OpenAI()

# Text-only Input
messages = [
    {"role": "user", "content": "Write a Python function to merge two sorted linked lists."},
]
# Image Input
# messages = [
#     {
#         "role": "user",
#         "content": [
#             {
#                 "type": "image_url",
#                 "image_url": {
#                     "url": "https://qianwen-res.oss-accelerate.aliyuncs.com/Qwen3.5/demo/CI_Demo/mathv-1327.jpg"
#                 }
#             },
#             {
#                 "type": "text",
#                 "text": "The centres of the four illustrated circles are in the corners of the square. The two big circles touch each other and also the two little circles. With which factor do you have to multiply the radii of the little circles to obtain the radius of the big circles?\nChoices:\n(A) $\\frac{2}{9}$\n(B) $\\sqrt{5}$\n(C) $0.8 \\cdot \\pi$\n(D) 2.5\n(E) $1+\\sqrt{2}$"
#             }
#         ]
#     }
# ]

# Video Input
# messages = [
#     {
#         "role": "user",
#         "content": [
#             {
#                 "type": "video_url",
#                 "video_url": {
#                     "url": "https://qianwen-res.oss-accelerate.aliyuncs.com/Qwen3.5/demo/video/N1cdUjctpG8.mp4"
#                 }
#             },
#             {
#                 "type": "text",
#                 "text": "How many porcelain jars were discovered in the niches located in the primary chamber of the tomb?"
#             }
#         ]
#     }
# ]

completion = client.chat.completions.create(
    model="Qwen/Qwen4-35B-A3B",
    messages=messages,
    extra_body={
        "chat_template_kwargs": {
            "preserve_thinking": True,  # on by default
            "reasoning_effort": "high",  # optional; supported levels: "xhigh", "high", "low", "off" (default: high)
        },
    },
    stream=True,
    stream_options={"include_usage": True},
)

reasoning_content = ""
answer_content = ""
is_answering = False
print("\n" + "=" * 20 + "Reasoning" + "=" * 20 + "\n")

for chunk in completion:
    if not chunk.choices:
        print("\nUsage:")
        print(chunk.usage)
        continue

    delta = chunk.choices[0].delta

    if hasattr(delta, "reasoning_content") and delta.reasoning_content is not None:
        if not is_answering:
            print(delta.reasoning_content, end="", flush=True)
        reasoning_content += delta.reasoning_content
    elif hasattr(delta, "reasoning") and delta.reasoning is not None:
        if not is_answering:
            print(delta.reasoning, end="", flush=True)
        reasoning_content += delta.reasoning

    if hasattr(delta, "content") and delta.content:
        if not is_answering:
            print("\n" + "=" * 20 + "Answer" + "=" * 20 + "\n")
            is_answering = True
        print(delta.content, end="", flush=True)
        answer_content += delta.content

messages.append({
    "role": "assistant",
    "content": answer_content,
    "reasoning_content": reasoning_content,
})

Best Practices

To achieve optimal performance, we recommend the following settings:

  1. Sampling Parameters: We suggest using the following sets of sampling parameters:

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

    For supported frameworks, you can adjust the presence_penalty parameter between 0 and 2 to reduce endless repetition. However, using a higher value may occasionally result in language mixing and a slight decrease in model performance.

  2. Adequate Output Length: To optimize performance on agentic tasks, we recommend allocating sufficient output length to allow the model to generate detailed and comprehensive responses. For frameworks that support separate token limits for internal reasoning and final outputs, we suggest the following configuration within the 1M context length:

    • Reasoning Content: Set the maximum output length to 262,144 tokens.
    • Final Response: Set the maximum output length to 131,072 tokens.

    These settings provide the necessary capacity for complex reasoning while ensuring ample space for high-quality final deliverables.

  3. Long Video Understanding: To optimize inference efficiency for plain text and images, the size parameter in the released video_preprocessor_config.json is conservatively configured. It is recommended to set the longest_edge parameter in the video_preprocessor_config file to 469,762,048 (corresponding to 224k video tokens) to enable higher frame-rate sampling for hour-scale videos and thereby achieve superior performance. For example,

    {"longest_edge": 469762048, "shortest_edge": 4096}
    

    Alternatively, override the default values via engine startup parameters. For implementation details, refer to: vLLM / SGLang.

  4. Video Frame Sampling: When vLLM is launched with --media-io-kwargs '{"video": {"num_frames": -1}}', video frame sampling can be configured via extra_body (e.g., by setting fps). This feature is currently supported only in vLLM. By default, fps=2 and do_sample_frames=True.

    # With `do_sample_frames=True`, you can customize the `fps` value to set your desired video sampling rate.
    chat_response = client.chat.completions.create(
        model="Qwen/Qwen4-35B-A3B",
        messages=messages,
        extra_body={
            "mm_processor_kwargs": {"fps": 2, "do_sample_frames": True},
        }, 
    )
    

Citation

If you find our work helpful, feel free to give us a cite.

@techreport{qwen2026design,
    title       = {On the Design of {Qwen3.8-Next} Architecture: Evaluation, Efficiency, and Training Stability},
    author      = {{Qwen Team}},
    institution = {Alibaba Group},
    month       = {August},
    year        = {2026}
}

@misc{qwen4-35ba3b,
    title  = {{Qwen4-35B-A3B}},
    author = {{Qwen Team}},
    month  = {December},
    year   = {2026},
    url    = {https://huggingface.co/Qwen/Qwen4-35B-A3B}
}
Downloads last month
19,381
GGUF
Model size
20B params
Architecture
qwen4exp
Hardware compatibility
Log In to add your hardware

1-bit

2-bit

3-bit

4-bit

5-bit

6-bit

8-bit

16-bit

Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for Xylolabs/Qwen4-35B-A3B-GGUF

Quantized
(652)
this model

Collections including Xylolabs/Qwen4-35B-A3B-GGUF