Qwen-Coder

Also known as: Qwen Coder

On this page 7

Qwen-Coder is the family of code-specialized large language models developed by the Qwen team at Alibaba Cloud, released mostly as open-weight models for code completion, generation, explanation, repair and agentic software tasks. In AI for coding, it is one of the leading open alternatives to proprietary coding models and is widely used in local assistants and self-hosted development tools.

The line evolved from CodeQwen1.5 through Qwen2.5-Coder to Qwen3-Coder, each built on the general Qwen base models and further trained on large code corpora. Developers can run smaller variants on a single workstation, while the largest mixture-of-experts versions target agentic coding comparable to commercial systems.

How Qwen-Coder models are built

Qwen-Coder models start from a general Qwen base model and continue pretraining on a corpus dominated by source code, code-related text and mathematics. This continued pretraining teaches syntax, library usage and repository structure across dozens of programming languages, while the general base preserves natural-language reasoning.

Pretraining includes fill-in-the-middle objectives, so the base models can complete code between a given prefix and suffix, the mode used by inline completion in editors. Repository-level training with concatenated files teaches cross-file dependencies. Instruction-tuned variants then learn to follow requests, explain code and hold multi-turn conversations, and later releases add reinforcement learning on executable tasks that rewards code which actually passes tests.

The table below summarizes the main stages that shape a Qwen-Coder release.

StageDataCapability gained
Base model pretrainingGeneral multilingual text and codeLanguage understanding and reasoning
Code continued pretrainingTrillions of code-heavy tokensSyntax, APIs, idioms in many languages
Repository-level trainingWhole projects with long contextCross-file references and structure
Instruction tuningCurated coding dialogues and tasksFollowing requests, explaining code
Reinforcement learningExecutable tasks with testsCorrectness and multi-step agent behavior
Training stages of a Qwen-Coder model

Qwen-Coder generations and model sizes

Each generation of Qwen-Coder widened the range of sizes and the context length. Qwen2.5-Coder introduced a full ladder of dense models from 0.5B to 32B parameters, while Qwen3-Coder moved its flagship to a mixture-of-experts architecture that activates only part of the network for each token.

GenerationRepresentative sizesContext windowMain focus
CodeQwen1.57B dense64K tokensEarly open code model
Qwen2.5-Coder0.5B, 1.5B, 3B, 7B, 14B, 32B denseUp to 128K tokensCompletion, generation, repair
Qwen3-Coder30B-A3B and 480B-A35B MoE256K native, extendable toward 1MAgentic coding and tool use
Main Qwen-Coder generations

In the MoE naming, 480B-A35B means about 480 billion total parameters with roughly 35 billion active per token. This keeps inference cost closer to a mid-sized dense model while retaining the knowledge capacity of a much larger one, although the full weights still require substantial GPU memory.

Most Qwen2.5-Coder and Qwen3-Coder weights are published under the Apache 2.0 license, which allows commercial use and modification. Alongside the Qwen3-Coder release, the team also published Qwen Code, a command-line agent adapted from an open-source terminal coding tool, so that the models could be tested in realistic multi-step workflows.

How Qwen-Coder compares with other code models

Qwen-Coder sits among the open-weight code models such as Code Llama, StarCoder, DeepSeek-Coder, Codestral and Devstral. Its distinguishing features are the breadth of available sizes, a permissive license for most variants and strong results on common benchmarks such as HumanEval, MBPP, LiveCodeBench and SWE-bench.

Model familyDeveloperNotable trait
Qwen-CoderAlibaba Qwen teamWide size range, agentic MoE flagship
DeepSeek-CoderDeepSeekStrong reasoning-oriented code models
StarCoderBigCode projectTransparent, documented training data
Code LlamaMetaEarly widely adopted open code model
Codestral and DevstralMistral AIFast completion and agentic variants
Qwen-Coder among open code models

Benchmark positions change with every release, so independent and recent evaluations matter more than launch claims. Scores on public benchmarks can also be inflated by training data contamination, which is one reason newer, time-bounded suites such as LiveCodeBench exist.

Using Qwen-Coder in practice

Qwen-Coder is used through three main channels: local inference with tools such as Ollama, llama.cpp or vLLM; hosted APIs from Alibaba Cloud and third-party providers; and agentic coding tools such as Qwen Code, Cline, Aider or OpenHands. The choice of size depends mainly on hardware, latency needs and task complexity.

SituationSuitable variantReason
Inline completion on a laptop1.5B to 7B baseLow latency, fill-in-the-middle
Private chat assistant on one GPU14B or 32B instructGood quality within consumer memory
Agentic tasks on a workstationQwen3-Coder 30B-A3BFast MoE with tool calling
Large repository refactoringQwen3-Coder 480B-A35BLong context, strongest reasoning
Choosing a Qwen-Coder variant

Quantization to 4-bit or 8-bit formats makes the mid-sized models practical on consumer hardware, usually with a modest loss of accuracy. For completion, the base model with FIM tokens often works better than the instruct model, which is tuned for conversation.

Limitations and risks

Like all code models, Qwen-Coder can produce plausible but incorrect code, invent nonexistent functions or packages, and reproduce insecure patterns from its training data. Output must pass the same tests, code review and security scanning as human-written code.

  • Package hallucination can suggest dependencies that do not exist, which attackers may register as malicious packages.
  • Long-context degradation means details in very large prompts are sometimes ignored.
  • License terms differ between variants, so each model card must be checked before commercial use.
  • Agent autonomy requires sandboxing, because a coding agent can run destructive shell commands.

Open weights also shift operational responsibility to the user. A self-hosted deployment must handle updates, monitoring, access control and prompt logging that a commercial provider would otherwise manage. Teams should also track model provenance, because fine-tuned derivatives shared on public hubs may change behavior or safety properties in ways the original model card does not describe.

Finally, strong benchmark results do not transfer automatically to a specific codebase. Internal frameworks, uncommon languages and domain conventions are underrepresented in public training data, so a short pilot evaluation on real tasks from the team’s own repositories gives a far more reliable picture than leaderboard rankings.

A plain-language summary

Qwen-Coder is an AI model that writes and fixes computer code. It was made by the Qwen team at Alibaba. Many versions are free to download.

Small versions run on an ordinary computer. Large versions run on powerful servers. A programmer can ask it to write a function, find a bug or explain a file. It works like a fast, well-read assistant. Its answers still need testing and review, because it can make mistakes.

An example from practice

A software team at a regional bank may not send source code to external cloud services. To still benefit from AI assistance, the team deploys Qwen2.5-Coder 32B Instruct in a 4-bit quantized format on an internal server with two 48 GB GPUs, served through vLLM.

Developers connect their editors to the internal endpoint for chat and code explanation, while a separate Qwen2.5-Coder 7B base model provides low-latency inline completion. All code stays inside the bank network, which satisfies the data residency requirement set by the security department.

After three months, the team uses the assistant mainly for writing unit tests, migrating legacy Java code and drafting documentation. Every suggestion still passes the existing pipeline of tests and static analysis, and reviewers report that the largest time savings come from boilerplate and test generation, not from complex business logic.