★ Reading this for free? Get 25 structured AI courses + per-chapter AI tutor — the first chapter of every course free, no card.Start free in 30 secondsOr own every course: $149 once

Alibaba Qwen · Open-Weight · Apache 2.0

Qwen3-Coder-Next: The Best Self-Hostable Coding Model

Qwen3-Coder-Next is Alibaba Qwen's open-weight coding model for agents and local development. 80 billion total parameters, only 3 billion active per token (MoE), 256K-token context, 70.6% on SWE-Bench Verified in its own technical report, and Apache 2.0 licensed for commercial use. The 52 GB Q4 build runs on a single 80 GB GPU, 2× RTX 5090 or a 64 GB+ Mac. It is the realistic local alternative to a hosted Claude model in Cursor, without sending your code to a third party.

📅 Published: May 9, 2026🔄 Last Updated: November 2, 2026✓ Manually Reviewed

Why this matters: in Qwen's technical report, Qwen3-Coder-Next scores 70.6% on SWE-Bench Verified with SWE-Agent, against 76.0% for Claude Sonnet 4.5 and 70.2% for DeepSeek-V3.2 (671B) in the same harness, while running only 3B parameters per token. For routine work that gap is small enough to matter less than privacy, cost and offline operation.

Key takeaways

  • →80B/3B active MoE — only 3B parameters run per token, so it generates much faster than a dense model of the same size; all 52 GB (Q4) still has to fit in memory.
  • →256K context — fits most repositories, full PR diffs, and long API specs.
  • →70.6% SWE-Bench Verified (SWE-Agent, Qwen technical report) — with only 3B parameters active per token, in a 52 GB Q4 build.
  • →Apache 2.0 — unlimited commercial use, no royalties.
  • →Drop-in for Cursor / Aider / Continue — OpenAI-compatible API via Ollama or vLLM.

Quick verdict

Qwen3-Coder-Next is the right starting point for any developer who wants serious local AI coding without sending code to a third party. It runs on a single 80 GB GPU (or 2× consumer RTX 5090), sits a few points below Anthropic's 2025 Sonnet and Opus models on the SWE-Bench scaffolds in its technical report, and costs nothing per token after the hardware investment.

Where it loses: hardest reasoning, novel algorithms, multi-file refactors with deep dependencies. For those, you keep a Claude or GPT API account on standby and route the hardest tasks there. What that saves depends on how much of your work is routine.

Specs at a glance

VendorAlibaba Qwen team
ArchitectureHybrid Gated DeltaNet + Gated Attention, Mixture-of-Experts (512 experts, 10 routed + 1 shared active)
Total parameters80 billion
Active parameters3 billion per token
Context window262,144 tokens (256K) native
ModeNon-thinking only (no <think> blocks)
LicenseApache 2.0
SWE-Bench Verified70.6% (SWE-Agent), 71.3% (OpenHands), per the technical report
Storage (BF16)~160 GB
Storage (Q4_K_M)52 GB (Ollama qwen3-coder-next:latest)
Storage (Q8_0)85 GB (Ollama qwen3-coder-next:q8_0)
Hugging FaceQwen/Qwen3-Coder-Next

Hardware requirements

HardwareQuantizationMemory headroomNotes
2× RTX 5090 (32GB each)Q4_K_M (52 GB)64 GB VRAM, ~12 GB left for KV cacheSweet spot for a consumer build
1× H100 80GBQ4_K_M (52 GB)~28 GB left for KV cache; Q8_0 (85 GB) does not fitBest single-GPU; cleanest deployment
1× M3 Ultra (96GB unified)Q4_K_M (52 GB)Comfortable; Q8_0 (85 GB) is tight once macOS takes its shareApple Silicon; quiet, no cooling needed
2× RTX 4090 (24GB each)Q4_K_M (52 GB)48 GB VRAM is less than the 52 GB filePart of the model spills to system RAM, so it runs well below full-GPU speed
1× B200 180GBBF16 (~160 GB)~20 GB left for KV cacheProduction multi-user serving
CPU-only (Threadripper/EPYC + 256GB RAM)Q4_K_M (52 GB)Fits easily in RAMPossible but slow; not for interactive use

