> ## Documentation Index
> Fetch the complete documentation index at: https://mintlify.com/QwenLM/Qwen3-VL/llms.txt
> Use this file to discover all available pages before exploring further.

# Quick Start

> Get started with Qwen3-VL in minutes with a simple image inference example

Get up and running with Qwen3-VL in just a few steps. This guide will walk you through your first image inference.

## Installation

**1. Install Transformers**

Qwen3-VL requires transformers 4.57.0 or higher:

```bash theme={null}
pip install "transformers>=4.57.0"
```

**2. Install Optional Dependencies**

For optimal performance, install these recommended packages:

```bash theme={null}
pip install accelerate torch torchvision
```

## Your First Inference

Here's a complete example to perform image understanding with Qwen3-VL:

```python theme={null}
from transformers import AutoModelForImageTextToText, AutoProcessor

# Load the model on available devices
model = AutoModelForImageTextToText.from_pretrained(
    "Qwen/Qwen3-VL-8B-Instruct", 
    dtype="auto", 
    device_map="auto"
)

processor = AutoProcessor.from_pretrained("Qwen/Qwen3-VL-8B-Instruct")

# Prepare your message with an image
messages = [
    {
        "role": "user",
        "content": [
            {
                "type": "image",
                "image": "https://qianwen-res.oss-cn-beijing.aliyuncs.com/Qwen-VL/assets/demo.jpeg",
            },
            {"type": "text", "text": "Describe this image."},
        ],
    }
]

# Prepare inputs for inference
inputs = processor.apply_chat_template(
    messages,
    tokenize=True,
    add_generation_prompt=True,
    return_dict=True,
    return_tensors="pt"
)
inputs = inputs.to(model.device)

# Generate the output
generated_ids = model.generate(**inputs, max_new_tokens=128)
generated_ids_trimmed = [
    out_ids[len(in_ids):] for in_ids, out_ids in zip(inputs.input_ids, generated_ids)
]
output_text = processor.batch_decode(
    generated_ids_trimmed, 
    skip_special_tokens=True, 
    clean_up_tokenization_spaces=False
)
print(output_text)
```

> [!NOTE]
>
> We recommend starting with the 8B model for development. For production, see the [Model Variants](https://mintlify.com/QwenLM/Qwen3-VL/concepts/model-variants.md) guide.

## Image Input Formats

Qwen3-VL supports multiple image input formats:

**URL**

```python theme={null}
{
    "type": "image",
    "image": "https://example.com/image.jpg"
}
```

**Local File**

```python theme={null}
{
    "type": "image",
    "image": "file:///path/to/image.jpg"
}
```

**Base64**

```python theme={null}
{
    "type": "image",
    "image": "data:image;base64,/9j/4AAQSkZJRg..."
}
```

## Model Selection

Choose a model size based on your use case:

> **2B / 4B Models**
>
> **Edge deployment** - Run on consumer GPUs or mobile devices

> **8B Model**
>
> **Balanced** - Best for most applications (24GB VRAM)

> **32B Model**
>
> **High performance** - Production use cases (80GB VRAM)

> **235B MoE Model**
>
> **Maximum capability** - Research and specialized tasks (8x80GB)

## Performance Optimization

For better performance, enable Flash Attention 2:

```bash theme={null}
pip install flash-attn --no-build-isolation
```

Then load the model with:

```python theme={null}
import torch
from transformers import AutoModelForImageTextToText

model = AutoModelForImageTextToText.from_pretrained(
    "Qwen/Qwen3-VL-8B-Instruct",
    torch_dtype=torch.bfloat16,
    attn_implementation="flash_attention_2",
    device_map="auto"
)
```

> [!TIP]
>
> Flash Attention 2 is especially beneficial for multi-image and video scenarios, reducing memory usage and improving speed.

## Next Steps

> **[Image Processing](https://mintlify.com/QwenLM/Qwen3-VL/inference/image-processing.md)**
>
> Learn about multi-image inference and resolution control

> **[Video Processing](https://mintlify.com/QwenLM/Qwen3-VL/inference/video-processing.md)**
>
> Process videos with frame sampling

> **[Capabilities](https://mintlify.com/QwenLM/Qwen3-VL/capabilities/omni-recognition.md)**
>
> Explore OCR, grounding, document parsing, and more

> **[Deployment](https://mintlify.com/QwenLM/Qwen3-VL/deployment/overview.md)**
>
> Deploy with vLLM or SGLang for production


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.