modelgrep

Best Z.ai Models for Coding

Match · Updated July 2026

GLM 5.2 is the best Z.ai model for coding, with a 68.8 Artificial Analysis Coding Index across benchmarks like SWE-bench and SciCode. GLM 5.1 (55.8) and GLM 4.7 (45.3) round out the top three.

68.8Coding
51.1Intelligence
$0.966Input /M
1.0MContext

AI models ranked by the Artificial Analysis Coding Index, measuring real-world software engineering ability across benchmarks like SWE-bench, SciCode and terminal tasks. The best AI coding models for code generation, debugging and agentic development.

  1. 1z-ai logo
    glm-5.2
    ReasoningToolsJSON51.1 intel · $0.966/M · 1.0M ctx
    68.8
    Coding
  2. 2z-ai logo
    glm-5.1
    ReasoningToolsJSON40.2 intel · $0.966/M · 205K ctx
    55.8
    Coding
  3. 3z-ai logo
    glm-4.7
    ReasoningToolsJSON33.7 intel · $0.400/M · 205K ctx
    45.3
    Coding

Frequently asked

What is the best Z.ai model for coding?

GLM 5.2 is the best Z.ai model for coding, with a 68.8 Artificial Analysis Coding Index across benchmarks like SWE-bench and SciCode. GLM 5.1 (55.8) and GLM 4.7 (45.3) round out the top three.

What's a good alternative to GLM 5.2?

GLM 5.1 (55.8) is the closest alternative on this metric, followed by GLM 4.7 (45.3). See the full ranking above for the tradeoffs.

How many Z.ai models are there?

modelgrep tracks 12 Z.ai models with live benchmarks, speed, latency and per-provider pricing, led on intelligence by GLM 5.2. 3 of them qualify for this ranking.

More Z.ai rankings

All rankings