Instructions to use Qwen/Qwen3.5-27B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Qwen/Qwen3.5-27B with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="Qwen/Qwen3.5-27B") 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("Qwen/Qwen3.5-27B") model = AutoModelForMultimodalLM.from_pretrained("Qwen/Qwen3.5-27B", 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]:])) - Inference
- HuggingChat
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use Qwen/Qwen3.5-27B with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Qwen/Qwen3.5-27B" # 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-27B", "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-27B
- SGLang
How to use Qwen/Qwen3.5-27B 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-27B" \ --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-27B", "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-27B" \ --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-27B", "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-27B with Docker Model Runner:
docker model run hf.co/Qwen/Qwen3.5-27B
Upload README.md with huggingface_hub
Browse files
README.md
CHANGED
|
@@ -4,7 +4,6 @@ license: apache-2.0
|
|
| 4 |
license_link: https://huggingface.co/Qwen/Qwen3.5-27B/blob/main/LICENSE
|
| 5 |
pipeline_tag: image-text-to-text
|
| 6 |
---
|
| 7 |
-
|
| 8 |
# Qwen3.5-27B
|
| 9 |
|
| 10 |
<img width="400px" src="https://qianwen-res.oss-accelerate.aliyuncs.com/logo_qwen3.5.png">
|
|
@@ -1066,7 +1065,7 @@ messages = [
|
|
| 1066 |
}
|
| 1067 |
]
|
| 1068 |
|
| 1069 |
-
|
| 1070 |
model="Qwen/Qwen3.5-27B",
|
| 1071 |
messages=messages,
|
| 1072 |
max_tokens=81920,
|
|
@@ -1111,7 +1110,7 @@ messages = [
|
|
| 1111 |
#
|
| 1112 |
# By default, `fps=2` and `do_sample_frames=True`.
|
| 1113 |
# With `do_sample_frames=True`, you can customize the `fps` value to set your desired video sampling rate.
|
| 1114 |
-
|
| 1115 |
model="Qwen/Qwen3.5-27B",
|
| 1116 |
messages=messages,
|
| 1117 |
max_tokens=81920,
|
|
@@ -1348,4 +1347,4 @@ If you find our work helpful, feel free to give us a cite.
|
|
| 1348 |
year = {2026},
|
| 1349 |
url = {https://qwen.ai/blog?id=qwen3.5}
|
| 1350 |
}
|
| 1351 |
-
```
|
|
|
|
| 4 |
license_link: https://huggingface.co/Qwen/Qwen3.5-27B/blob/main/LICENSE
|
| 5 |
pipeline_tag: image-text-to-text
|
| 6 |
---
|
|
|
|
| 7 |
# Qwen3.5-27B
|
| 8 |
|
| 9 |
<img width="400px" src="https://qianwen-res.oss-accelerate.aliyuncs.com/logo_qwen3.5.png">
|
|
|
|
| 1065 |
}
|
| 1066 |
]
|
| 1067 |
|
| 1068 |
+
chat_response = client.chat.completions.create(
|
| 1069 |
model="Qwen/Qwen3.5-27B",
|
| 1070 |
messages=messages,
|
| 1071 |
max_tokens=81920,
|
|
|
|
| 1110 |
#
|
| 1111 |
# By default, `fps=2` and `do_sample_frames=True`.
|
| 1112 |
# With `do_sample_frames=True`, you can customize the `fps` value to set your desired video sampling rate.
|
| 1113 |
+
chat_response = client.chat.completions.create(
|
| 1114 |
model="Qwen/Qwen3.5-27B",
|
| 1115 |
messages=messages,
|
| 1116 |
max_tokens=81920,
|
|
|
|
| 1347 |
year = {2026},
|
| 1348 |
url = {https://qwen.ai/blog?id=qwen3.5}
|
| 1349 |
}
|
| 1350 |
+
```
|