Instructions to use aaniri/OPD-V-Qwen3-VL-4B-Instruct with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use aaniri/OPD-V-Qwen3-VL-4B-Instruct with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="aaniri/OPD-V-Qwen3-VL-4B-Instruct") 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("aaniri/OPD-V-Qwen3-VL-4B-Instruct") model = AutoModelForMultimodalLM.from_pretrained("aaniri/OPD-V-Qwen3-VL-4B-Instruct", 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 aaniri/OPD-V-Qwen3-VL-4B-Instruct with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "aaniri/OPD-V-Qwen3-VL-4B-Instruct" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "aaniri/OPD-V-Qwen3-VL-4B-Instruct", "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/aaniri/OPD-V-Qwen3-VL-4B-Instruct
- SGLang
How to use aaniri/OPD-V-Qwen3-VL-4B-Instruct 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 "aaniri/OPD-V-Qwen3-VL-4B-Instruct" \ --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": "aaniri/OPD-V-Qwen3-VL-4B-Instruct", "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 "aaniri/OPD-V-Qwen3-VL-4B-Instruct" \ --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": "aaniri/OPD-V-Qwen3-VL-4B-Instruct", "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 aaniri/OPD-V-Qwen3-VL-4B-Instruct with Docker Model Runner:
docker model run hf.co/aaniri/OPD-V-Qwen3-VL-4B-Instruct
OPD-V
This model checkpoint is part of OPD-V, presented in the paper OPD-V: Self-Distillation Improves Visual Detail Perception in Vision-Language Models.
Code & Repository: GitHub - OPD-V
Base Model: Qwen/Qwen3-VL-4B-Instruct
Paper: OPD-V: Self-Distillation Improves Visual Detail Perception in Vision-Language Models
Overview
OPD-V is a visual On-Policy Self-Distillation (OPSD) framework for improving multimodal reasoning under Modality Imbalance. Instead of relying on a single privileged teacher, OPD-V contrasts a Positive Teacher conditioned on a Zoom-In Image with a Negative Teacher conditioned on a Mask Image, and distills only the on-policy tokens selected by the resulting Modality-Balance Trust Region.
This checkpoint corresponds to OPD-V-Qwen3-VL-4B-Instruct trained with teacher-box positive images and random-mask negative images.
Citation
@misc{opdv2026,
title={OPD-V: Self-Distillation Improves Visual Detail Perception in Vision-Language Models},
author={},
year={2026},
eprint={2608.05131},
archivePrefix={arXiv},
primaryClass={cs.CV}
}
- Downloads last month
- 6
Model tree for aaniri/OPD-V-Qwen3-VL-4B-Instruct
Base model
Qwen/Qwen3-VL-4B-Instruct
docker model run hf.co/aaniri/OPD-V-Qwen3-VL-4B-Instruct