Instructions to use axteam/Qwen3.5-2B-NVFP4 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use axteam/Qwen3.5-2B-NVFP4 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="axteam/Qwen3.5-2B-NVFP4") 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)# pip install -U transformers accelerate # Load model directly from transformers import AutoProcessor, AutoModelForMultimodalLM processor = AutoProcessor.from_pretrained("axteam/Qwen3.5-2B-NVFP4") model = AutoModelForMultimodalLM.from_pretrained("axteam/Qwen3.5-2B-NVFP4", 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=256) print(processor.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use axteam/Qwen3.5-2B-NVFP4 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "axteam/Qwen3.5-2B-NVFP4" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "axteam/Qwen3.5-2B-NVFP4", "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/axteam/Qwen3.5-2B-NVFP4
- SGLang
How to use axteam/Qwen3.5-2B-NVFP4 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 "axteam/Qwen3.5-2B-NVFP4" \ --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": "axteam/Qwen3.5-2B-NVFP4", "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 "axteam/Qwen3.5-2B-NVFP4" \ --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": "axteam/Qwen3.5-2B-NVFP4", "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 axteam/Qwen3.5-2B-NVFP4 with Docker Model Runner:
docker model run hf.co/axteam/Qwen3.5-2B-NVFP4
Qwen3.5-2B ยท NVFP4 (W4A4, FP4)
4-bit quantization of Qwen/Qwen3.5-2B, produced for efficient vLLM serving. Quantized by axteam.
| Base model | Qwen/Qwen3.5-2B |
| Method | NVFP4 (W4A4, FP4) |
| Format | compressed-tensors nvfp4-pack-quantized |
| Weights / activations | W4A4 โ FP4 (E2M1) weights group 16 (FP8 E4M3 scale + per-tensor FP32 global scale), FP4 activations |
| Architecture | Hybrid (linear-attention + full-attention) ยท Dense ยท multimodal (vision) ยท MTP head |
| Size on disk | ~2.9 GB |
| Calibration | 256 samples (Korean-heavy mixed corpus) |
| License | Apache-2.0 |
Quantization details
- Scheme โ W4A4 โ FP4 (E2M1) weights group 16 (FP8 E4M3 scale + per-tensor FP32 global scale), FP4 activations, stored as compressed-tensors
nvfp4-pack-quantized. - Kept in BF16 โ the vision tower & projector (
model.visual.*), the multi-token-prediction head (mtp.*), all RMSNorms, token embeddings, the LM head, the entire linear-attention (GatedDeltaNet/SSM) path โ FP4 is too coarse for the SSM weights, so the fulllinear_attn.*stays BF16. Left unquantized to preserve quality (a small fraction of parameters). - Tokenizer /
chat_template/generation_configare identical to the original.config.jsonis the original plus aquantization_configblock.
This is post-training quantization (PTQ) โ no retraining, so behaviour stays faithful to the original. AWQ uses a small calibration set (no gradient) to protect salient weight channels before rounding.
Evaluation (measured)
Fidelity to the BF16 original on an internal mixed English/Korean set (100 prompts, BF16 greedy answers scored under each build โ same harness for every row).
| Metric | This model | BF16 original |
|---|---|---|
| Perplexity (lower = closer) | 2.0399 | 1.8515 (+10.2%) |
| Top-1 next-token agreement | 85.8% | 98.9% |
These measure fidelity to the base model, not absolute task scores.
โ ๏ธ Note: this sparse-MoE model is sensitive to 4-bit quantization (+10.2% perplexity here). For production we recommend the 8-bit builds (FP8 or AWQ INT8) of this model.
Usage (vLLM)
vllm serve axteam/Qwen3.5-2B-NVFP4
Recommended sampling (Qwen):
temperature=0.7, top_p=0.8, top_k=20. This is a Blackwell-only format โ it needs FP4 tensor cores (B200) for full speed.
License
Quantized derivative of Qwen/Qwen3.5-2B (Apache-2.0). All original weights, tokenizer and chat template belong to the Qwen team.
ํ๊ตญ์ด ์์ฝ
Qwen/Qwen3.5-2B ๋ฅผ NVFP4 (W4A4, FP4) ๋ก ์์ํํ ์๋น์ฉ(4-bit) ๋ชจ๋ธ์
๋๋ค. ์์ฑ: axteam.
- ๋ฐฉ์ โ ๊ฐ์ค์นยทํ์ฑํ ๋ชจ๋ FP4(W4A4). Blackwell(B200) FP4 ํ
์์ฝ์ด์์ ์ ์๋. ํ์ง ์ฐ์ ์ด๋ฉด NVFP4A16 ๊ถ์ฅ. ํ์ compressed-tensors
nvfp4-pack-quantized. - BF16 ์ ์ง โ ๋น์ ํ์ยทMTP ํค๋ยท๋ชจ๋ normยท์๋ฒ ๋ฉ/LM ํค๋ยทSSM(linear_attn) ๊ฒฝ๋ก ์ ์ฒด(FP4๊ฐ SSM ๊ฐ์ค์น์ ๋๋ฌด ๊ฑฐ์น ์ด์).
- PTQ โ ์ฌํ์ต ์์, ์๋ณธ ๋์ ์ ์ง.
- ํ์ง(์ค์ธก) โ BF16 ์๋ณธ ๋๋น perplexity 2.0399(์๋ณธ 1.8515, +10.2%), top-1 ์ผ์น๋ 85.8%(์๋ณธ 98.9%). ๋ด๋ถ ์/ํ 100๋ฌธํญ, ๊ฐ์ ํ๋ค์ค.
- โ ๏ธ ์ฃผ์ โ ์ด ์ดํฌ์ MoE ๋ 4๋นํธ์ ๋ฏผ๊ฐํฉ๋๋ค(์ฌ๊ธฐ +10.2%). ์ค์๋น์ค์๋ 8๋นํธ(FP8 ๋๋ AWQ INT8) ๋น๋๋ฅผ ๊ถ์ฅํฉ๋๋ค.
- ์ฌ์ฉ โ
vllm serve axteam/Qwen3.5-2B-NVFP4, ๊ถ์ฅ ์ํ๋งtemperature=0.7, top_p=0.8, top_k=20. - ๋ผ์ด์ ์ค โ ์๋ณธ Apache-2.0 ํ์๋ฌผ. ๊ฐ์ค์นยทํ ํฌ๋์ด์ ยทchat_template ๊ถ๋ฆฌ๋ Qwen ํ.
- Downloads last month
- 2