AI agents · OpenClaw · self-hosting · automation

Quick Answer

Kimi K2.7 Code vs DeepSeek V4 Pro vs GLM-5.2: Best Open-Weight Coding Model (July 2026)

Published:

The Open-Weight Coding Race (July 2026)

Three Chinese labs now dominate the open-weight coding leaderboard: Moonshot’s Kimi K2.7 Code, DeepSeek’s V4 Pro, and Zhipu’s GLM-5.2. All three ship open weights, allow commercial use, and cost a fraction of Claude Sonnet 5 or GPT-5.6 Terra.

Here’s how they compare as of July 9, 2026.

Quick Comparison

MetricKimi K2.7 CodeDeepSeek V4 ProGLM-5.2
SWE-bench Pro58.6%~60%~62%
HumanEval Pass@1~93%91.2%~94%
Context Window200K1M256K
API Input/Output ($/MTok)$0.95 / $4.00$1.74 / $3.48~$1.20 / $6.00
OpenRouter Price$0.75 / $3.50$1.50 / $3.00$1.10 / $5.50
Weights LicenseModified MITDeepSeek OSSGLM-5 (commercial rider)
Best Hardware1x H200 or 2x H1004-8x H1003-4x H100
Multimodal InputText + ImageTextText
Best ForEfficient coding, structured tasksLong-context agents, price-perfHighest raw quality

Head-to-Head Analysis

SWE-bench Pro (Real-World Coding)

GLM-5.2 leads at ~62%, followed by DeepSeek V4 Pro at ~60% and Kimi K2.7 Code at 58.6%. For context: Claude Sonnet 5 sits at 63.2% and Claude Fable 5 at ~68%. The gap between the best open weights and the best closed frontier models has narrowed to ~6 SWE-bench points as of July 2026.

Context Window

DeepSeek V4 Pro’s 1 million-token context is the standout — it matches Claude Sonnet 5 and beats every other open-weight model. That makes V4 Pro the best choice for whole-codebase reasoning, long agent trajectories, and RAG-heavy workflows. Kimi K2.7 Code’s 200K is generous for chat coding but tight for long agent runs.

Real Cost per Task

For a typical “fix this bug” task (~30K input tokens, ~5K output tokens):

ModelCost per TaskCost per 1000 tasks
Kimi K2.7 Code (OpenRouter)$0.040$40
DeepSeek V4 Pro$0.070$70
GLM-5.2$0.066$66
Claude Sonnet 5 (intro)$0.110$110
Claude Sonnet 5 (post Aug 31)$0.165$165
GPT-5.6 Terra$0.150$150

Kimi K2.7 Code is the cheapest per task, at about 25% of Claude Sonnet 5’s post-intro price.

Self-Hosting

Kimi K2.7 Code is the friendliest to self-host — it fits on a single H200 (141GB) at 4-bit or 2 H100s at 8-bit. The vLLM community has stable serving recipes; expect ~180 tok/s per H100 pair.

DeepSeek V4 Pro needs 4-8 H100s or an equivalent Huawei Ascend 910C cluster. The MoE architecture keeps active parameters manageable, but weights are still 685B total. Not a startup-scale deployment.

GLM-5.2 sits at roughly 3-4 H100s for reasonable throughput. Weights are ~340B dense.

License Fine Print

  • DeepSeek V4 Pro — DeepSeek Open Source License, permissive commercial use, attribution required.
  • Kimi K2.7 Code — Modified MIT, one of the most permissive frontier-model licenses.
  • GLM-5.2 — GLM-5 license with a rider on scale-out commercial deployments (>100M monthly requests requires a paid agreement). Read Zhipu’s license before enterprise deployment.

Decision Framework

What matters most?

├── Absolute cheapest per token
│   → Kimi K2.7 Code via OpenRouter ($0.75/$3.50)

├── 1M-token context (long agent runs, whole codebases)
│   → DeepSeek V4 Pro

├── Highest raw coding score
│   → GLM-5.2 (but read license rider first)

├── Easiest self-host on modest hardware
│   → Kimi K2.7 Code (1x H200 or 2x H100)

├── Best paired with Cline, Aider, Roo Code today
│   → DeepSeek V4 Pro (most battle-tested)

└── Multimodal (image + code)
    → Kimi K2.7 Code (only one of the three with vision)

What Changed in July 2026

  • Kimi K2.7 Code replaced K2.6 on June 15 with a 200K context (up from 128K) and improved SWE-bench scores.
  • GLM-5.2 launched June 25 as Zhipu’s answer to Fable 5, taking the SWE-bench Pro lead among open weights.
  • DeepSeek V4 Pro got a July 2 refresh focused on tool-calling reliability — noticeably better in agent frameworks now.

The Bottom Line

For July 2026, the smart open-weight coding stack is:

  1. Default: DeepSeek V4 Pro — best all-round for agent workflows, 1M context, reliable tool-calling.
  2. Cheapest: Kimi K2.7 Code via OpenRouter — best price-per-task if you don’t need long context.
  3. Best quality: GLM-5.2 — highest SWE-bench Pro, but check the commercial license.

For teams that want the best price-performance without touching Chinese-lab weights, DeepSeek’s Ascend-hosted API in Singapore or OpenRouter routing are the two safest patterns as of July 9, 2026.

Sources