Instructions to use Qwen/Qwen3.5-2B-Base with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Qwen/Qwen3.5-2B-Base with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="Qwen/Qwen3.5-2B-Base") 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("Qwen/Qwen3.5-2B-Base") model = AutoModelForImageTextToText.from_pretrained("Qwen/Qwen3.5-2B-Base") 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 Qwen/Qwen3.5-2B-Base with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Qwen/Qwen3.5-2B-Base" # 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.5-2B-Base", "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.5-2B-Base
- SGLang
How to use Qwen/Qwen3.5-2B-Base 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.5-2B-Base" \ --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.5-2B-Base", "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.5-2B-Base" \ --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.5-2B-Base", "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.5-2B-Base with Docker Model Runner:
docker model run hf.co/Qwen/Qwen3.5-2B-Base
| library_name: transformers | |
| license: apache-2.0 | |
| license_link: https://huggingface.co/Qwen/Qwen3.5-2B-Base/blob/main/LICENSE | |
| pipeline_tag: image-text-to-text | |
| # Qwen3.5-2B-Base | |
| <img width="400px" src="https://qianwen-res.oss-accelerate.aliyuncs.com/logo_qwen3.5.png"> | |
| [](https://chat.qwen.ai) | |
| > [!Note] | |
| > This repository contains model weights and configuration files for the pre-trained only model in the Hugging Face Transformers format. | |
| > | |
| > These artifacts are compatible with Hugging Face Transformers, vLLM, SGLang, etc. | |
| > | |
| > The intended use cases are fine-tuning, in-context learning experiments, and other research or development purposes, not direct interaction. | |
| > However, the control tokens, e.g., `<|im_start|>` and `<|im_end|>` were trained to allow efficient LoRA-style PEFT with the official chat template, mitigating the need to finetune embeddings, a significant optimization given Qwen3.5's larger vocabulary. | |
| Over recent months, we have intensified our focus on developing foundation models that deliver exceptional utility and performance. Qwen3.5 represents a significant leap forward, integrating breakthroughs in multimodal learning, architectural efficiency, reinforcement learning scale, and global accessibility to empower developers and enterprises with unprecedented capability and efficiency. | |
| ## Qwen3.5 Highlights | |
| Qwen3.5 features the following enhancement: | |
| - **Unified Vision-Language Foundation**: Early fusion training on multimodal tokens achieves cross-generational parity with Qwen3 and outperforms Qwen3-VL models across reasoning, coding, agents, and visual understanding benchmarks. | |
| - **Efficient Hybrid Architecture**: Gated Delta Networks combined with sparse Mixture-of-Experts deliver high-throughput inference with minimal latency and cost overhead. | |
| - **Scalable RL Generalization**: Reinforcement learning scaled across million-agent environments with progressively complex task distributions for robust real-world adaptability. | |
| - **Global Linguistic Coverage**: Expanded support to 201 languages and dialects, enabling inclusive, worldwide deployment with nuanced cultural and regional understanding. | |
| - **Next-Generation Training Infrastructure**: Near-100% multimodal training efficiency compared to text-only training and asynchronous RL frameworks supporting massive-scale agent scaffolds and environment orchestration. | |
| For more details, please refer to our blog post [Qwen3.5](https://qwen.ai/blog?id=qwen3.5). | |
| ## Model Overview | |
| - Type: Causal Language Model with Vision Encoder | |
| - Training Stage: Pre-training & Post-training | |
| - Language Model | |
| - Number of Parameters: 2B | |
| - Hidden Dimension: 2048 | |
| - Token Embedding: 248320 (Padded) | |
| - Number of Layers: 24 | |
| - Hidden Layout: 6 × (3 × (Gated DeltaNet → FFN) → 1 × (Gated Attention → FFN)) | |
| - Gated DeltaNet: | |
| - Number of Linear Attention Heads: 16 for V and 16 for QK | |
| - Head Dimension: 128 | |
| - Gated Attention: | |
| - Number of Attention Heads: 8 for Q and 2 for KV | |
| - Head Dimension: 256 | |
| - Rotary Position Embedding Dimension: 64 | |
| - Feed Forward Network: | |
| - Intermediate Dimension: 6144 | |
| - LM Output: 248320 (Tied to token embedding) | |
| - MTP: trained with multi-steps | |
| - Context Length: 262,144 natively and extensible up to 1,010,000 tokens. | |
| ### Citation | |
| If you find our work helpful, feel free to give us a cite. | |
| ```bibtex | |
| @misc{qwen3.5, | |
| title = {{Qwen3.5}: Towards Native Multimodal Agents}, | |
| author = {{Qwen Team}}, | |
| month = {February}, | |
| year = {2026}, | |
| url = {https://qwen.ai/blog?id=qwen3.5} | |
| } | |
| ``` | |