Image-Text-to-Text
Transformers
Safetensors
qwen3_vl
robotics
edge-deployment
anima
forge
int4
nf4
quantized
qwen3
vision-language
multimodal
text-generation
instruction-following
ros2
jetson
real-time
conversational
Eval Results (legacy)
4-bit precision
bitsandbytes
Instructions to use robotflowlabs/qwen3-vl-4b-instruct-int4 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use robotflowlabs/qwen3-vl-4b-instruct-int4 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="robotflowlabs/qwen3-vl-4b-instruct-int4") 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("robotflowlabs/qwen3-vl-4b-instruct-int4") model = AutoModelForImageTextToText.from_pretrained("robotflowlabs/qwen3-vl-4b-instruct-int4") 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
- vLLM
How to use robotflowlabs/qwen3-vl-4b-instruct-int4 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "robotflowlabs/qwen3-vl-4b-instruct-int4" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "robotflowlabs/qwen3-vl-4b-instruct-int4", "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/robotflowlabs/qwen3-vl-4b-instruct-int4
- SGLang
How to use robotflowlabs/qwen3-vl-4b-instruct-int4 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 "robotflowlabs/qwen3-vl-4b-instruct-int4" \ --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": "robotflowlabs/qwen3-vl-4b-instruct-int4", "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 "robotflowlabs/qwen3-vl-4b-instruct-int4" \ --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": "robotflowlabs/qwen3-vl-4b-instruct-int4", "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 robotflowlabs/qwen3-vl-4b-instruct-int4 with Docker Model Runner:
docker model run hf.co/robotflowlabs/qwen3-vl-4b-instruct-int4
| license: apache-2.0 | |
| base_model: Qwen/Qwen3-VL-4B-Instruct | |
| tags: | |
| - robotics | |
| - edge-deployment | |
| - anima | |
| - forge | |
| - int4 | |
| - nf4 | |
| - quantized | |
| - qwen3 | |
| - vision-language | |
| - multimodal | |
| - text-generation | |
| - image-text-to-text | |
| - instruction-following | |
| - ros2 | |
| - jetson | |
| - real-time | |
| library_name: transformers | |
| pipeline_tag: image-text-to-text | |
| model-index: | |
| - name: qwen3-vl-4b-instruct-int4 | |
| results: | |
| - task: | |
| type: image-text-to-text | |
| metrics: | |
| - name: Model Size (MB) | |
| type: model_size | |
| value: 2741 | |
| - name: Compression Ratio | |
| type: compression | |
| value: 3.1 | |
| - name: Original Size (MB) | |
| type: original_size | |
| value: 8465 | |
| # Qwen3-VL-4B-Instruct β INT4 NF4 Quantized | |
| > Alibaba's latest Qwen3-VL-4B-Instruct quantized to 4-bit NF4 with double quantization for high-quality robotic visual reasoning. **3.1x smaller** β from 8.5 GB to 2.7 GB β delivering stronger visual understanding than the 2B variant while still fitting on edge GPUs. | |
| This model is part of the **[RobotFlowLabs](https://huggingface.co/robotflowlabs)** model library, built for the **ANIMA** agentic robotics platform β a modular ROS2-native AI system that brings foundation model intelligence to real robots operating in the real world. | |
| ## Why This Model Exists | |
| When robotic tasks demand higher visual reasoning quality β complex scene descriptions, multi-step visual planning, or precise spatial grounding β the 4B variant provides a significant accuracy boost over the 2B. Qwen3-VL-4B features a deeper language model (36 layers vs 28) with wider hidden dimensions (2560 vs 2048), delivering better performance on visual grounding, counting, and reasoning benchmarks. At 2.7 GB quantized, it fits on an L4 24GB alongside a vision encoder and action model. | |
| ## Model Details | |
| | Property | Value | | |
| |----------|-------| | |
| | **Architecture** | Qwen3-VL (vision encoder + language decoder) | | |
| | **Total Parameters** | 4B | | |
| | **Text Hidden Dimension** | 2560 | | |
| | **Text Layers** | 36 | | |
| | **Text Attention Heads** | 32 (8 KV heads, GQA) | | |
| | **Text MLP Dimension** | 9728 (SiLU activation) | | |
| | **Vision Encoder** | 24-layer ViT (1024d, 16 heads, patch 16) | | |
| | **Vision Features** | DeepStack at layers [5, 11, 17] | | |
| | **Spatial Merge** | 2Γ2 (4 patches β 1 token) | | |
| | **Temporal Patch** | 2 frames per token | | |
| | **Context Length** | 262,144 tokens | | |
| | **Vocabulary** | 151,936 tokens | | |
| | **RoPE** | M-RoPE (interleaved, ΞΈ = 5,000,000) | | |
| | **Quantization** | NF4 double quantization (bitsandbytes) | | |
| | **Original Model** | [`Qwen/Qwen3-VL-4B-Instruct`](https://huggingface.co/Qwen/Qwen3-VL-4B-Instruct) | | |
| | **License** | Apache-2.0 | | |
| ## Compression Results | |
| Quantized on an NVIDIA L4 24GB GPU using bitsandbytes NF4 with double quantization. | |
| | Metric | Original | INT4 Quantized | Change | | |
| |--------|----------|----------------|--------| | |
| | **Total Size** | 8,465 MB | 2,741 MB | **3.1x smaller** | | |
| | **Quantization** | BF16 | NF4 + double quant | 4-bit weights | | |
| | **Compute Dtype** | BF16 | BF16 | Preserved at inference | | |
| | **Format** | SafeTensors | SafeTensors | Direct HF loading | | |
| ## Quick Start | |
| ```python | |
| from transformers import AutoModelForImageTextToText, AutoProcessor | |
| from PIL import Image | |
| model = AutoModelForImageTextToText.from_pretrained( | |
| "robotflowlabs/qwen3-vl-4b-instruct-int4", | |
| device_map="auto", | |
| ) | |
| processor = AutoProcessor.from_pretrained("robotflowlabs/qwen3-vl-4b-instruct-int4") | |
| image = Image.open("workspace.jpg") | |
| messages = [ | |
| {"role": "system", "content": "You are a robotic vision assistant specialized in manipulation tasks."}, | |
| {"role": "user", "content": [ | |
| {"type": "image", "image": image}, | |
| {"type": "text", "text": "List all graspable objects, their approximate positions, and suggest a pick order."} | |
| ]} | |
| ] | |
| text = processor.apply_chat_template(messages, tokenize=False, add_generation_prompt=True) | |
| inputs = processor(text=text, images=[image], return_tensors="pt").to("cuda") | |
| outputs = model.generate(**inputs, max_new_tokens=512) | |
| print(processor.decode(outputs[0], skip_special_tokens=True)) | |
| ``` | |
| ### With FORGE (ANIMA Integration) | |
| ```python | |
| from forge.vlm import VLMRegistry | |
| vlm = VLMRegistry.load("qwen3-vl-4b-instruct-int4") | |
| plan = vlm.describe(image, "List all graspable objects and suggest a manipulation sequence.") | |
| ``` | |
| ## Use Cases in ANIMA | |
| Qwen3-VL-4B serves as the **high-quality visual reasoning engine** in ANIMA: | |
| - **Complex Scene Analysis** β Detailed spatial reasoning about cluttered workspaces | |
| - **Visual Task Planning** β Multi-step manipulation plans from scene observation | |
| - **Precise Grounding** β Fine-grained object localization and counting | |
| - **Structured Output** β JSON scene graphs, object inventories, spatial relationship maps | |
| - **Video Reasoning** β Temporal understanding of task progress from camera feeds | |
| - **Safety Assessment** β Visual evaluation of workspace hazards before execution | |
| ## Qwen3-VL Family on RobotFlowLabs | |
| | Model | Params | Quantized Size | Best For | | |
| |-------|--------|----------------|----------| | |
| | [qwen3-vl-2b-instruct-int4](https://huggingface.co/robotflowlabs/qwen3-vl-2b-instruct-int4) | 2B | 1.5 GB | Edge deployment, real-time | | |
| | **[qwen3-vl-4b-instruct-int4](https://huggingface.co/robotflowlabs/qwen3-vl-4b-instruct-int4)** | **4B** | **2.7 GB** | **Higher accuracy visual reasoning** | | |
| ## About ANIMA | |
| **ANIMA** is a modular, ROS2-native agentic robotics platform developed by [RobotFlowLabs](https://huggingface.co/robotflowlabs). It combines 58 specialized AI modules into a unified system for real-world robotic autonomy. | |
| ### Other Collections | |
| - **[ANIMA Vision](https://huggingface.co/collections/robotflowlabs/anima-vision-69bc77ca7ce15b06bbdd21bd)** β SAM2, DINOv2, CLIP, SigLIP, Depth Anything | |
| - **[ANIMA Language](https://huggingface.co/collections/robotflowlabs/anima-language-69bc77ca29dccc3f68f8c7fd)** β Qwen2.5, SmolLM2 | |
| - **[ANIMA VLM](https://huggingface.co/collections/robotflowlabs/anima-vlm-69bc77ca53ae84ac21b0f012)** β Qwen3-VL, Qwen2.5-VL | |
| - **[ANIMA VLA](https://huggingface.co/collections/robotflowlabs/anima-vla-69bc77cbf1b8aa40002920bb)** β SmolVLA, RDT2-FM, FORGE students | |
| ## Intended Use | |
| ### Designed For | |
| - High-accuracy visual scene understanding for robotic manipulation | |
| - Complex visual task planning requiring spatial reasoning | |
| - Precise object grounding and counting in cluttered environments | |
| - Multi-turn visual dialogue with detailed scene descriptions | |
| ### Limitations | |
| - INT4 quantization may slightly reduce fine-grained visual grounding precision | |
| - 262K context window is generous but may not cover extremely long video sequences | |
| - Requires GPU (bitsandbytes NF4 does not run on CPU) | |
| - Inherits biases from Qwen3-VL training data | |
| ### Out of Scope | |
| - Safety-critical autonomous decision making without human oversight | |
| - Medical image analysis | |
| - Surveillance applications | |
| ## Technical Details | |
| ### Compression Pipeline | |
| ``` | |
| Original Qwen3-VL-4B-Instruct (BF16, 8.5 GB) | |
| β | |
| βββ bitsandbytes NF4 double quantization | |
| βββ bnb_4bit_quant_type: nf4 | |
| βββ bnb_4bit_use_double_quant: true | |
| βββ bnb_4bit_compute_dtype: bfloat16 | |
| βββ model.safetensors (2.7 GB) | |
| ``` | |
| - **Quantization**: NF4 (Normal Float 4-bit) with double quantization via bitsandbytes | |
| - **Compute**: BF16 at inference β weights dequantized on-the-fly | |
| - **Hardware**: NVIDIA L4 24GB, CUDA 13.0, PyTorch 2.10, Python 3.14 | |
| ## Attribution | |
| - **Original Model**: [`Qwen/Qwen3-VL-4B-Instruct`](https://huggingface.co/Qwen/Qwen3-VL-4B-Instruct) by Alibaba Cloud | |
| - **License**: [Apache-2.0](https://www.apache.org/licenses/LICENSE-2.0) | |
| - **Compressed by**: [RobotFlowLabs](https://huggingface.co/robotflowlabs) using [FORGE](https://github.com/robotflowlabs/forge) | |
| ## Citation | |
| ```bibtex | |
| @article{qwen3vl, | |
| title={Qwen3-VL Technical Report}, | |
| author={Qwen Team}, | |
| year={2025} | |
| } | |
| ``` | |
| --- | |
| <p align="center"> | |
| <b>Built with FORGE by <a href="https://huggingface.co/robotflowlabs">RobotFlowLabs</a></b><br> | |
| Optimizing foundation models for real robots. | |
| </p> | |