← all posts
// models · glm

GLM-5.1: A coding workflow that survives the demo

People have wired up a model that does not exist. It happens more than anyone admits: someone types a name into a router config, and three sprints later the team is debugging timeouts against "GLM-5.2," a release nobody at Z.AI ever shipped. The current documented coding model is GLM-5.1, not the point release everyone assumed had already landed.

It ships with a 200K context window and up to 128K output, built for agentic coding and long-horizon work: thinking mode, streaming tool calls, an OpenAI-compatible endpoint. The identifier you want in a config file is glm-5.1, lowercase, hyphenated, unglamorous. Check the vendor's docs before you implement anything, since aliases, prices, and availability move faster than any article.

Run it on the repo you actually own

Decide what counts as done before the first prompt. Fluency is not the finish line. A schema-valid record for extraction, a patch that passes tests and survives review for coding, a claim set with traceable sources for research: none of it bends because a completion reads well.

Run a small fixture set against real work: bug fixes, a multi-file refactor, a test that was already failing, a question about code the model has never seen. Give every candidate model identical tool permissions and acceptance checks, and keep the request intact: system instructions, tool schemas, real files, production sampling or reasoning settings, the output cap. A model looks brilliant when its harness hands it native tools and half-finished when another harness pastes it raw terminal output. Hold the workflow constant. Let each provider use its own documented format.

Log these fields every run, or you cannot tell a fluke from a trend:

  • model ID and the dated API version behind it
  • prompt and tool-schema revision
  • input, cached input, reasoning, and output tokens
  • queue time, time to first token, total completion time
  • task pass, retry, abstain, human-repair counts
  • provider errors and which fallback route fired

Long context is not a free pass. A bigger window does not erase prefill time, does not filter retrieval noise, and does not separate trusted instructions from untrusted documents. Put stable prefixes first when the API caches them, keep volatile metadata off the cache boundary, and send a structured checkpoint instead of full history when a checkpoint will do. The same restraint applies on the way out: a short decision plus its evidence beats a tutorial nobody asked for.

Tool calling changes the risk more than the convenience. A provider can get better at picking which function to call, fine, but your application still validates every argument, authorizes the caller, caps the blast radius, and logs what happened. Web pages, files, emails, and tool results are data. Treating any of it as an instruction is how you get burned. A sharper model is not a substitute for a narrower interface.

Where the demo quietly lies to you

The costliest mistake is judging a coding model on an isolated, greenfield prompt, one that never has to open an existing file or repair a test it just broke. Frontier models make this easy to miss; almost every response looks plausible at a glance. Measure properties ordinary code can verify, have reviewers flag concrete defects instead of vibes, and keep the runs that failed. A drawer of failures teaches you more about where this model belongs than another folder of clean demos.

Once that evidence exists, the decision gets boring on purpose: route coding tasks by measured outcome on the repositories your team actually maintains, and require tests plus a diff a human can read before anything merges. Put that rule in configuration, not a wiki page nobody rereads. Keep a cheap, fast lane for routine work, and build a real escalation dial for the expensive model instead of sending it everything by default. A discount tier stops paying for itself once its retries and review overhead cost more than the inference it saved.

Treat migration like any other change to production, not a special occasion. What breaks when a team swaps models is rarely what anyone expected, the case for taking migration seriously instead of skimming a changelog. Pin dated versions where stability matters and canary a new alias before it takes all your traffic. Keep a known-good fallback ready. Re-run the local evaluation set the moment the model, the prompt, the tool contract, or the reasoning default changes underneath you.

None of this crowns GLM-5.1 a permanent winner. The point is knowing which work it completes reliably, what that costs, and the moment the router should reach for something else instead.

If I kept exactly one rule out of all this: no model, however capable, skips the tests and the human-readable diff. Everything else is negotiable.

#glm#zai#coding#evaluation