Instructions to use Qwen/Qwen3-VL-8B-Instruct with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Qwen/Qwen3-VL-8B-Instruct with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="Qwen/Qwen3-VL-8B-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)# pip install -U transformers accelerate # Load model directly from transformers import AutoProcessor, AutoModelForMultimodalLM processor = AutoProcessor.from_pretrained("Qwen/Qwen3-VL-8B-Instruct") model = AutoModelForMultimodalLM.from_pretrained("Qwen/Qwen3-VL-8B-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=256) print(processor.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Inference
- Notebooks
- Google Colab
- Kaggle
- AMD Developer Cloud
- Local Apps Settings
- vLLM
How to use Qwen/Qwen3-VL-8B-Instruct with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Qwen/Qwen3-VL-8B-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": "Qwen/Qwen3-VL-8B-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/Qwen/Qwen3-VL-8B-Instruct
- SGLang
How to use Qwen/Qwen3-VL-8B-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 "Qwen/Qwen3-VL-8B-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": "Qwen/Qwen3-VL-8B-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 "Qwen/Qwen3-VL-8B-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": "Qwen/Qwen3-VL-8B-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 Qwen/Qwen3-VL-8B-Instruct with Docker Model Runner:
docker model run hf.co/Qwen/Qwen3-VL-8B-Instruct
Commit History
-
Adding `transformers` as the library name (#4)
Verified signature- Adding `transformers` as the library name (60595ebc30ec8e3b1d3b9e65d4943ca011c0006a) Co-authored-by: Aritra Roy Gosthipaty <ariG23498@users.noreply.huggingface.co>0c351dd -
Fix: move inputs to model device in inference example to avoid "same device" error (#3)
Verified signature- Fix: move inputs to model device in inference example to avoid "same device" error (111a23f9284af5056a970f40d890a8e433b41e84) Co-authored-by: Lim Seong Geun <lim4349@users.noreply.huggingface.co>b7e6648 -
Update README.md (#2)
Verified signature- Update README.md (6aada553e11cf85e6d834e0919880d65b341b58d) Co-authored-by: Lim Seong Geun <lim4349@users.noreply.huggingface.co>e0a319f -
Update readme to fix processor = AutoProcessor.from_pretrained("Qwen/Qwen/Qwen3-VL-8B-Instruct") to processor = AutoProcessor.from_pretrained("Qwen/Qwen3-VL-8B-Instruct") (#1)
Verified signature- Update readme to fix processor = AutoProcessor.from_pretrained("Qwen/Qwen/Qwen3-VL-8B-Instruct") to processor = AutoProcessor.from_pretrained("Qwen/Qwen3-VL-8B-Instruct") (804bd66084a40da83372e474f5bd91dba07a3715) Co-authored-by: Joseph Gitau <josephgitau@users.noreply.huggingface.co>1447b2a -
Update README.md
Verified signature1dd1e02
-
Update README.md
Verified signaturecadac78
-
Update README.md
Verified signature434824e
-
Upload folder using huggingface_hub
Verified signaturefe33404 -
initial commit
Verified signaturee766c28