For the first time in a decade of LLM history, the most interesting open-weights showdown in coding doesn't involve a US lab. Z.ai's GLM 5.2 (June 13, 2026) and DeepSeek's V4 are both genuinely usable, both come with permissive open weights, and both happen to be Chinese. They take different paths to the same destination: GLM 5.2 bets on context window and agent loop quality; DeepSeek V4 bets on raw per-token cost and battle-tested reliability. Here's how they compare where it matters.
Want the full picture? Read our continuously-updated DeepSeek V4 cost breakdown — how V4-Flash ($0.14/$0.28) and V4-Pro compare on price and coding to Claude Opus 5, GPT-5.6, Kimi K3 and Gemini 3.5, with real monthly-bill math.
Update — August 14, 2026: Z.ai has shipped GLM-5.3. The GLM side of this comparison now has a successor, but not one that can go on the same table yet. As of August 14, GLM-5.3 has no open weights (promised roughly two weeks after launch, around August 28) and no public API — the only access is the GLM Coding Plan, which now auto-routes GLM-5.2 requests to 5.3. That means there is no per-token price to set against DeepSeek V4's, and no independent benchmark either: with no API, evaluators such as Artificial Analysis and vals.ai cannot run it. Every DeepSeek V4 figure below is unaffected. See the GLM-5.3 launch guide.
GLM 5.2 vs DeepSeek V4: at a glance
| Dimension | GLM 5.2 | DeepSeek V4 |
|---|---|---|
| Maker | Zhipu Z.ai (China) | DeepSeek (China) |
| Released | June 13, 2026 | April 2026 preview; V4-Pro GA August 13, 2026 |
| License | MIT (open weights, week after launch) | MIT (open weights) |
| Context window | 1,000,000 tokens (usable) | 1,048,576 tokens (both tiers) |
| Max output | 131,072 tokens | 384,000 tokens |
| API pricing | Coding Plan (flat sub); standalone API in week-of-launch | V4-Flash: $0.14 / $0.28 per M tokens. V4-Pro: $0.435 / $0.87. Both move to peak/off-peak pricing on Aug 16, 2026 |
| Multi-modal | Text + code only | Text + code only (no vision on either tier) |
| Coding positioning | Agentic + 1M repo-scale | General-purpose with strong coding |
Pricing update — August 16, 2026. DeepSeek's side of this comparison gets more expensive at 16:00 UTC on August 16, 2026, when both V4 models move from a flat rate to peak / off-peak pricing (peak = 01:00–04:00 and 06:00–10:00 UTC). V4-Pro: $0.66 in / $1.98 out off-peak, $1.32 / $3.96 at peak. V4-Flash: $0.22 / $0.66 off-peak, $0.44 / $1.32 at peak. Blended that is 1.96x input, 2.94x output and 7.84x on cached reads — off-peak is half of a raised peak, not a discount, so every DeepSeek figure below rises. V4-Flash stays the cheapest serious coding API either way, but the margin over a GLM Coding Plan narrows. Full rate card: the DeepSeek V4 August 2026 price change; the GA model itself is covered in our V4-Pro-0813 guide.
How do the coding benchmarks actually compare?
Honest answer: at the time of writing (mid-June 2026), GLM 5.2 has no vendor-published benchmarks. DeepSeek V4 does. Comparing on equal footing means looking at the parent model (GLM 5.1) for one side and V4 for the other.
What we know about GLM 5.1 (the most recent peer-reviewed version of the family):
- SWE-Bench Pro: 58.4 (state-of-the-art at the time, narrowly ahead of GPT-5.4 and Claude Opus 4.6)
- Terminal-Bench 2.0: 63.5 standalone, 66.5 with Claude Code scaffolding
- CyberGym: 68.7
- τ³-Bench: 70.6
- MCP-Atlas: 71.8
What we know about DeepSeek V4:
- SWE-bench Verified: ~88% on the favourable scaffold, ~76% on the standard one
- LiveCodeBench: ~85% Pass@1
- HumanEval: 95%+
- Strong on multi-language tasks and a notable lead on Python repo refactors
The pattern: DeepSeek V4 looks stronger on the classic single-shot code-generation benches; GLM 5.1 (and presumably 5.2) leads on the long-horizon, multi-step agentic benches. If your workload is “produce a 200-line patch given a complete spec,” DeepSeek V4 has more public mileage. If your workload is “agent loops over a repo for 4 hours and ships a feature,” GLM is the better-aimed model.
Is the 1M context window actually useful?
It depends on whether you're doing repo-scale or task-scale work — but read the correction first, because context is not the tiebreaker this section originally claimed it was.
Correction (August 2026). An earlier version of this comparison put DeepSeek V4 at 128K–256K context. That is wrong. Both V4-Pro and V4-Flash run a 1,048,576-token context window with 384K max output — the same order as GLM 5.2. Context capacity does not separate these two models. What follows is the question of whether your workload needs a million tokens at all, and who bills it more cheaply when it does.
For a typical SaaS bug fix — read three files, change two, write a test — 128K tokens is plenty. DeepSeek V4-Flash handles this all day and the price-per-task is materially lower than GLM. The 1M window is wasted on either model.
For an agent that wants to understand a 200-file service before proposing a refactor, the picture changes — but on billing, not capability. At ~3K tokens per file, 200 files is 600K tokens, which fits comfortably in both windows. The constraint is what it costs to push 600K tokens through the API on every turn. That is exactly where the two pricing models diverge: a GLM Coding Plan absorbs it into a fixed monthly bill, while DeepSeek meters it — cheaply today, and about twice as expensively off-peak from August 16, 2026.
So the real question is not "which model can hold my repo" — both can. It is: does your agent genuinely need whole-codebase awareness every turn, and if so, do you want that billed flat or per token?
What do the token economics look like?
DeepSeek V4 has the most aggressive open-weights pricing in the market. V4-Flash at $0.14 input / $0.28 output is the cheapest serious coding model you can call from an API today — about 36× cheaper than GPT-5.5 on input and over 100× cheaper on output. V4-Pro at $0.435 / $0.87 is roughly 17x cheaper than Claude Sonnet on output — not "less than half", as an earlier version of this piece said off the retired $1.74 / $3.48 launch price. From August 16, 2026 V4-Flash becomes $0.22 / $0.66 off-peak and $0.44 / $1.32 at peak, and V4-Pro $0.66 / $1.98 and $1.32 / $3.96 — still the cheapest serious coding API at every tier, but the headline multiples above roughly halve.
GLM 5.2's standalone API arrives the week after launch; Zhipu hasn't disclosed pricing yet. Based on GLM 5.1's API rates (and consistent with the team's positioning as a frontier-but-affordable alternative), expect somewhere in the $1-2 input / $3-6 output range. Against V4-Pro's actual $0.435 / $0.87 that lands above both DeepSeek tiers on per-token cost, not between them — even after the August 16 increase.
The flat-rate side is where GLM is structurally different. The GLM Coding Plan (Lite / Pro / Max / Team) gives you predictable monthly bills for predictable agent volume. DeepSeek doesn't offer a similar plan — you pay per token regardless. For shops with bursty inference (one engineer kicks off a refactor at 3pm and burns 50M tokens), GLM's flat plan caps the bill cleanly. For shops with steady, predictable inference, DeepSeek V4's per-token rate is hard to beat.
Self-hosting: the two paths compared
Both ship open weights, both are self-hostable, both are roughly the same size class (700B-class MoE for GLM 5.2; DeepSeek V4 is also a large MoE).
DeepSeek V4 has been in the wild for months. The vLLM, TensorRT-LLM, and SGLang teams have shipped multiple rounds of optimizations specifically for V4's MoE structure. Hosted inference is available from every major provider (Together, Fireworks, DeepInfra, Groq, OpenRouter), often at sub-$0.50 per million tokens for V4-Flash equivalents. Quantized variants (4-bit, FP8) are well-tested and ship with usable quality.
GLM 5.2's weights drop the week after launch (target: late June 2026). Inference-engine support typically follows by 1-2 weeks for major engines. Hosted endpoints arrive on similar timelines. Plan for an extra month of maturation before treating GLM 5.2 self-hosting as production-grade. If you need open weights today, DeepSeek V4 is the safer call. If your timeline is “Q3 2026 or later,” GLM 5.2 is fully in scope.
For the operational playbook around self-hosting decisions at this scale, see our self-hosting LLMs guide.
Does multi-modal matter here?
Correction (August 2026): neither model is multi-modal. An earlier version of this comparison described DeepSeek V4-Pro as accepting vision input. It does not — both V4-Pro and V4-Flash are text-only, per DeepSeek's own API docs. GLM 5.2 is likewise text + code only.
So if your coding work touches screenshots, design specs, mockups, or any image-to-code step, neither of these two answers it. You need a vision-capable model (Claude Opus 5, GPT-5.6, Gemini 3.5) for that stage and can still route the pure-text work — which is the bulk of agentic coding volume — to whichever of these two wins on cost.
For pure-text agentic coding, the case for most engineering teams, modality is a non-issue on both sides.
Who should pick GLM 5.2?
- Repo-scale agents. 1M context is the only realistic answer for agents that need full-codebase awareness without RAG.
- Shops already on the GLM Coding Plan. The flat-rate predictability + the bundle of Z.ai tooling around it is the package.
- Teams that want the newest open-weights research target. MIT license, fresh release, room to fine-tune on internal code.
Who should pick DeepSeek V4?
- High-volume API workloads. V4-Flash's $0.14 / $0.28 pricing is the lowest you'll find for a serious coding model. Burst a million bug-triage runs through it at near-zero cost.
- Cache-heavy agent loops. V4-Pro cache reads are $0.003625/M — about 0.83% of its input price, where the Western labs all price cache reads at 10% of input. On a loop that re-reads a stable project context every turn, that is where DeepSeek's cost advantage actually compounds rather than just looking good on a rate card.
- Production agents that need the model today. The hosted inference and self-hosting ecosystem is mature. GLM 5.2's hosted endpoints will take 1-2 weeks to catch up.
- Teams that need single-shot code generation more than long-horizon agent loops. The published SWE-bench Verified numbers are public and strong.
The decision in a line
If you've already mapped your workload as either “repo-scale autonomous agent” or “high-volume single-shot completion,” the answer is direct: GLM 5.2 for the former, DeepSeek V4 for the latter. If your workload is somewhere in between, run both side-by-side on a representative task this week. The per-task cost gap and the per-task quality gap both reveal themselves in fewer than 10 runs.
Post-launch reality (June 15, 2026)
Two days after Z.ai shipped GLM 5.2 on June 13, here is what is actually confirmed vs still pending. We are pulling from the launch announcement, the Hacker News reception thread, vendor docs, and early third-party reviewers.
What is live today on the Coding Plan
- GLM 5.2 access ships included on every Coding Plan tier at no extra cost: Lite
$10/mo, Pro$30/mo, Max$80/mo, plus seat-based Team pricing. Quarterly billing drops the same tiers to roughly $27 / $81 / $216 per quarter. - Drop-in tool integrations confirmed at launch: Claude Code, Cline, OpenCode, Roo Code, Goose, Crush, OpenClaw, Kilo Code — all via the OpenAI-compatible endpoint (three
settings.jsonchanges for Claude Code; nothing custom needed). - Cursor, Continue and Aider are NOT yet wired. Cursor has an open community thread requesting GLM-5 support but no merged work; expect community config repos in the weeks after the open-weights drop.
- Two thinking-effort levels exposed:
HighandMax— no Low/Auto. Thinking adds roughly 30-80% to first-token latency and roughly halves throughput on long runs.
What is still pending (as of June 15)
- Standalone per-token API not yet live on
open.bigmodel.cn/z.ai/pricing. Z.ai said "next week" on launch day. For sizing, GLM 5.1 standalone runs$1.40 input / $4.40 outputper M tokens; expect GLM 5.2 to land near or below that. - MIT-licensed open weights not yet on Hugging Face. Promised "next week" — track
huggingface.co/zai-orgfor theGLM-5.2repo and a matchingGLM-5.2-FP8companion, mirroring the 5.1 release pattern. - Hosted-provider endpoints (Together, Fireworks, DeepInfra, Groq, OpenRouter) — none list GLM 5.2 yet because the weights are not public. Expect 3-10 day catch-up after the MIT drop based on the GLM 5.1 cadence; Fireworks and DeepInfra were first on 5.1.
- chat.z.ai still serves GLM 5.1 in the free chatbot tier; 5.2 chatbot rollout is part of the same "next week" batch.
What independent benchmarks exist
Honest answer: none on the standard suites yet. As of 48 hours post-launch no third party has published SWE-bench Verified, SWE-bench Pro, LiveCodeBench, Terminal-Bench 2.0, AIDER Polyglot, GPQA Diamond, or HumanEval scores specifically for 5.2. Artificial Analysis, vals.ai, lmcouncil.ai and the SWE-bench Pro Leaderboard all showed GLM 5.1 as the most recent Zhipu entry at that point, so anyone quoting a SWE-bench number for 5.2 in mid-June was conflating it with 5.1. Updated August 14, 2026: those boards have since scored 5.2 itself — Artificial Analysis Intelligence Index 53, vals.ai SWE-bench Verified 82.80% (#14), LiveBench 73.2, LMArena 1471. GLM-5.3, released August 14, appears on none of them, because Z.ai shipped it without a public API and independent evaluators need one to run their harnesses.
What we DO have: the GLM 5.1 baseline holds well — 58.4 on SWE-Bench Pro (state-of-the-art at that time, narrowly ahead of GPT-5.4 and Claude Opus 4.6), 63.5 on Terminal-Bench 2.0 standalone (66.5 with Claude Code scaffolding), 68.7 on CyberGym, 70.6 on τ³-Bench, 71.8 on MCP-Atlas Public Set. If 5.2 holds these gains while extending to 1M context, it is a peer-class flagship; that is the bet community devs are taking until the third-party runs land.
Community sentiment after the first 48 hours
The Hacker News reception thread (269+ points, 146 comments within hours) split into two consistent camps:
- Positive — "punches above its weight" on UI/design code, code taste, and modern conventions. One commenter described shipping a non-trivial GTK/Rust/Lua app where "GLM wrote 93%." Another flagged 1M context as the upgrade most likely to matter in practice: stop chunking files, just dump the relevant subset.
- Cautious — "about six months behind the frontier labs, similar to Opus in January" on architecture-heavy, multi-file reasoning. Run-to-run variance and harness sensitivity (Terminal-Bench swung 40.4% → 48.3% on GLM 5 depending on agent wrapper) are unresolved carry-overs from earlier GLM releases.
The HN top comment captures the practical verdict: "Test it today if you are already on the Coding Plan; do not rebuild your stack around it until third-party benchmarks land next week."
Architecture details that matter for capacity planning
Same architecture family as GLM 5/5.1: 744B total parameters / ~40B active per token, 384 experts, 61 layers with Multi-head Latent Attention, DeepSeek Sparse Attention for the long context, 28.5T pretrain tokens. For self-host capacity planning the practical numbers are:
- BF16 weights: ~1.65 TB on disk
- FP8 weights: ~800 GB on disk
- AWQ/GPTQ INT4: ~200 GB on disk
- Production sweet spot: 8× H200 SXM (1,128 GB HBM) at FP8 with room for the 1M-token KV cache. 8× H100 80GB (640 GB) is too tight for FP8 + long context — works only at ≤128K with aggressive KV offload.
- vLLM and SGLang already have GLM 5/5.1 recipes that 5.2 will load on the same code paths once the config drops. TensorRT-LLM lags by a few weeks on new architectures.
Legal and compliance notes
- The MIT license, when it ships, has no field-of-use restrictions, no MAU threshold, and no acceptable-use clause. The only obligations are the standard copyright-notice + no-warranty boilerplate.
- Zhipu has been on the US BIS Entity List since January 15, 2025. Downloading and using MIT-licensed open weights is not a regulated export under current EAR readings, BUT US federal customers and most defense primes will not approve a Chinese-origin model regardless of license — treat as effectively blocked for FedRAMP, DoD, and IC workloads.
- EU AI Act: GLM 5.2 is a GPAI model with likely systemic-risk-tier compute (10^25 FLOPs). Zhipu has not signed the GPAI Code of Practice and has not published a model card or training-data summary, which leaves the full Article 53 burden on downstream EU deployers. Finance, health and critical-infrastructure use cases need to wait for Annex XI documentation.
Bottom line vs DeepSeek V4: for single-shot high-volume API workloads, DeepSeek V4-Flash at $0.14 / $0.28 per M is still the cheapest serious coding API in the market. For repo-scale agent loops needing 200K+ context with predictable monthly billing, GLM 5.2's Coding Plan is the structurally different (and often cheaper-at-scale) play. The crossover is workload-shape dependent — run both on 100 of your real tasks and compute per-task cost before committing.
FAQ
Is GLM 5.2 better than DeepSeek V4 for coding?
On long-horizon agentic coding (multi-step refactors, repo-scale planning), GLM 5.2 inherits the agentic-RL training that made GLM 5.1 a leader on SWE-Bench Pro and Terminal-Bench 2.0, plus a 1M context window. On single-shot code generation and high-volume API calls, DeepSeek V4 has more public mileage, a proven SWE-bench Verified score in the high 80s, and a per-token rate that's hard to beat.
Which is cheaper, GLM 5.2 or DeepSeek V4?
DeepSeek V4-Flash at $0.14 input / $0.28 output per M tokens is currently the cheapest serious coding API (rising to $0.22 / $0.66 off-peak and $0.44 / $1.32 at peak from August 16, 2026). GLM 5.2's standalone API pricing isn't disclosed yet but is expected in the $1-2 / $3-6 range based on GLM 5.1's API. For predictable bulk inference, the GLM Coding Plan's flat-rate tier is the cleaner economics; for pay-as-you-go, DeepSeek V4 wins.
Can I self-host both models?
Yes. DeepSeek V4 has months of inference-engine optimization behind it. GLM 5.2's MIT-licensed open weights drop the week after launch; engine support is typically 1-2 weeks behind. Both need 4-8 H100s for serviceable serving at full context.
Does DeepSeek V4 support 1M-token context?
Yes. Both V4-Pro and V4-Flash run a 1,048,576-token context window with up to 384K max output. An earlier version of this article said 128K–256K; that was wrong. Full-repo awareness is available on either model, so the choice between GLM 5.2 and DeepSeek V4 comes down to billing shape and agentic quality, not context capacity.
Does GLM 5.2 support image inputs?
No — and neither does DeepSeek V4. Both GLM 5.2 and both DeepSeek V4 tiers are text + code only. For image-to-code workflows you need a separate vision-capable model such as Claude Opus 5, GPT-5.6 or Gemini 3.5.
Is DeepSeek V4 pricing changing in August 2026?
Yes. From 16:00 UTC on August 16, 2026 DeepSeek replaces its flat per-token rate with peak/off-peak pricing on both V4 models, with peak hours at 01:00–04:00 and 06:00–10:00 UTC. V4-Flash goes to $0.22 / $0.66 off-peak and $0.44 / $1.32 at peak; V4-Pro to $0.66 / $1.98 and $1.32 / $3.96. Off-peak is not cheaper than today — every tier costs more than the current flat rate. See our DeepSeek V4 August 2026 price change guide.