Instructions to use PureTensorAI/Qwen3-30B-A3B-Instruct-2507-NVFP4A16-ExpertsOnly with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use PureTensorAI/Qwen3-30B-A3B-Instruct-2507-NVFP4A16-ExpertsOnly with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="PureTensorAI/Qwen3-30B-A3B-Instruct-2507-NVFP4A16-ExpertsOnly") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("PureTensorAI/Qwen3-30B-A3B-Instruct-2507-NVFP4A16-ExpertsOnly") model = AutoModelForCausalLM.from_pretrained("PureTensorAI/Qwen3-30B-A3B-Instruct-2507-NVFP4A16-ExpertsOnly", device_map="auto") messages = [ {"role": "user", "content": "Who are you?"}, ] inputs = tokenizer.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=256) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use PureTensorAI/Qwen3-30B-A3B-Instruct-2507-NVFP4A16-ExpertsOnly with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "PureTensorAI/Qwen3-30B-A3B-Instruct-2507-NVFP4A16-ExpertsOnly" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "PureTensorAI/Qwen3-30B-A3B-Instruct-2507-NVFP4A16-ExpertsOnly", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/PureTensorAI/Qwen3-30B-A3B-Instruct-2507-NVFP4A16-ExpertsOnly
- SGLang
How to use PureTensorAI/Qwen3-30B-A3B-Instruct-2507-NVFP4A16-ExpertsOnly 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 "PureTensorAI/Qwen3-30B-A3B-Instruct-2507-NVFP4A16-ExpertsOnly" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "PureTensorAI/Qwen3-30B-A3B-Instruct-2507-NVFP4A16-ExpertsOnly", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'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 "PureTensorAI/Qwen3-30B-A3B-Instruct-2507-NVFP4A16-ExpertsOnly" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "PureTensorAI/Qwen3-30B-A3B-Instruct-2507-NVFP4A16-ExpertsOnly", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use PureTensorAI/Qwen3-30B-A3B-Instruct-2507-NVFP4A16-ExpertsOnly with Docker Model Runner:
docker model run hf.co/PureTensorAI/Qwen3-30B-A3B-Instruct-2507-NVFP4A16-ExpertsOnly
Qwen3-30B-A3B-Instruct-2507 NVFP4A16, experts only (GPTQ, attention kept at 16 bits)
NVFP4 quantization of Qwen/Qwen3-30B-A3B-Instruct-2507, made by PureTensor from the official BF16 weights. Only the expert layers are 4-bit. Attention, routers, embeddings and all activations stay 16-bit. The file is 19.40 GB against 61.08 GB for BF16.
This is a test release. It is not affiliated with or endorsed by the model's authors.
Read this first: this build stays closer to the original model than our fully quantized sibling, Qwen3-30B-A3B-Instruct-2507-NVFP4A16. Its KL divergence from BF16 is a third lower (0.0199 against 0.0292), and on MMLU it is not statistically different from BF16 (79.90 against 80.12, p = 0.12). It costs 1.3 GB more and serves 4 to 11% slower than the sibling, which is still 1.3 to 2.1 times faster than BF16 on vLLM. On benchmark scores the two builds are not reliably different from each other: this one is 0.24 points higher on MMLU (p = 0.09) and 1.2 points lower on served GSM8K (p = 0.05). Choose this one for fidelity to the original, the sibling for smallest size and highest speed. Use vLLM to run it: loading it the plain way in Transformers gives wrong outputs without any error (see Usage).
What was done
| Source | Qwen/Qwen3-30B-A3B-Instruct-2507, BF16. A mixture-of-experts model: 48 blocks, 128 experts per block, 8 active per token |
| Format | compressed-tensors nvfp4-pack-quantized, scheme NVFP4A16: 4-bit E2M1 values, one FP8 E4M3 scale per group of 16, one FP32 scale per tensor |
| Quantized | all 18,432 expert layers (97% of the block weights) |
| Kept in BF16 | the attention projections (3% of the block weights; keeping them at 16 bits adds 1.3 GB), the expert routers, token embeddings and output head, all norms, all activations |
| Method | GPTQ (block_size 128, dampening_frac 0.01, actorder static) |
| Expert calibration | every calibration token is passed through every expert; tokens the router did not send to an expert count with weight 0.1 in that expert's statistics |
| Calibration data | 512 chat-formatted samples from mlabonne/open-perfectblend, up to 2,048 tokens each |
| Tools | llm-compressor 0.15.0, compressed-tensors 0.20.1, transformers 5.21.0, torch 2.14.1 |
Measured quality
One harness, BF16 as reference. The saved checkpoint reloaded from disk to logits identical to the in-memory quantized model.
| BF16 | Fully quantized sibling | This checkpoint | This checkpoint against BF16 | |
|---|---|---|---|---|
| MMLU (14,042 questions) | 80.12 | 79.66 | 79.90 | 193 lost, 163 gained, p = 0.12 |
| ARC-Challenge | 60.84 | 60.07 | 59.90 | p = 0.20 |
| HellaSwag | 61.15 | 60.98 | 60.83 | p = 0.02 |
| Winogrande | 72.93 | 72.69 | 73.16 | p = 0.81 |
| TruthfulQA (mc2) | 61.67 | 60.53 | 60.94 | p = 0.02 |
| GSM8K through vLLM's completions API (1,319 problems) | 88.70 | 89.46 | 88.25 | 34 lost, 28 gained, p = 0.53 |
| Mean KL divergence from BF16, WikiText-2 | 0 | 0.0292 | 0.0199 | |
| Mean KL divergence from BF16, chat | 0 | 0.0238 | 0.0153 | |
| Same expert choices as BF16 | 100% | 95.3% | 96.3% | |
| File size | 61.08 GB | 18.09 GB | 19.40 GB |
- Benchmarks: default configurations of lm-evaluation-harness 0.4.13, no chat template, run offline in Transformers except GSM8K. The paired test is an exact McNemar test on per-question correctness.
- KL divergence: full next-token distribution, teacher-forced, 48 WikiText-2 windows and 96 conversations from
HuggingFaceH4/ultrachat_200k(test_sft), 1,024 tokens each. The chat set comes from the same dataset family as part of the calibration data (different rows), so that row is flattering. - "Same expert choices": for each token, the share of BF16's 8 experts per block that this model's router also picks.
- This checkpoint against the sibling, paired: MMLU 211 gained and 177 lost (p = 0.09); served GSM8K 21 gained and 37 lost (p = 0.05); the other four benchmarks p = 0.08 to 0.90. Six tests with no correction for multiple comparisons, so we read this as no reliable difference on tasks.
- One calibration draw. A second draw of the sibling recipe moved MMLU by 0.04, so draw noise at this model size is small.
On a real serving engine
Served with vLLM 0.34.0 on one NVIDIA Blackwell workstation GPU (compute capability 12.0). The experts run on vLLM's weight-only FP4 kernel; attention runs in BF16.
| BF16 | Fully quantized sibling | This checkpoint | |
|---|---|---|---|
| GSM8K through the completions API | 88.70 | 89.46 | 88.25 |
| Throughput, single stream | 1.00x | 1.42x | 1.27x |
| Throughput, 8 concurrent | 1.00x | 2.27x | 2.08x |
| Throughput, 32 concurrent | 1.00x | 1.86x | 1.79x |
Throughput is fixed 256-token greedy generations and will differ on other hardware.
Why attention is left alone
In this model attention handles every token, while each expert handles about 6% of tokens. We measured what each part costs by rounding it to 4 bits on its own, with no calibration:
| Rounded to 4 bits | Share of block weights | KL, WikiText | KL, chat | Same expert choices as BF16 |
|---|---|---|---|---|
| Attention only | 3% | 0.0225 | 0.0283 | 95.4% |
| Experts only | 97% | 0.0205 | 0.0223 | 96.2% |
| Both | 100% | 0.0380 | 0.0427 | 94.5% |
Three percent of the weights cause about half of the damage. Rounding attention alone also changes almost 5% of the routers' expert choices, although the routers themselves are untouched. Leaving attention at 16 bits is therefore nearly free and removes about half of the error.
It also changes what calibration is worth. Plain round-to-nearest on the experts alone (no calibration data, KL 0.0205 and 0.0223, MMLU 79.67) already has lower KL than our fully quantized GPTQ build. GPTQ on the experts then lowers KL further (0.0199 and 0.0153) and brings MMLU to 79.90; the paired difference between those two experts-only builds is p = 0.09 on MMLU, so most of the gain comes from leaving attention alone, not from calibration.
We also rounded one quarter of the blocks at a time (attention and experts, no calibration). The last quarter costs about twice as much as any other: KL on WikiText 0.0107, 0.0093, 0.0102 and 0.0186 for blocks 0 to 11, 12 to 23, 24 to 35 and 36 to 47.
We found this by measurement on 21 November 2026 and only then searched for earlier work. It is established practice, not our idea. NVIDIA's Model Optimizer ships experts-only and MLP-only NVFP4 configurations and recommends them for accuracy. QuantMoE-Bench (2024) studied which parts of a mixture-of-experts model need more bits and argued that parts used by every token deserve higher precision than sparsely used experts. Later work assigns a bit width to each expert (GEMQ, MODE). What this card adds is the isolated per-component measurement at 4 bits and the comparison with a fully quantized build.
For the expert-calibration comparison (all tokens, routed only, or a blend, at 32 to 512 samples) see the sibling's card.
Usage
vLLM (recommended):
vllm serve PureTensorAI/Qwen3-30B-A3B-Instruct-2507-NVFP4A16-ExpertsOnly
Transformers. Do not use plain from_pretrained for this checkpoint. With transformers 5.21 a plain load drops the per-tensor scale of every expert layer as "unexpected" and raises no error; on our sibling checkpoint of the same format the result was garbage (perplexity in the hundreds of millions on a simple English sentence). Load it through llm-compressor (pip install llmcompressor):
import torch
from transformers import AutoModelForCausalLM, AutoTokenizer
from llmcompressor.modeling.moe.linearize import load_quantizable_moe
repo = "PureTensorAI/Qwen3-30B-A3B-Instruct-2507-NVFP4A16-ExpertsOnly"
tok = AutoTokenizer.from_pretrained(repo)
with load_quantizable_moe():
model = AutoModelForCausalLM.from_pretrained(repo, dtype=torch.bfloat16)
model.to("cuda")
msgs = [{"role": "user", "content": "Summarise the water cycle in two sentences."}]
ids = tok.apply_chat_template(msgs, add_generation_prompt=True, return_tensors="pt", return_dict=True).to("cuda")
out = model.generate(**ids, max_new_tokens=256)
print(tok.decode(out[0, ids["input_ids"].shape[1]:], skip_special_tokens=True))
This path expands the weights back to 16-bit and runs each expert as a separate layer, so it needs as much memory as BF16 and is slow. It is for checking, not for serving.
Limitations
- HellaSwag and TruthfulQA are 0.3 and 0.7 points below BF16 (p = 0.02 each). Served GSM8K is 1.2 points below the fully quantized sibling (p = 0.05) and within noise of BF16. GSM8K was measured only through vLLM, the other benchmarks only offline.
- English-language benchmarks only. No safety, multilingual, tool-use or long-context evaluation was run on the quantized model.
- Three of the 6,144 experts received no routed calibration tokens. They are still calibrated, on unrouted tokens.
- Throughput ratios are from one GPU and one workload and will differ elsewhere.
License
Apache-2.0, as the base model. Changes from the base release: the expert Linear weights are quantized to NVFP4 and stored packed, and config.json gains a quantization_config block.
- Downloads last month
- 48
Model tree for PureTensorAI/Qwen3-30B-A3B-Instruct-2507-NVFP4A16-ExpertsOnly
Base model
Qwen/Qwen3-30B-A3B-Instruct-2507