Qwen3 Local Deployment Guide
Qwen3 is one of the most well-balanced Chinese open-source models overall, but it comes in many versions, many quantization formats, and many deployment paths. This article helps you choose a version based on VRAM and lays out three deployment paths: Ollama, llama.cpp, and vLLM, along with how to toggle thinking mode and explanations of common parameters.
📜 Table of Contents
📖 Keep reading
Qwen3 Local Deployment Guide: Pick by VRAM, Run It Three Ways
Qwen3 spans 0.6B to MoE scale with full quantization coverage. The hard part is picking a size that fits your GPU, then a format you can actually run.
1. Choose by VRAM first
Dense: 0.6B / 1.7B / 4B / 8B / 14B / 32B. MoE: 30B-A3B and 235B-A22B — "A3B" means roughly 3B active parameters per token, fast, but the full weights still need to fit.
| Size | Q4 VRAM/RAM | Hardware | Use |
|---|---|---|---|
| 0.6B / 1.7B | 1-2GB | Pi, old laptop | Classification, extraction |
| 4B | 3-4GB | iGPU, 8GB RAM | Light Q&A, voice backend |
| 8B | 5-6GB | 8GB GPU | General chat, RAG workhorse |
| 14B | 9-11GB | 12-16GB GPU | Harder Q&A, writing |
| 32B | 19-22GB | 24GB GPU | High-quality reasoning, code |
| 30B-A3B | 18-20GB | 24GB GPU | 30B-class with speed |
When VRAM runs short: smaller quantization, then smaller model, then offload layers to RAM (much slower).
2. Route A: Ollama
ollama pull qwen3:8b
ollama run qwen3:8b
from openai import OpenAI
c = OpenAI(base_url="http://localhost:11434/v1", api_key="ollama")
print(c.chat.completions.create(model="qwen3:8b",
messages=[{"role":"user","content":"Explain KV cache"}]).choices[0].message.content)
Simple and reliable; fewer knobs to tune.
3. Route B: llama.cpp + GGUF
Best control over context, threads and offload, and the only sane option for CPU or hybrid inference.
hf download Qwen/Qwen3-8B-GGUF qwen3-8b-q4_k_m.gguf --local-dir ./models
./llama-cli -m ./models/qwen3-8b-q4_k_m.gguf -c 8192 -ngl 99 -t 8 \
-p "Explain why MoE is efficient"
| Flag | Meaning | Typical |
|---|---|---|
| -ngl | Layers offloaded to GPU | 99 if it fits |
| -c | Context length | 4096 and up |
| -t | CPU threads | Physical cores |
| --temp | Temperature | 0.6-0.7 chat, 0.2-0.3 code |
For a server, run llama-server with the same flags; it exposes an OpenAI-compatible endpoint.
4. Route C: vLLM
Only for high concurrency or batch inference. Much higher throughput, more configuration, unfriendly to small VRAM.
vllm serve Qwen/Qwen3-8B --max-model-len 8192 --gpu-memory-utilization 0.9
5. Turning thinking off
Qwen3 is a hybrid reasoning model: it emits a thinking block before answering, useful for math and code, wasteful for extraction and support replies.
- API:
"enable_thinking": false(Ollama exposes athinkflag in recent versions). - Prompt: append
/no_think;/thinkforces reasoning. - Server: vLLM can set the default at startup.
FAQ
Q: Avoid latest tags? Yes, pin a size tag so an upstream update does not silently change behaviour.
Q: Output cut off mid-sentence? Context or max tokens hit a limit; raise num_ctx / -c and check client max_tokens.
Q: Mixed English in Chinese answers? Instruct Chinese only and lower temperature.
Q: 14B on 8GB VRAM? Possible with aggressive quantization and offload, but single-digit tokens per second.
Q: CPU only? Yes below 4B; 8B feels slow.
Q: Fine-tuning? LoRA works. Confirm the problem is behaviour, not knowledge.
Model tags and flags change; check official model cards and docs.
Written by our editorial team; tools listed here are tested or verified against public sources. Links point to official sites or GitHub repos for reference only — no paid placements.