Instructions to use Qwen/Qwen3.8-27B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Qwen/Qwen3.8-27B with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="Qwen/Qwen3.8-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)# pip install -U transformers accelerate # Load model directly from transformers import AutoProcessor, AutoModelForMultimodalLM processor = AutoProcessor.from_pretrained("Qwen/Qwen3.8-27B") model = AutoModelForMultimodalLM.from_pretrained("Qwen/Qwen3.8-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=256) 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.8-27B with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Qwen/Qwen3.8-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.8-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.8-27B
- SGLang
How to use Qwen/Qwen3.8-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.8-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.8-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.8-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.8-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.8-27B with Docker Model Runner:
docker model run hf.co/Qwen/Qwen3.8-27B
๐ ROCM release v10.0 provided significant performance bonus
#186
by puchuu - opened
Hello everyone.
I've just updated the Docker build script and tested the unsloth Qwen 3.8 27b Q8_0 with recent ROCM v10.0.
My dual 9060 XT 16GB setup received about +7-10 t/s output generation speed!
So I am recommending everyone to update to the recent ROCM v10.0 release.
Sharing with you the performance results:
0.18.662.485 I slot print_timing: id 0 | task 0 | prompt processing, n_tokens = 2560, progress = 0.13, t = 3.05 s / 838.13 tokens per second
0.19.348.985 I slot print_timing: id 0 | task 0 | prompt processing, n_tokens = 3072, progress = 0.16, t = 3.74 s / 822.39 tokens per second
...
0.46.940.087 I slot print_timing: id 0 | task 0 | prompt processing, n_tokens = 19255, progress = 1.00, t = 31.29 s / 615.31 tokens per second
0.47.503.304 I slot print_timing: id 0 | task 0 | prompt processing, n_tokens = 19330, progress = 1.00, t = 32.03 s / 603.48 tokens per second
0.51.171.665 I slot print_timing: id 0 | task 0 | n_gen = 125, tg = 40.19 t/s, tg_3s = 40.52 t/s
0.54.188.662 I slot print_timing: id 0 | task 0 | n_gen = 283, tg = 46.21 t/s, tg_3s = 52.37 t/s
...
3.05.573.562 I slot print_timing: id 0 | task 0 | n_gen = 5775, tg = 42.00 t/s, tg_3s = 34.20 t/s
3.08.656.695 I slot print_timing: id 0 | task 0 | n_gen = 5902, tg = 41.98 t/s, tg_3s = 41.19 t/s
Previously on ROCM v7.14 I had about 35 t/s avg and up to 45 t/s output. Now I have 42 t/s avg and up to 55 t/s output.
The most important llama options are:
--spec-type "draft-mtp"
--spec-draft-n-max "4"
--split-mode "tensor"
--fit "off"
--n-gpu-layers "all"
--reasoning-effort "medium"