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)# 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=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.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
This model cannot stop thinking
Qwen3.8 is actually smart af but holy shit it thinks WAY too much 😭 every tiny task turns into a full investigation for no reason. I ask it to change one simple thing and bro starts analyzing 10 different possibilities before doing it.
Qwen3.8 is actually smart af but holy shit it thinks WAY too much 😭 every tiny task turns into a full investigation for no reason. I ask it to change one simple thing and bro starts analyzing 10 different possibilities before doing it.
You are not imagining it, and there is a specific reason for it.
Qwen3.8's chat template has three reasoning levels: low, medium, and xhigh. The default is xhigh, which is the highest one. So out of the box you are getting maximum reasoning on every request, including "rename this variable."
You can just turn it down. I measured all of it on an RTX 5090 (Q4_K_M, same prompt each time):
| level | thinking tokens | wait before you see an answer |
|---|---|---|
xhigh (default) |
106 | 1.44 s |
medium |
91 | 0.92 s |
low |
78 | 1.21 s |
| off | 0 | 0.21 s |
medium cuts the wait by about a third and I could not measure any quality drop. Turning thinking off completely takes time-to-answer from 2.18 s to 0.21 s, which is roughly 10x less waiting.
Per request:
{
"messages": [...],
"chat_template_kwargs": {"reasoning_effort": "medium"}
}
Turn it off entirely for simple edits:
{"chat_template_kwargs": {"enable_thinking": false}}
Or set it server-wide in llama.cpp with --reasoning-effort medium.
Two things that will save you time:
Only those three level names work. llama.cpp also accepts minimal, high and max, but this model's template throws an error on them. The server starts fine and then fails on every request, which is confusing the first time you hit it.
If you are on Ollama, none of this works. Ollama replaces the model's own template with a generic one, and the reasoning-effort setting lives in the template it throws away. So you cannot turn the thinking down through Ollama at all. You need llama-server with --jinja for it.
Side benefit: less thinking is also faster per token. Turning it off took me from 73.4 to 151.2 tok/s, because short direct answers are easier for the draft head to predict than long reasoning.
Full numbers here if useful: https://kgptalkie.com/tutorials/generative-ai/qwen-3-8-27b-llama-cpp-speed-settings
Use atomic chat project for run the models https://atomic.chat/ the very good project for agents and chat and turboQuant for economic vram atomic is ease to control and simples ...i use for run 27Q4 and Q2 on 2x 3060 12VRAM 32GB RAM ,suport MLX and MTP, better LLM STUDIO OLLAMA ....anda run atomic llama server and llama serve and OLLAMA or api....https://huggingface.co/AtomicChat/Qwen3.8-27B-GGUF,https://github.com/AtomicBot-ai/atomic-llama-cpp-turboquant,https://github.com/AtomicBot-ai/atomic-agent ...You can also run it as an API output.
I created a small proxy in front of vLLM to force the "Medium" kwarg for all incoming connections. This has sped up the model by about 300% and actually improved its output quality rather than reduced it. on "Medium" it no longer does stuff I didn't ask for, and no longer gets stuck in thinking loops.
Try this in the chat template...
"Reasoning effort is set to xhigh. Please think carefully but BRIEF, validate key assumptions but KEEP IT BRIEF, and MOVE QUICKLY to the conclusion without unnecessary elaboration."
It literally works to cut the reasoning tokens down without quality loss. Try it out! This model responds to being yelled at with caps.
It looks like {"enable_thinking": false} is not supported anymore in 3.8 (it was in 3.6)
Or, I'm not able to make it work... someone can confirm that it still works?