How to Self Host Qwen3-Coder for Whole Repo Coding
Qwen3-Coder is Alibaba’s open-weight coding model with 480B total parameters, 35B active per token, a 1M-token context window, and an Apache 2.0 license that allows commercial use.
The 35B-active mixture-of-experts design keeps inference affordable while the 1M context lets it swallow an entire monorepo in one prompt. That combination is what makes self-hosting worth considering for teams who cannot send code to an external API.
What hardware does Qwen3-Coder need?
| Variant | Hardware | Use case |
|---|---|---|
| 30B | Single 48-80GB GPU | Lighter coding tasks, fine-tuning |
| 480B quantized | Multiple 80GB GPUs | Whole-repo reasoning |
| API (DashScope) | None | Evaluation and small volume |
The 480B model does not fit on a single consumer card. Realistic self-hosting means a multi-GPU node or a rented instance. Run the maths on your token volume first; below a few hundred million tokens a month the API is almost always cheaper.
How do you serve it with vLLM?
Install vLLM, download the weights from Hugging Face, then start the OpenAI-compatible server:
vllm serve Qwen/Qwen3-Coder-480B-A35B-Instruct \
--tensor-parallel-size 8 \
--max-model-len 262144
Keep max-model-len realistic. The 1M window sounds great until the KV cache eats your memory. Most teams set 256K and raise it only for the specific job that needs more. That single setting is the difference between a server that runs and one that crashes on startup.
What is Qwen3-Coder actually good at?
- Refactoring legacy repositories that would not fit in a normal context window.
- Building PR bots that fix issues and open pull requests.
- Self-hosted coding help where source code cannot leave the network.
- SQL generation and migration scripting across large schemas.
It is strongest in Python, TypeScript, and SQL. Niche languages get noticeably weaker output. And Qwen3-Coder does not ship IDE polish the way closed tools do; expect to wire it into your own harness.
Self-host or pay for the API?
Self-host when code cannot leave your network, when you exceed a few hundred million tokens a month, or when you want to fine-tune. Use the API when you are evaluating, when volume is low, or when you lack GPUs. Qwen Chat offers a free tier for hands-on testing; DashScope bills per token.
Where does it fall short against Claude or GPT coding models?
Out-of-the-box agent behaviour is less polished. Multi-file edits need more scaffolding, and it will occasionally over-edit. The trade is control and cost: you keep the weights, you set the guardrails, and you are not billed per token by a third party.
Key Takeaways
- Qwen3-Coder is 480B total, 35B active, Apache 2.0 licensed.
- 1M-token context handles whole repositories in one pass.
- Serve with vLLM; cap max-model-len around 256K for stability.
- Weakest in niche languages and IDE integration; strongest at self-hosted large-repo work.
