Instructions to use QUASAR-QAT/Qwen3.5-4B-QUASAR-NVFP4-W4A4 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use QUASAR-QAT/Qwen3.5-4B-QUASAR-NVFP4-W4A4 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="QUASAR-QAT/Qwen3.5-4B-QUASAR-NVFP4-W4A4") messages = [ { "role": "user", "content": [ {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"}, {"type": "text", "text": "What animal is on the candy?"} ] }, ] pipe(text=messages)# Load model directly from transformers import AutoProcessor, AutoModelForMultimodalLM processor = AutoProcessor.from_pretrained("QUASAR-QAT/Qwen3.5-4B-QUASAR-NVFP4-W4A4") model = AutoModelForMultimodalLM.from_pretrained("QUASAR-QAT/Qwen3.5-4B-QUASAR-NVFP4-W4A4", device_map="auto") messages = [ { "role": "user", "content": [ {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"}, {"type": "text", "text": "What animal is on the candy?"} ] }, ] inputs = processor.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=40) print(processor.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use QUASAR-QAT/Qwen3.5-4B-QUASAR-NVFP4-W4A4 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "QUASAR-QAT/Qwen3.5-4B-QUASAR-NVFP4-W4A4" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "QUASAR-QAT/Qwen3.5-4B-QUASAR-NVFP4-W4A4", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }'Use Docker
docker model run hf.co/QUASAR-QAT/Qwen3.5-4B-QUASAR-NVFP4-W4A4
- SGLang
How to use QUASAR-QAT/Qwen3.5-4B-QUASAR-NVFP4-W4A4 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 "QUASAR-QAT/Qwen3.5-4B-QUASAR-NVFP4-W4A4" \ --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": "QUASAR-QAT/Qwen3.5-4B-QUASAR-NVFP4-W4A4", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }'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 "QUASAR-QAT/Qwen3.5-4B-QUASAR-NVFP4-W4A4" \ --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": "QUASAR-QAT/Qwen3.5-4B-QUASAR-NVFP4-W4A4", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }' - Docker Model Runner
How to use QUASAR-QAT/Qwen3.5-4B-QUASAR-NVFP4-W4A4 with Docker Model Runner:
docker model run hf.co/QUASAR-QAT/Qwen3.5-4B-QUASAR-NVFP4-W4A4
Qwen3.5-4B — QUASAR NVFP4 W4A4 for Blackwell
39% lower KL to BF16 than cosmicproc's public Qwen3.5-4B W4A4 build in our same-harness comparison (.046 vs .075), with +1.9 points top-1 agreement.
4.2 GB · all 200 decoder projections in NVFP4 · W4A4 activations · vision + MTP retained · native Blackwell FP4 path · serves directly with vLLM.
Also in this family: W4A16 / vLLM · W4A4 / Blackwell (this repo) · Q4_0 GGUF / llama.cpp · collection · paper
Same bit-exact QUASAR-trained weights as the W4A16 release, plus calibrated activation scales for native W4A4 execution on Blackwell. The W4A16 sibling contains the full reasoning benchmark head-to-head.
Run it
pip install "vllm>=0.26"
vllm serve QUASAR-QAT/Qwen3.5-4B-QUASAR-NVFP4-W4A4 --max-model-len 262144 --reasoning-parser qwen3
Target runtime is Blackwell (compute capability 10.0+), where vLLM uses the native NVFP4 W4A4 path. On Hopper, vLLM falls back to weight-only Marlin; we verified identical greedy outputs to the W4A16 release on H100.
Fidelity under FP4 activations
Per-token forward KL(BF16 ‖ quantized) and top-1 agreement on 734 held-out prompts of the BF16 model's own responses (934k tokens), with vLLM's NVFP4 activation quantization applied to the inputs of the same 200 projections; each W4A4 row uses its own calibrated scales. Methodology and audit trail: EVAL.md.
| KL ↓ | KL p99 ↓ | Top-1 ↑ | |
|---|---|---|---|
| QUASAR W4A4 (this model) | .046 | .357 | 93.3% |
| cosmicproc W4A4 | .075 | .587 | 91.4% |
| BF16 weights + FP4 activations | .037 | .265 | 94.1% |
FP4 activations account for most of the remaining gap to BF16: the activation-only reference is .037 KL, while QUASAR W4A4 is .046. Under the same evaluation harness, cosmicproc is .075.
What is quantized
Weights: NVFP4 on all 200 major decoder projections; bit-exact to the QUASAR-trained W4A16 weights. Activations: NVFP4 group-16 with dynamic local scales and calibrated static per-tensor global scales. BF16: embeddings, norms, conv1d kernels, small delta-net gate vectors, vision tower and MTP drafter.
Related
QUASAR-QAT/Qwen3.5-4B-QUASAR-Q4_0-GGUF— native Q4_0 QAT for llama.cpp / Ollama / LM Studio.QUASAR-QAT/Qwen3.5-4B-QUASAR-NVFP4— the W4A16 release with the full benchmark head-to-head.QUASAR-QAT/Qwen3.8-27B-QUASAR-NVFP4— the 27B W4A4 sibling.- Qwen3.5-4B & Qwen3.8-27B — QUASAR 4-bit QAT — the collection · Paper: arXiv 2608.13966.
Citation
@article{counathe2026quasar,
title={QUASAR: Lowering the Loss Floor of Quantization-Aware Training with Loss-Aware Reconstruction},
author={Counathe, Vincent and Athiwaratkun, Ben and De Sa, Christopher and Zhang, Tianyi},
journal={arXiv preprint arXiv:2608.13966},
year={2026}
}
- Downloads last month
- 47