Fine-tune Qwen 3.8 27B
Qwen 3.8 27B is Alibaba’s newest open model of a size most teams can run: dense, under Apache 2.0, reading text, images and video, with 262K tokens of context. Here’s what it is, what the benchmarks show, and how to fine-tune it for text and images, with the code.
The short answer
- It’s a 27B vision-language model. Released on August 14, 2026, it reads text, images and video, with 262,144 tokens of context.
- Fine-tuning takes about 24GB of GPU memory with 4-bit QLoRA, or more than 36GB with 16-bit LoRA.
- Turn thinking off for narrow jobs. It thinks before it answers by default, which costs tokens and time.
- Try a smaller model first. For one job, a fine-tuned 4B or 9B model is often enough, for a fraction of the price per call.
What Qwen 3.8 27B is
| Qwen 3.8 27B | |
|---|---|
| Made by | Alibaba’s Qwen team |
| Released | August 14, 2026 |
| License | Apache 2.0, commercial use allowed |
| Size | 27B dense, plus a vision encoder |
| Reads | Text, images and video |
| Context | 262,144 tokens, about 1M with YaRN scaling |
| Thinking | On by default. Off per request, or effort set to xhigh, medium or low |
| Layers | 64: three Gated DeltaNet layers for every gated attention layer |
Most of its layers use Gated DeltaNet, a form of linear attention, and only one layer in four keeps a KV cache. That’s why long contexts need far less memory than a standard 27B model would. It runs on vLLM, SGLang and Transformers, and quantized builds run in llama.cpp, Ollama and LM Studio.
Benchmarks
Qwen’s model card compares it with the 27B before it:
| Benchmark | Qwen 3.8 27B | Qwen 3.6 27B |
|---|---|---|
| SWE-bench Pro (coding) | 61.7 | 53.5 |
| OSWorld-Verified (computer use) | 84.3 | 63.9 |
| GPQA Diamond (science) | 89.2 | 87.8 |
| OmniDocBench 1.5 (documents) | 91.1 | 89.4 |
| CharXiv RQ (charts) | 83.7 | 78.4 |
| RealWorldQA (photos) | 85.9 | 84.1 |
These are Qwen’s own runs. On Roboflow’s independent Vision Evals in November 2026, it scored 69.5% across five vision tasks, 28th of 69 models: best at object detection, weakest at counting. A benchmark tells you which models to try. Your own examples tell you which one to use.
Vision and context
Qwen 3.8 learned text and images together, and reads documents, charts, screenshots and video. You can fine-tune it on images as well as text: turn on its vision layers and train on conversations that include the images. Each image costs many tokens, so scale large ones down before you train.
Its full context is 262,144 tokens, and about a million with YaRN scaling. Fine-tuning rarely needs it: Unsloth’s recipe trains on 2,048-token examples, and a job like reading a receipt fits in a few thousand tokens with the image.
What fine-tuning it takes
Unsloth’s figures for Qwen 3.8 27B:
| Method | GPU memory |
|---|---|
| QLoRA, 4-bit | About 24GB |
| LoRA, 16-bit | More than 36GB |
| Full fine-tuning | About 4 times LoRA’s |
QLoRA fits a single 24GB card, and Unsloth’s free Kaggle notebooks run it on two T4s. NVIDIA’s NeMo AutoModel has full fine-tuning and LoRA recipes for eight H100s; its LoRA trains rank-8 adapters and leaves the vision tower alone. LoRA vs QLoRA vs full fine-tuning explains the trade-offs.
Fine-tune it with Unsloth
Adapted from Unsloth’s Qwen 3.8 recipe. Use the latest Transformers 5:
from unsloth import FastModel
model, tokenizer = FastModel.from_pretrained(
model_name="unsloth/Qwen3.8-27B-unsloth-bnb-4bit", # 4-bit QLoRA, about 24GB
max_seq_length=2048,
load_in_4bit=True,
full_finetuning=False,
offload_embedding=True, # keeps the input embedding in RAM
)
model = FastModel.get_peft_model(
model,
finetune_vision_layers=False, # True to learn from images too
finetune_language_layers=True,
finetune_attention_modules=True,
finetune_mlp_modules=True,
r=16,
lora_alpha=16,
lora_dropout=0,
bias="none",
use_gradient_checkpointing="unsloth",
random_state=3407,
)
# Train with TRL's SFTTrainer on chats rendered with Qwen's chat template, then keep:
model.save_pretrained("qwen3.8-27b-lora") # the LoRA adapter
tokenizer.save_pretrained("qwen3.8-27b-lora")
model.save_pretrained_merged("qwen3.8-27b-merged", tokenizer, save_method="merged_16bit") # for vLLM- Render your data with Qwen’s chat template, and serve with the same template and end token you trained with.
- Expect a slow first run while the Gated DeltaNet kernels compile.
- Out of memory? Shorten the sequence length and keep the batch size at 1.
- Hold back about a fifth of your examples and compare the fine-tuned model with the one it would replace on those, before you switch.
Thinking on or off
Qwen 3.8 thinks before it answers unless you turn it off. For a narrow job, such as pulling fields from a document or choosing a label, train on direct answers and serve with thinking off: pass "enable_thinking": false in chat_template_kwargs with each request. To keep its reasoning, Unsloth suggests that at least 75% of your training examples show it.
Is 27B the right size?
For one narrow job, often not. A small model trained on a job usually matches a large general one at that job, and costs less on every call. On Sous, Qwen 3.8 27B costs $0.40 per million input tokens and $3.20 per million output tokens, against $0.10 and $0.80 for Qwen3.5 4B, and takes about three times the GPU time of Qwen3.5 9B to train and to answer.
Reach for the 27B when smaller models can’t match: harder reasoning, long documents, or images with dense text. Best small open models to fine-tune compares the options.
Or let Sous train it
Sous trains Qwen 3.8 27B on your app’s calls or on examples you upload, text and images, beside smaller models. It holds back about 20% to test each one on examples it never saw, and recommends the one that matches for the least. It trains on examples up to 16,384 tokens with up to 16 images each, scaled to at most 768×768 pixels, and serves calls up to 32,768 tokens through an OpenAI-compatible API. You can download the LoRA adapter and run it anywhere.
Questions people ask
Is Qwen 3.8 27B open source?
Its weights are open under Apache 2.0, which allows commercial use, and you can download them from Hugging Face and ModelScope.
What is Qwen 3.8 27B’s max context?
262,144 tokens natively, and about 1 million with YaRN scaling. Hosts often set a lower limit: Sous serves it with 32,768 tokens.
Can Qwen 3.8 27B read images?
Yes. It’s a vision-language model that reads images and video along with text, from documents and charts to long videos. Fine-tuning can include the images, or train only on text and leave its vision as it is.
How much GPU memory does fine-tuning Qwen 3.8 27B take?
About 24GB with 4-bit QLoRA, and more than 36GB with 16-bit LoRA, according to Unsloth. Full fine-tuning takes about four times LoRA’s memory.
Is there a Qwen 3.8 9B?
Not from Alibaba. Models named Qwen3.8-9B on Hugging Face come from the community: Qwen3.5 9B fine-tuned on reasoning from a larger Qwen 3.8 model.
How do I turn off thinking in Qwen 3.8?
Pass "enable_thinking": false in chat_template_kwargs with the request, on vLLM or SGLang. To keep thinking but spend less on it, set reasoning_effort to medium or low.
Can I fine-tune Qwen 3.8 27B for free?
Unsloth publishes Kaggle notebooks that fine-tune it with QLoRA on two free T4 GPUs, which Kaggle gives about 30 hours of use.