Sizes from the Ollama library (read November 2, 2026). We give no tokens-per-second figures here: this is a Mixture-of-Experts model, and a memory-bandwidth ceiling does not describe MoE generation speed well. Ollama has no Q5 or Q6 build of this model; the GGUF repository on Hugging Face has more quantizations if you need a size between 52 and 85 GB.

Local setup

Ollama (10-minute install)

# Install Ollama
curl -fsSL https://ollama.com/install.sh | sh

# Pull Qwen3-Coder-Next at Q4_K_M (52 GB download; qwen3-coder-next:q8_0 is 85 GB)
ollama pull qwen3-coder-next

# Test it interactively
ollama run qwen3-coder-next "Write a Python function that detects palindromes"

# Or expose it as an OpenAI-compatible API
ollama serve  # listens on :11434

vLLM (production / multi-user)

pip install vllm

# Serve Qwen's FP8 weights (~80 GB) on 2× H100 80GB, 256K context, OpenAI-compatible.
# The BF16 weights (~160 GB) do not fit a single 80 GB GPU.
python -m vllm.entrypoints.openai.api_server \
  --model Qwen/Qwen3-Coder-Next-FP8 \
  --tensor-parallel-size 2 \
  --max-model-len 262144 \
  --gpu-memory-utilization 0.92 \
  --port 8000

# Test from any OpenAI client:
# openai.OpenAI(base_url="http://localhost:8000/v1", api_key="dummy")
# completion(model="Qwen/Qwen3-Coder-Next-FP8", messages=[...])

llama.cpp (max control)

# Build with CUDA
git clone https://github.com/ggml-org/llama.cpp && cd llama.cpp
cmake -B build -DGGML_CUDA=ON && cmake --build build --config Release -j

# Download the official GGUF
huggingface-cli download Qwen/Qwen3-Coder-Next-GGUF \
  --include "Qwen3-Coder-Next-Q4_K_M/*" --local-dir models

# Serve (point at the first shard; llama.cpp loads the rest)
./build/bin/llama-server -m models/Qwen3-Coder-Next-Q4_K_M/Qwen3-Coder-Next-Q4_K_M-00001-of-00004.gguf \
  -ngl 99 -c 65536 --host 0.0.0.0 --port 8080

Cursor / Continue / Aider integration

Once Ollama or vLLM is serving on :11434 or :8000, you can use Qwen3-Coder-Next inside any major AI coding tool. The trick: every tool supports an “OpenAI-compatible custom endpoint”.

Cursor

Settings → Models → “OpenAI API Key” section → enable “Override OpenAI Base URL”.

Base URL: http://localhost:11434/v1
API Key: dummy
Model name: qwen3-coder-next

Cursor sends custom-model requests from its own servers, so a plain localhost URL may not be reachable. If the model does not answer, expose the endpoint through a tunnel such as ngrok and use that URL instead.

Continue.dev

Edit ~/.continue/config.json:

{
  "models": [{
    "title": "Qwen3-Coder-Next",
    "provider": "openai",
    "model": "qwen3-coder-next",
    "apiBase": "http://localhost:11434/v1",
    "apiKey": "dummy"
  }]
}

Aider (CLI)

export OPENAI_API_BASE=http://localhost:11434/v1
export OPENAI_API_KEY=dummy
aider --model openai/qwen3-coder-next your-file.py

Coding benchmarks

Every number below comes from the Qwen3-Coder-Next technical report, which ran all models through the same agent scaffold for each column. That makes the rows comparable with each other, which vendor-by-vendor leaderboard numbers usually are not. Scores are vendor-reported, not independent.

Benchmark (scaffold)Qwen3-Coder-Next (80B, 3B active)DeepSeek-V3.2 (671B, 37B active)GLM-4.7 (358B, 32B active)Claude Sonnet 4.5Claude Opus 4.5
SWE-Bench Verified (SWE-Agent)70.6%70.2%74.2%76.0%78.2%
SWE-Bench Verified (OpenHands)71.3%72.6%70.6%74.6%79.0%
SWE-Bench Multilingual (OpenHands)64.3%61.8%60.8%66.0%75.2%
SWE-Bench Pro (SWE-Agent)42.7%46.0%45.1%50.5%51.6%
Terminal-Bench 2.0 (Terminus-2 JSON)36.2%39.3%37.1%51.7%57.3%

