---
title: "GLM-5.2: An Open Model That Codes Like a Closed One"
url: "https://www.morphllm.com/blog/glm-5-2"
description: "Z.ai's GLM-5.2 lands within a few points of Claude Opus 4.8 on agent benchmarks at a fraction of the cost. Open weights don't serve themselves — here's how we make it fast, and how to reach it on Morph and OpenRouter."
date: "2026-07-01"
author: "Tejas Bhakta"
---
# GLM-5.2: An Open Model That Codes Like a Closed One

GLM-5.2 came out on June 13, and I did what I always do with a new open model. Opened the eval sheet before I read a word of the announcement. Z.ai had put the weights up under MIT, a 744B mixture-of-experts with a 1M-token context, and the scores were the reason to keep reading. On the benchmarks that tell you whether a model can hold its own inside a coding loop, it lands just under Claude Opus 4.8 and above GPT-5.5. Then I checked the price. A sixth of Opus.

Here's what Z.ai reported, at max thinking effort:

<table>
  <thead>
    <tr><th>Benchmark</th><th>GLM-5.2</th><th>GPT-5.5</th><th>Claude Opus 4.8</th></tr>
  </thead>
  <tbody>
    <tr><td>SWE-bench Pro</td><td>62.1</td><td>58.6</td><td>—</td></tr>
    <tr><td>Terminal-Bench 2.1</td><td>81.0</td><td>—</td><td>85.0</td></tr>
    <tr><td>MCP-Atlas (tool use)</td><td>77.0</td><td>75.3</td><td>77.8</td></tr>
    <tr><td>FrontierSWE</td><td>74.4</td><td>72.6</td><td>75.1</td></tr>
  </tbody>
</table>

Vendor-reported, vendor's own harness, independent evals still coming in. Take them as directional. What matters is the gap. Twelve months back, open weights lost to the closed frontier by a whole generation on anything agentic. This one loses by a rounding error on tool use and long-horizon coding. And you can just download it.

Nobody puts this part on the launch slide. **Open weights don't serve themselves.**

## A 744B MoE at batch 1 is a bandwidth problem

Download GLM-5.2, point vLLM at it, and you get a model that's correct and slow. The weights aren't the problem. The default serving stack was written for a different workload than the coding agent.

An agent generates one request at a time. It waits on the last token before it can plan the next tool call. That's batch 1, and at batch 1 decode is memory-bound. The matmul reads every active expert's weights once per token and does almost no arithmetic per byte. Tokens per second is bandwidth divided by bytes touched. Your only lever is the bytes, and the stock kernels hand the win right back. They store the weights in FP4, then dequantize to bf16 in HBM before the tensor core ever sees them, giving away the 4x they just saved.

We wrote up the full stack in [Optimizing Models to Be Fast at Codegen](/blog/codegen-inference-research). Three things the open stack won't do, applied to GLM-5.2.

**Train the speculator.** A small draft model guesses the next few tokens and the target checks them in one pass. A generic draft off the internet gets [1.93x; one trained on the target's own coding output gets 3.07x](https://arxiv.org/html/2503.01840v1). Code is the highest-speedup task there is. Generated code reuses the symbols already on screen, and an edit is mostly a copy of the file it edits. We train one drafter per open model on coding traces, not web text.

**Keep FP4 at 4 bits.** A real FP4 decode kernel streams the packed weights straight to Blackwell's tensor cores and never materializes bf16. It's a grouped GEMM over only the active experts, persistent so every SM stays resident at batch 1. Our [warp-decode kernels](https://github.com/morphllm/fp4-warp-decode) run an 80B MoE at 162 tok/s on a $7K card, past a $25K H100's 120, with no accuracy loss.

**Write the interconnect.** The affordable GPUs have no NVLink, and PCIe moves 14x less. We swap NCCL's ring all-reduce for a one-shot push over PCIe P2P, overlap it with the next layer's GEMM, and cross NVLink-denied boxes with a prefix cache over plain TCP.

These are the same GLM-5.2 weights you can pull from Hugging Face. Ours run faster because the speculator riding them was trained, by us, on the work.

## Why this model, specifically, is worth tuning for

Every layer of that stack points at one workload: the coding agent. GLM-5.2 is a good bet to point it at, for two reasons that show up right on its eval sheet.

The 1M context means whole repositories and long agent trajectories fit without eviction. The [37x-to-2,494x prompt-to-output ratio](https://arxiv.org/html/2407.00023v2) of programming traffic is exactly the regime where a hot prefix cache pays for itself. And the benchmarks it's strongest on, MCP-Atlas and Tool-Decathlon, are tool-use benchmarks, not chat. That's the direction everything is going. [Every agent becomes a coding agent](/blog/all-agents-coding-agents): the moment an agent has to touch a real system, the general path is to write and run code. A model that scores 77 on tool orchestration and holds a repo in context is built for that loop.

## Using it on Morph

It's one OpenAI-compatible endpoint. Change the model string, keep your client:

```typescript
import OpenAI from "openai";

const client = new OpenAI({
  baseURL: "https://api.morphllm.com/v1",
  apiKey: process.env.MORPH_API_KEY,
});

const res = await client.chat.completions.create({
  model: "morph-glm53-744b",
  messages: [{ role: "user", content: "Refactor this module..." }],
});
```

Served per token, billed at $1.25 / 1M input and $4.40 / 1M output, with no per-seat fees and no minimums. (Pricing updated November 27, 2026: Morph now serves GLM-5.3 as `morph-glm53-744b`, at $1.68 / 1M input and $5.28 / 1M output.) The [full lineup](/products/models), MiniMax M3, DeepSeek V4 Flash, GLM-5.3, sits behind the same base URL, so switching models is a one-string diff.

## On OpenRouter, too

GLM-5.2 lists 13-plus providers on [OpenRouter](https://openrouter.ai/z-ai/glm-5.2), and the router sends your request to whichever one fits your price or latency constraint. The providers are not interchangeable. Published output speeds for the same weights range from the low 300s to 471 tok/s, because serving is where the model gets fast or stays slow. That's the exact gap this post is about.

Morph is already a [top-10 provider on OpenRouter](https://openrouter.ai/morph). Now the open models we tune for codegen, GLM-5.2 among them, are reachable there as well as directly. Route through OpenRouter, pin Morph, and you get the codegen-tuned path: the trained speculator, the FP4 kernels, the hot prefix cache. Call us directly and you already have it.

Open weights closed the quality gap. A team still defaulting to a closed frontier model isn't protecting quality anymore. The eval sheet took that argument away. They're paying six times the price for a habit. The speed gap that's left is a serving problem, and serving is a choice. [Morph's inference stack is one import away.](https://docs.morphllm.com)
