Run this model with HF Jobs
Run OpenTensorLab/Qwen4-35B-A3B-GPTQ on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.
Paste one of these prompts into your coding agent:
Fine-tune on my dataset
Use HF Jobs and TRL to fine-tune https://huggingface.co/OpenTensorLab/Qwen4-35B-A3B-GPTQ. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.
Run batch inference
Use HF Jobs to run batch inference with https://huggingface.co/OpenTensorLab/Qwen4-35B-A3B-GPTQ on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.
Evaluate on a benchmark
Use HF Jobs to evaluate https://huggingface.co/OpenTensorLab/Qwen4-35B-A3B-GPTQ. Ask me which benchmark to run, then save the scores and the per-example results to a new dataset repo. Run `hf jobs --help` first to learn the CLI.
Instructions to use OpenTensorLab/Qwen4-35B-A3B-GPTQ with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use OpenTensorLab/Qwen4-35B-A3B-GPTQ with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="OpenTensorLab/Qwen4-35B-A3B-GPTQ")# pip install -U transformers accelerate # Load model directly from transformers import AutoProcessor, AutoModelForMultimodalLM processor = AutoProcessor.from_pretrained("OpenTensorLab/Qwen4-35B-A3B-GPTQ") model = AutoModelForMultimodalLM.from_pretrained("OpenTensorLab/Qwen4-35B-A3B-GPTQ", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use OpenTensorLab/Qwen4-35B-A3B-GPTQ with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "OpenTensorLab/Qwen4-35B-A3B-GPTQ" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "OpenTensorLab/Qwen4-35B-A3B-GPTQ", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/OpenTensorLab/Qwen4-35B-A3B-GPTQ
- SGLang
How to use OpenTensorLab/Qwen4-35B-A3B-GPTQ with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "OpenTensorLab/Qwen4-35B-A3B-GPTQ" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "OpenTensorLab/Qwen4-35B-A3B-GPTQ", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "OpenTensorLab/Qwen4-35B-A3B-GPTQ" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "OpenTensorLab/Qwen4-35B-A3B-GPTQ", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use OpenTensorLab/Qwen4-35B-A3B-GPTQ with Docker Model Runner:
docker model run hf.co/OpenTensorLab/Qwen4-35B-A3B-GPTQ
Qwen4-35B-A3B-GPTQ (W4A16 RTN)
This repository contains a W4A16 (4-bit weight, 16-bit activation) RTN (Round-To-Nearest) GPTQ-formatted quantization of Qwen/Qwen4-35B-A3B, generated using Intel AutoRound without multi-iteration SignRound fine-tuning.
vLLM Compatibility Notice: You must use the
vllm/vllm-openai:qwen4Docker image (or a vLLM build containing the Qwen4 MoE + QSA + PLE integration) to serve this model right now. Standard stable vLLM releases do not yet includeQwen4MoeForConditionalGeneration/Qwen4Expsupport.
Quantization Details
- Base Model:
Qwen/Qwen4-35B-A3B(35B total parameters, 3B active per token, plus 20B N-gram PLE embedding and 2B MTP layer) - Method: RTN / Fast W4A16 (
iters=1via Intel AutoRound0.18.0.dev355without multi-iteration SignRound optimization) - Scheme & Format:
W4A16(auto_gptqlayout,group_size=128,sym=True) - Calibration:
NeelNanda/pile-10k(nsamples=256,seqlen=2048) - Quantized Modules (30,760 / 31,434 linear layers):
- All 40 MoE layers' routed experts (
256experts per layer:gate_proj,up_proj,down_proj) - All 10 Qwen Sparse Attention (QSA) layers (
q_proj,k_proj,v_proj,o_proj)
- All 40 MoE layers' routed experts (
- Preserved in
BF16(Unquantized for Precision & Kernel Compatibility):- Vision encoder (
model.visual.*) - Gated DeltaNet linear attention layers (
linear_attn.*) - Shared experts & MoE routers (
mlp.shared_expert.*,mlp.shared_expert_gate,mlp.gate) - Manifold-Constrained Hyper-Connections (
attn_hyper_connection,mlp_hyper_connection,hyper_connection_mixer) - QSA sparse attention indexers (
self_attn.indexer.index_qk_proj) - Layer 1 Parameterized Lexical Embedding (
ple.*, including the 10M-entry N-gram table offloaded to pinned host RAM by vLLM) - Multi-Token Prediction (
mtp.*) draft head &lm_head
- Vision encoder (
Serving with vLLM (vllm/vllm-openai:qwen4)
1. Launch via Docker
--dtype bfloat16is required. vLLM's Qwen4 Sparse Attention (Qwen4ExpQSAAttention) kernel requiresbfloat16activations and raisesNotImplementedError: Qwen4Exp QSA currently requires BF16if loaded infloat16.
docker run --rm -it --gpus all \
--ipc=host \
-p 8000:8000 \
-v ~/.cache/huggingface:/root/.cache/huggingface \
vllm/vllm-openai:qwen4 \
OpenTensorLab/Qwen4-35B-A3B-GPTQ \
--dtype bfloat16 \
--trust-remote-code \
--enable-prefix-caching \
--max-model-len 32k \
--disable-flashinfer-autotune \
--gpu-memory-utilization 0.90 \
--kv-cache-dtype fp8 \
--attention-config.indexer_kv_dtype fp8 \
--enable-auto-tool-choice \
--tool-call-parser qwen4 \
--reasoning-parser qwen4 \
--speculative-config '{"method":"mtp","num_speculative_tokens":3,"index_share_for_mtp_iteration":true}'
2. Verified Runtime Footprint
On a single RTX PRO 600 GPU with --gpu-memory-utilization 0.90 and --max-model-len 32k:
- GPU Weight + Non-Torch Memory:
25.84 GiB(N-gram PLE embedding automatically pinned in CPU host RAM) - Peak Activation + CUDA Graph Memory:
5.29 GiB(3.41 GiBactivation +1.88 GiBCUDA graphs) - Available KV Cache (
fp8):54.24 GiB(1,843,200tokens /57.60xconcurrency at 32K context) - MTP Speculative Decoding (
num_speculative_tokens=3): Verified mean acceptance length2.39 β 2.85tokens per step (~`300 β 400 tok/s` single-stream generation)
API Usage (OpenAI-Compatible)
pip install -U openai
export OPENAI_BASE_URL="http://localhost:8000/v1"
export OPENAI_API_KEY="EMPTY"
from openai import OpenAI
client = OpenAI()
messages = [
{"role": "user", "content": "Write a Python function to merge two sorted linked lists."},
]
completion = client.chat.completions.create(
model="OpenTensorLab/Qwen4-35B-A3B-GPTQ",
messages=messages,
extra_body={
"chat_template_kwargs": {
"preserve_thinking": True,
"reasoning_effort": "high", # Supported: "xhigh", "high", "low", "off"
},
},
stream=True,
stream_options={"include_usage": True},
)
reasoning_content = ""
answer_content = ""
is_answering = False
for chunk in completion:
if not chunk.choices:
print("\nUsage:", chunk.usage)
continue
delta = chunk.choices[0].delta
if getattr(delta, "reasoning_content", None):
if not is_answering:
print(delta.reasoning_content, end="", flush=True)
reasoning_content += delta.reasoning_content
if getattr(delta, "content", None):
if not is_answering:
print("\n\n--- Answer ---\n")
is_answering = True
print(delta.content, end="", flush=True)
answer_content += delta.content
Recommended Sampling Parameters
- Thinking Mode (
reasoning_effort=low/high/xhigh):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 (
reasoning_effort="off"orenable_thinking=False):temperature=0.7,top_p=0.80,top_k=20,min_p=0.0,presence_penalty=1.5,repetition_penalty=1.0
π Deploy on RunPod
One-click launch environments pre-configured with PyTorch, CUDA, and dependencies for fine-tuning or quantization.
π Need GPU compute? Sign up via RunPod and get $5β$500 in free credits when you add your first $10.
PyTorch 2.15
PyTorch 2.14
PyTorch 2.13
PyTorch 2.12
Citation
@misc{qwen4-35ba3b,
title = {{Qwen4-35B-A3B}},
author = {{Qwen Team}},
month = {December},
year = {2026},
url = {[https://huggingface.co/Qwen/Qwen4-35B-A3B](https://huggingface.co/Qwen/Qwen4-35B-A3B)}
}
@article{cheng2023optimize,
title = {Optimize Weight Rounding via Signed Gradient Descent for the Quantization of LLMs},
author = {Cheng, Wenhua and Zhang, Weiwei and Shen, Haihao and Cai, Yiyang and He, Xin and Lv, Kaokao and Liu, Yi},
journal = {arXiv preprint arXiv:2309.05516},
year = {2023}
}
- Downloads last month
- -
Model tree for OpenTensorLab/Qwen4-35B-A3B-GPTQ
Base model
Qwen/Qwen4-35B-A3B
docker model run hf.co/OpenTensorLab/Qwen4-35B-A3B-GPTQ