Qwen 3#

The third generation of Alibaba’s Tongyi Qwen models (released April 2025). It supports a hybrid thinking mode and spans parameter sizes from 0.6B to 235B.


Model Specs#

ModelParametersTypeNotes
Qwen3-235B-A22B235B (22B active)MoEFlagship model
Qwen3-32B32BDenseBalances performance and cost
Qwen3-14B14BDenseMid-size
Qwen3-8B8BDenseLightweight and efficient
Qwen3-4B4BDenseOn-device deployment
Qwen3-1.7B1.7BDenseUltra-lightweight
Qwen3-0.6B0.6BDenseMinimal use cases

Key Features#

Hybrid Thinking Mode#

  • Thinking mode: reasons deeply before answering (similar to o1), suited to complex problems
  • Non-thinking mode: fast responses, suited to simple conversations
  • Switch with /think or /no_think

MoE Architecture (235B)#

  • 235B total parameters, only 22B active per inference
  • Inference cost close to a 22B Dense model
  • Quality close to much larger models

Quick Start#

Transformers#

from transformers import AutoModelForCausalLM, AutoTokenizer

model_name = "Qwen/Qwen3-8B"
tokenizer = AutoTokenizer.from_pretrained(model_name)
model = AutoModelForCausalLM.from_pretrained(model_name, device_map="auto")

messages = [{"role": "user", "content": "What is quantum computing?"}]
text = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
inputs = tokenizer(text, return_tensors="pt").to(model.device)

outputs = model.generate(**inputs, max_new_tokens=512)
print(tokenizer.decode(outputs[0], skip_special_tokens=True))

vLLM Deployment#

vllm serve Qwen/Qwen3-8B --max-model-len 8192

Ollama#

ollama run qwen3:8b