Instructions to use sanskar003/Qwen3.5-4B-NVFP4 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use sanskar003/Qwen3.5-4B-NVFP4 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="sanskar003/Qwen3.5-4B-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, AutoModelForMultimodalLM processor = AutoProcessor.from_pretrained("sanskar003/Qwen3.5-4B-NVFP4") model = AutoModelForMultimodalLM.from_pretrained("sanskar003/Qwen3.5-4B-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]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use sanskar003/Qwen3.5-4B-NVFP4 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "sanskar003/Qwen3.5-4B-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": "sanskar003/Qwen3.5-4B-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/sanskar003/Qwen3.5-4B-NVFP4
- SGLang
How to use sanskar003/Qwen3.5-4B-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 "sanskar003/Qwen3.5-4B-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": "sanskar003/Qwen3.5-4B-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 "sanskar003/Qwen3.5-4B-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": "sanskar003/Qwen3.5-4B-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 sanskar003/Qwen3.5-4B-NVFP4 with Docker Model Runner:
docker model run hf.co/sanskar003/Qwen3.5-4B-NVFP4
Qwen3.5-4B-NVFP4
This is an NVFP4 (4-bit floating point) quantized version of
Qwen/Qwen3.5-4B, packaged in the
compressed-tensors format for efficient inference with
vLLM.
NVFP4 is a Blackwell-native FP4 format and is designed to run on the FP4 tensor cores of NVIDIA Blackwell GPUs (e.g. RTX 5090, sm_120) for high throughput, while preserving the base model's vision-language capabilities.
About the base model
Qwen3.5-4B is a compact multimodal vision-language model from the Qwen team (Alibaba Group). It accepts interleaved image + text (and video) input and generates text, with a "thinking" reasoning mode enabled by default.
| Base model | Qwen/Qwen3.5-4B |
| Parameters | ~4B |
| Modality | Image-Text-to-Text (vision-language) |
| Architecture | Hybrid Gated DeltaNet + sparse MoE, with a vision encoder |
| Context length | 262,144 tokens native (extensible with RoPE scaling) |
| Languages | 201 languages and dialects |
| License | Apache 2.0 |
For full details on capabilities, benchmarks, and prompt formatting, see the base model card.
Quantization details
| Method | NVFP4 (4-bit floating point) |
| Format | compressed-tensors |
| Quantized modules | Linear layers of the language model |
| Kept in higher precision | Vision tower, router gates, and lm_head |
| Recommended hardware | NVIDIA Blackwell (FP4 tensor cores, sm_120) |
The vision tower is intentionally left unquantized to preserve image understanding quality.
Usage
Serve with vLLM (OpenAI-compatible API)
docker run --rm --gpus all -p 8000:8000 \
-v "$PWD:/models" \
vllm/vllm-openai:latest \
--model /models/Qwen3.5-4B-NVFP4 \
--served-model-name Qwen3.5-4B-NVFP4 \
--quantization compressed-tensors \
--max-model-len 32768
Or directly from the Hub:
docker run --rm --gpus all -p 8000:8000 \
vllm/vllm-openai:latest \
--model sanskar003/Qwen3.5-4B-NVFP4 \
--quantization compressed-tensors
Query it (image + text)
curl -s http://localhost:8000/v1/chat/completions \
-H 'Content-Type: application/json' -d '{
"model": "Qwen3.5-4B-NVFP4",
"messages": [{"role": "user", "content": [
{"type": "text", "text": "Describe this image."},
{"type": "image_url", "image_url": {"url": "http://images.cocodataset.org/train2017/000000231895.jpg"}}
]}]
}'
Requirements
- An NVIDIA Blackwell GPU with FP4 tensor cores (sm_120) for the intended
performance. vLLM selects the FP4 kernel automatically for this
compressed-tensorscheckpoint. - A recent vLLM build that supports the
Qwen3_5ForConditionalGenerationarchitecture.
License
Released under Apache 2.0, inherited from the base model Qwen/Qwen3.5-4B. Please review and comply with the base model's license terms.
Citation
Please cite the original Qwen work — see the base model card for citation details.
- Downloads last month
- 53