The report also lists non-agentic coding scores, compared only with Qwen's own models: LiveCodeBench v6 58.93 (Qwen3-Coder-480B-A35B: 44.93), EvalPlus 86.56 (480B: 86.66), MultiPL-E 88.23 (480B: 88.00) and a Codeforces rating of 2100 (480B: 1800). Aider polyglot, HumanEval and MBPP scores are not published separately for Qwen3-Coder-Next.

Source: Qwen3-Coder-Next Technical Report (arXiv 2603.00729, February 28, 2026), Tables 3-6, read November 2, 2026. Some third-party listings quote other Verified figures for the same model (different scaffolds or runs), so always check which harness a number comes from. · Qwen3-Coder-Next on Hugging Face

When to pick Qwen3-Coder-Next

  • ✓You write code professionally and want a self-hosted Cursor/Aider setup.
  • ✓Your code or IP cannot leave your network (regulated industries, defense, IP-sensitive).
  • ✓You have or can buy a single 80 GB GPU, 2× RTX 5090, or a Mac with 64 GB+ of unified memory.
  • ✓You want a hybrid setup: local for routine work, a hosted API for the hardest tasks.
  • ✓You're building a coding-AI product and need an Apache-2.0-licensed model in the loop.

When to use something else

  • →You want a hosted frontier model for the hardest tasks → see which Claude model to use for coding (Sonnet for value, Opus for the hardest work), or compare vendors in best AI coding models.
  • →Single high-end consumer GPU with no MoE complexity → Qwen3.6-27B (dense 27B, fits a 24-32 GB card at Q4, simpler deployment).
  • →You need 1M context for whole-monorepo work → DeepSeek V4 or Gemini 3.1 Pro API.
  • →Mixed coding + general work, more hardware → DeepSeek V4-Flash.

Frequently asked questions

