Skip to main content

Prerequisites

Before installing Qwen3-VL, ensure you have:

Python

Python 3.8 or higher

CUDA

NVIDIA GPU with CUDA support (recommended)

PyTorch

PyTorch 2.0 or higher

pip

pip package manager

Basic Installation

1

Install Transformers

Qwen3-VL requires transformers version 4.57.0 or higher:
This is the minimum requirement to run Qwen3-VL with Hugging Face Transformers.
2

Install qwen-vl-utils (Optional but Recommended)

For advanced vision processing capabilities:
For faster video loading, install with the decord feature:
3

Verify Installation

Test your installation:

Performance Optimizations

Flash Attention 2

For significantly faster inference, especially with multi-image and video scenarios:
Flash Attention 2 requires:
  • Compatible NVIDIA GPU (Ampere or newer)
  • CUDA 11.6 or higher
  • Models loaded in torch.float16 or torch.bfloat16
Usage example:

Video Processing Backends

Qwen3-VL supports multiple video decoding backends:
Switch backends by setting an environment variable:

Deployment Installation

For production deployment with vLLM or SGLang:
For detailed deployment instructions, see the Deployment Guide.

China Mainland Users

For users in mainland China, we recommend using ModelScope:

Docker Installation

Use our pre-built Docker images for a simplified setup:
The Docker image includes:
  • Pre-configured environment
  • All dependencies
  • CUDA 12.8 support
You only need to install GPU drivers on the host machine.

Installation Verification

Run this complete test to verify your installation:

Troubleshooting

Make sure you’ve installed transformers:
Try these solutions:
  1. Use a smaller model (e.g., 2B or 4B instead of 235B)
  2. Enable quantization with FP8 models
  3. Use device_map="auto" for automatic device placement
  4. Reduce batch size or max_new_tokens
Flash Attention 2 requires:
  • NVIDIA GPU with Ampere architecture or newer
  • CUDA 11.6+
  • Proper build tools
If installation fails, you can skip it and use default attention:
If you encounter video processing issues:
  1. Try a different backend:
  2. Ensure you have the required dependencies:
    • torchcodec: Requires FFmpeg
    • decord: Linux only, may need to build from source
    • torchvision: Requires version >= 0.19.0 for URL support
  3. Use local video files instead of URLs as a workaround

Next Steps

Now that you have Qwen3-VL installed, you can:

Quick Start

Run your first inference with an image

Advanced Usage

Learn about pixel control, batching, and optimization

Deployment

Deploy Qwen3-VL with vLLM or SGLang

Cookbooks

Explore practical examples and use cases