nvidia/Nemotron-Post-Training-Dataset-v2
Viewer • Updated • 6.34M • 7.1k • 132
How to use apolo13x/Qwen3.5-9B-NVFP4 with Transformers:
# Use a pipeline as a high-level helper
from transformers import pipeline
pipe = pipeline("image-text-to-text", model="apolo13x/Qwen3.5-9B-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) # Load model directly
from transformers import AutoProcessor, AutoModelForImageTextToText
processor = AutoProcessor.from_pretrained("apolo13x/Qwen3.5-9B-NVFP4")
model = AutoModelForImageTextToText.from_pretrained("apolo13x/Qwen3.5-9B-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?"}
]
},
]
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]:]))How to use apolo13x/Qwen3.5-9B-NVFP4 with vLLM:
# Install vLLM from pip:
pip install vllm
# Start the vLLM server:
vllm serve "apolo13x/Qwen3.5-9B-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": "apolo13x/Qwen3.5-9B-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 run hf.co/apolo13x/Qwen3.5-9B-NVFP4
How to use apolo13x/Qwen3.5-9B-NVFP4 with SGLang:
# Install SGLang from pip:
pip install sglang
# Start the SGLang server:
python3 -m sglang.launch_server \
--model-path "apolo13x/Qwen3.5-9B-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": "apolo13x/Qwen3.5-9B-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 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 "apolo13x/Qwen3.5-9B-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": "apolo13x/Qwen3.5-9B-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"
}
}
]
}
]
}'How to use apolo13x/Qwen3.5-9B-NVFP4 with Docker Model Runner:
docker model run hf.co/apolo13x/Qwen3.5-9B-NVFP4
This is a quantized version of Qwen/Qwen3.5-9B. This model accepts text and images as inputs and generates text as outputs. The weights and activations were quantized to FP4 using llm-compressor with 512 calibration samples from nvidia/Nemotron-Post-Training-Dataset-v2, reducing the model size from 18.0 GB to 11.5 GB (~1.6x reduction) while maintaining 97.3% average accuracy recovery.
This model is supported in vLLM 0.17.0. To serve the model:
vllm serve Kbenkhaled/Qwen3.5-9B-NVFP4 \
--reasoning-parser qwen3 \
--enable-prefix-caching
Evaluated with lm-evaluation-harness, 0-shot, thinking mode ON.
| Benchmark | Qwen3.5-9B | Qwen3.5-9B-NVFP4 (this model) | Recovery |
|---|---|---|---|
| GPQA Diamond | 78.79% | 74.24% | 94.2% |
| IFEval | 94.48% | 92.69% | 98.1% |
| MMLU-Redux | 91.80% | 91.39% | 99.6% |
| Average | 88.36% | 86.11% | 97.3% |