What is Qwen3-Coder-Next?
Qwen3-Coder-Next is the Alibaba Qwen team's open-weight coding model for agents and local development — a Mixture-of-Experts architecture with 80 billion total parameters and 3 billion active per token, built on Qwen3-Next-80B-A3B-Base. It has a 262,144-token (256K) native context window, scores 70.6% on SWE-Bench Verified with the SWE-Agent scaffold according to the Qwen3-Coder-Next technical report (arXiv 2603.00729, February 2026), and ships under the Apache 2.0 license. Its 52 GB Q4 build fits in roughly 64 GB of memory, which makes it a practical self-hosted option for code-heavy work.
How much VRAM does Qwen3-Coder-Next need?
Ollama lists the Q4_K_M build (qwen3-coder-next:latest) at 52 GB and the Q8_0 build at 85 GB, so plan on about 52 GB plus room for the KV cache at Q4. That fits in 2× RTX 5090 (64 GB total), 1× H100 or A100 80GB, or a Mac with 64 GB or more of unified memory (96 GB is comfortable). 2× RTX 4090 gives 48 GB, which is less than the 52 GB file, so Ollama keeps part of the model in system RAM and runs slower. Full BF16 weights are about 160 GB. Only 3B parameters are active per token, so it generates far faster than a dense 80B model on the same hardware; we do not publish a tokens-per-second figure for this MoE model because a bandwidth ceiling does not describe MoE speed well.
How do I install Qwen3-Coder-Next with Ollama?
Install Ollama, then run: `ollama pull qwen3-coder-next` (defaults to Q4 quantization). Start it with `ollama run qwen3-coder-next`. To expose it as an OpenAI-compatible API for Cursor, Continue.dev, or Aider: run `ollama serve` and point your tool at `http://localhost:11434/v1` with model name `qwen3-coder-next`. Cursor specifically: Settings → Models → Override OpenAI Base URL to your Ollama endpoint, and you can use Qwen3-Coder-Next in place of a hosted model.
Qwen3-Coder-Next vs Claude Sonnet: how much worse is it?
The cleanest comparison is the Qwen3-Coder-Next technical report, which ran every model through the same scaffolds. With SWE-Agent on SWE-Bench Verified it lists Qwen3-Coder-Next at 70.6%, Claude Sonnet 4.5 at 76.0% and Claude Opus 4.5 at 78.2%; with OpenHands the figures are 71.3%, 74.6% and 79.0%. So the gap to Anthropic's 2025 models is roughly 3 to 8 points depending on the harness. Newer Claude models (Sonnet 4.6, Sonnet 5.5, Opus 5.5) were not part of that report, so there is no like-for-like number for them. Where a hosted frontier model still tends to help: novel algorithm design, multi-file refactors with subtle dependencies and ambiguous specs. A common pattern is to run Qwen3-Coder-Next locally for routine work and send the hardest tasks to a hosted model; how much that saves depends entirely on your mix of tasks.
What is the 256K context window good for?
A 262,144-token context window holds roughly 13,000 lines of code (Google's rule of thumb is about 20 tokens per 80-character line) or about 197,000 words of English (Anthropic's ratio of 200K tokens to 150K words). Practical uses: load a small repo, or the relevant part of a larger one, and ask whole-codebase questions; refactor across many files in one prompt; analyze a complete API spec + multiple implementations together; or feed a long PR diff with full file context. For most engineering work, 256K is more than enough. If you need 1M context (whole monorepo), Gemini 3.1 Pro (closed API) or DeepSeek V4 (open weight) are the alternatives.
Can I use Qwen3-Coder-Next with Cursor / Continue.dev / Aider?
Yes — all three support custom OpenAI-compatible endpoints. Cursor: Settings → Models → "Override OpenAI Base URL" → `http://localhost:11434/v1` (Ollama) and add model `qwen3-coder-next`. Continue.dev: edit `~/.continue/config.json` and add a model entry pointing to your local endpoint. Aider: pass `--model openai/qwen3-coder-next` and `--openai-api-base http://localhost:11434/v1`. Once configured, they talk to it the same way they talk to a hosted model. If several Cursor or Aider sessions share one server, vLLM is the better server: its continuous batching processes many requests together instead of one after another.
Why Apache 2.0 license matters
Apache 2.0 is a permissive open-source license — you can use Qwen3-Coder-Next commercially, modify it, redistribute it, embed it in products, and fine-tune it without paying royalties or asking permission. The only requirements are preserving copyright notices and disclosing significant changes. This is the same license as Apache HTTP Server, Kubernetes, and TensorFlow. Compared to Llama 4 (modified license with usage thresholds and attribution requirements), Apache 2.0 means you can build a product on Qwen3-Coder-Next without lawyers reviewing the agreement.
Qwen3-Coder-Next vs DeepSeek V4-Flash for coding
Qwen3-Coder-Next is coding-specialized; DeepSeek V4-Flash is a general-purpose model (284B total, 13B active). The Qwen technical report does not include V4-Flash, so there is no same-scaffold benchmark comparison between the two; compare vendor figures with care. The practical difference is size: Qwen3-Coder-Next is 52 GB at Q4_K_M in Ollama and fits one 80 GB GPU, while V4-Flash needs roughly 155 GB at native precision (see our DeepSeek V4 page), which means two H100s or several consumer cards. For coding on a single high-end GPU or a 64-96 GB Mac, pick Qwen3-Coder-Next. For mixed coding, research and general work, V4-Flash is the option if you have the hardware.

Build a complete local coding stack

The Local AI Master deployment course walks through serving local models with vLLM, connecting them to coding tools such as Cursor and Aider, and routing the hardest tasks to a hosted model.

See the deployment course →

Related models

🎯
AI Learning Path

Go from reading about AI to building with AI

25 structured courses. Hands-on projects. Runs on your machine. Start free.

Or own it for life — Lifetime $149 $599, pay once
Barsha Mohapatra

Written by

Barsha Mohapatra

Founder and Editor, Local AI Master · Founder, Little AI Master

Founder of Little AI Master and the editor behind every course and guide on Local AI Master. Years of tutoring students taught her where AI education actually fails.

More on Local AI Hardware
See the full AI Hardware Guide 2026 guide.
📚
Free · no account required

Grab the AI Starter Kit — career roadmap, cheat sheet, setup guide

No spam. Unsubscribe with one click.

🎯
AI Learning Path

Found your model? Now build something with it.

25 hands-on courses — RAG, agents, fine-tuning — all running locally. First chapter free, no card.

Or own it for life — Lifetime $149 $599, pay once
Free Tools & Calculators