All models
Every model ID, its minimum tier, and monthly allowances on Go, Plus, and Pro.
Qwen 3.8 27B runs at 45–51 tokens/s on a single 24 GB GPU, while the 125B MoE Qwen 3.8 Flash Next needs 128 GB of unified memory just to load Q4 weights. Compare VRAM thresholds, Ollama speeds, coding benchmarks, and 36-month hardware amortization against Qwen4-Max API bills.
Developers building a local coding agent right now usually narrow their Qwen open-weight shortlist down to two models: Qwen 3.8 27B and Qwen 3.8 Flash Next. The 27B dense model fits comfortably on a single RTX 4090 or a 32 GB Mac, while Flash Next is a sparse 125B Mixture-of-Experts preview architecture that activates just 6B parameters per token alongside a 51B N-gram embedding table.
At the same time, Alibaba's closed flagship Qwen4-Max launched in mid-November with cached input pricing down to $0.075 per million tokens internationally (0.5 CNY in mainland China). That price cut shifts the buy-hardware-vs-pay-API break-even point sharply.
Bottom line: If you already own a 24 GB GPU or a 32 GB+ Apple Silicon Mac, run Qwen 3.8 27B locally in Ollama (Q4_K_M is ~18 GB, 45–51 tokens/s on an RTX 4090) for $5–$15/month in electricity. Do not buy a $3,699 128 GB Mac Studio or a $3,999+ DGX Spark purely to save on Qwen 3.8 Flash Next API bills: 3-year hardware amortization starts above $108/month, whereas the hosted Qwen3.8-Flash API costs roughly $59.50/month even at 500M input plus 50M output tokens. Reach for Qwen4-Max API or a multi-model pass when you need deep repository-level fixes without capital outlay.
All three models share Qwen's hybrid attention heritage, but their hardware profiles sit in completely different tiers. Qwen 3.8 27B (Apache 2.0) is a dense vision-language model with a native 262K context window (extensible to 1M via RoPE). Qwen 3.8 Flash Next pairs Gated DeltaNet (GDN) linear attention with Qwen Sparse Attention (QSA) across 125B total parameters; only 6B activate per token, yet the 51B N-gram lookup table still lives in memory, pushing even a 4-bit GGUF file to ~102 GB. Qwen4-Max scales that design to a 2.4T backbone (71B active + 328B N-gram) and is cloud API only.
| Attribute | Qwen 3.8 27B | Qwen 3.8 Flash Next | Qwen4-Max |
|---|---|---|---|
| Weights & license | Open-weight (Apache 2.0) | Open-weight preview (hosted as Qwen3.8-Flash) | Closed (cloud API only) |
| Parameters (total / active) | 27B / 27B (dense) | 125B / 6B (MoE + 51B N-gram) | 2.4T / 71B (MoE + 328B N-gram) |
| Context window | 256K native (up to 1M) | 256K open-weight / 1M hosted | 1M |
| GGUF Q4_K_M size & RAM | ~16.5–18 GB (24 GB VRAM / 32 GB RAM) | ~102 GB (128 GB+ unified memory) | Not available locally |
| GGUF Q8_0 size & RAM | ~31 GB (48–64 GB RAM) | ~175 GB+ (256 GB unified memory) | Not available locally |
| Cloud API (input / output per 1M) | ~$0.035–$0.05 / $1.50 (3rd-party) | $0.16 / $0.47 (QwenCloud) | $1.50 / $4.50 intl (10 / 30 CNY CN) |
| Cloud cache read (per 1M) | Varies by provider | $0.05 | $0.075 intl (0.5 CNY CN) |
The memory row settles the hardware divide immediately: 27B is built for mainstream 24 GB GPUs and developer laptops, while Flash Next locks out anything under 128 GB of RAM despite activating only 6B parameters per token.
Local decode throughput tracks sustained memory bandwidth. Community and Unsloth evaluations show that Qwen 3.8 27B at Q4_K_M retains near-full parity with BF16 across agentic coding suites, while Dynamic V3.1 quants recover 5%–10% average accuracy over naive low-bit quants at the same file size.
Measured throughput across common developer hardware:
Qwen 3.8 27B Q4_K_M (~16.5–18 GB) fits completely in VRAM with ~5 GB left for KV cache, delivering 45–51 tokens/s. Loading the ~31 GB Q8_0 quant spills layers into system RAM and drops decode speed into single digits. Flash Next does not fit on a single 24 GB card.Qwen 3.8 27B runs at 14–22 tokens/s in Q4_K_M and 12–18 tokens/s in Q8_0, with plenty of headroom for long contexts. Qwen 3.8 Flash Next is where sparse MoE shines on Apple Silicon: Q4_K_M hits 40–75 tokens/s on 128 GB+ Max/Ultra machines, while Q8_0 needs 256 GB unified memory and runs at 20–30 tokens/s.Qwen 3.8 27B reaches 26–50+ tokens/s, and Qwen 3.8 Flash Next (Q4_K_M / UD-Q4_K_XL) lands around 25–47 tokens/s.Both open-weight Qwen 3.8 models ship with thinking mode enabled by default in Ollama. Before wiring them into a coding agent, increase Ollama's num_ctx (32K–64K+) so multi-file prompts are not silently truncated.
Public coding and reasoning benchmarks draw a clear three-tier staircase across the lineup (scores compiled from Qwen official release evaluations and Artificial Analysis / OpenRouter tracking; Qwen software engineering evaluations run on Claude Code, mini-SWE-agent, or Terminus harnesses):
| Benchmark | Qwen 3.8 27B | Qwen 3.8 Flash Next | Qwen4-Max |
|---|---|---|---|
| SWE-bench Pro | 61.7 | 62.5 | Not reported |
| DeepSWE v1.1 | 42.2 | 58.7 | 75.7 |
| LiveCodeBench v6 | 90.3 | 91.9 | Not reported |
| Terminal-Bench 2.1 | 73.0 | 86.1 | See 4.0 below |
| Terminal-Bench 4.0 | — | 25.3 | 48.5 |
| GPQA Diamond | 89.2 | 91.7 | Not reported |
| Humanity’s Last Exam (HLE) | 30.8 | 35.9 | 51.7 |
Two practical takeaways stand out:
Qwen 3.8 27B even beat cloud Qwen4-Max by a few points at lower cost.To see when local hardware actually pays for itself, we amortize purchase price straight-line over 36 months and add electricity at $0.15/kWh (4 hours/day active inference + 20 hours/day idle). On the cloud side, we model realistic multi-turn coding agent traffic with an 80% prompt cache hit rate.
The monthly formula is straightforward: Monthly bill = (Uncached input M × Input price) + (Cached input M × Cache read price) + (Output M × Output price).
| Option / Workload tier | Hardware basis or monthly tokens (80% cache hit) | Estimated monthly cost | Notes |
|---|---|---|---|
| Local: 24 GB GPU rig upgrade | ~$2,200 amortized + $10–$15/mo power | $71–$76 / mo | Runs 27B Q4 at 45–51 t/s; cannot load Flash Next |
| Local: Mac Studio 128 GB | $3,699 base amortized + $5–$8/mo power | $108–$111 / mo | Runs 27B (Q8) and Flash Next (Q4, 40–75 t/s) |
| Local: NVIDIA DGX Spark 128 GB | $3,999 MSRP (street $6,950–$8,100) + power | $115–$200 / mo | 140 W TDP; runs 27B and Flash Next Q4 |
| API: Light solo dev | 20M in (4M uncached + 16M cached) + 2M out | Flash $2.38 / Qwen4-Max $16.20 | Far below any dedicated hardware purchase |
| API: Heavy agentic dev | 100M in (20M uncached + 80M cached) + 10M out | Flash $11.90 / Qwen4-Max $81.00 | Qwen4-Max roughly matches a 24 GB GPU rig |
| API: All-day multi-agent / batch | 500M in (100M uncached + 400M cached) + 50M out | Flash $59.50 / Qwen4-Max $405.00 | Local hardware beats flagship API at batch scale |
The break-even numbers are blunt: buying a $3,699 Mac Studio strictly to avoid Qwen3.8-Flash API fees almost never pays off. Even at 500M input and 50M output tokens per month, hosted Qwen3.8-Flash costs $59.50/month, roughly half the monthly amortization of a 128 GB Mac Studio.
Local deployment wins in three concrete cases:
Qwen4-Max at $405/month) would exceed dedicated hardware costsIf you want lightweight Qwen speed for routine edits plus frontier Claude, GPT, or Gemini models for hard architectural work without buying dedicated hardware, a capped multi-model pass keeps billing predictable. CodingPass puts 25 models behind one Base URL—browse all models or check plans and pricing: Go starts at $10/month (~2,050 Sonnet requests) and Plus is $30/month, metered at official API prices with hard caps so a runaway loop cannot rack up a surprise bill.
| Hardware & workflow | Recommended pick | Why or trade-off |
|---|---|---|
| Existing RTX 4090 / 32 GB Mac, daily edits and tests | Local Qwen 3.8 27B (Q4_K_M) | Zero new hardware spend, 45–51 t/s on 4090, 61.7 SWE-bench Pro |
| Existing 128 GB+ Mac Studio or DGX Spark, offline agent | Local Qwen 3.8 Flash Next (Q4_K_M) | 40–75 t/s on Apple Silicon, +16.5 DeepSWE over 27B, full privacy |
| Standard laptop, monthly budget under $20 | Cloud Qwen3.8-Flash API or CodingPass Go | ~$11.90/mo even at 100M input tokens; zero upfront hardware cost |
| Cross-repo refactors, 1M-context code audits | Cloud Qwen4-Max API (high default, xhigh for CLI) | 75.7 DeepSWE and $0.075/M cache reads; xhigh mode is slower |
| Daily work across OpenCode, Claude Code, and Codex | Local 27B for private drafts + CodingPass for frontier calls | Keeps sensitive snippets local while capping cloud spend cleanly |
Pull and run either open-weight model locally with Ollama:
# 24 GB VRAM or 32 GB+ unified memory: Qwen 3.8 27B (Q4_K_M, ~18 GB)ollama run qwen3.8:27b # 128 GB+ unified memory (Mac Studio / DGX Spark): Qwen 3.8 Flash Next (Q4_K_M, ~102 GB)ollama run qwen3.8-flash-next:125b-a6b-q4_K_MIn OpenCode (see the full OpenCode setup guide), you can wire both your local Ollama daemon and cloud Qwen endpoints into a single opencode.json and switch models per task:
{ "$schema": "https://opencode.ai/config.json", "provider": { "ollama": { "npm": "@ai-sdk/openai-compatible", "name": "Ollama (Local)", "options": { "baseURL": "http://127.0.0.1:11434/v1" }, "models": { "qwen3.8:27b": { "name": "Qwen 3.8 27B (Local)" } } }, "qwencloud": { "npm": "@ai-sdk/openai-compatible", "name": "QwenCloud API", "options": { "baseURL": "https://ap-southeast-1.maas.qwencloudapi.com/compatible-mode/v1", "apiKey": "{env:DASHSCOPE_API_KEY}" }, "models": { "qwen3.8-flash": { "name": "Qwen 3.8 Flash (API)" }, "qwen4-max": { "name": "Qwen4-Max (API)" } } } }}If you run Claude Code in the terminal and want a single capped gateway for cloud frontier models (see the Claude Code setup guide), point ANTHROPIC_BASE_URL at CodingPass:
export ANTHROPIC_BASE_URL="https://api.codingpass.ai"export ANTHROPIC_API_KEY="cp-live-your-key"claudeThe standard Q4_K_M quant sits around 16.5–18 GB before KV cache, so it will partially spill into system RAM on a 16 GB card and slow down sharply. On 16 GB VRAM, either use a smaller ~3-bit dynamic quant with an 8K–16K context cap or call the hosted Qwen3.8-Flash API instead.
They share the same 125B-A6B sparse MoE architecture, but deployment limits differ. The open-weight Qwen 3.8 Flash Next preview ships with a 256K native context window and requires ~102 GB of memory at Q4, whereas hosted Qwen3.8-Flash on QwenCloud exposes a 1M context window out of the box with $0.05/M cache reads.
Stay on local Qwen 3.8 27B or cloud Qwen3.8-Flash for single-file edits, unit tests, and quick debugging. Step up to Qwen4-Max (high by default, xhigh for tough CLI tasks) when your agent needs to refactor across a dozen files, digest a 500K-token repo, or resolve multi-step terminal failures where higher first-pass accuracy beats raw token price.
CodingPass gives you