← all posts
// models · glm

GLM-5.1: Finding the production fit

GLM-5.1 doesn't automatically deserve your default route. Qualify that fast: for agentic coding and long-horizon work it earns a real lane, for the rest of your traffic it's just another expensive option among models you've tuned around.

Z.AI documents GLM-5.1, not a 5.2, as its current leading coding model: 200K context, up to 128K output, agentic coding and long-horizon work, thinking, streaming tool calls, OpenAI-compatible access. Test against glm-5.1, and check the docs again: aliases, prices, and availability move.

People keep asking about "GLM-5.2." It isn't listed in current Z.AI documentation, so this piece uses GLM-5.1, not a version invented for sounding newer. The same churn shows up locally, same as ollama model churn: a rumored tag treated as real months early.

Decide what a pass looks like before the first prompt

Skip the leaderboard. Start from the request: deadline, evidence, tools touched, cost of a wrong answer. Define success so a script or reviewer can check it without opinion. Extraction: a schema-valid record traceable to source. Coding: a patch that passes tests and review. Research: a claim set with sources you can follow.

Fluent is not the same as correct, and a router that can't tell the difference isn't a router.

Label real requests by difficulty, latency, context size, and consequence, then compare completed tasks, not impressive transcripts. Keep the full request: instructions, tool schemas, files, sampling or reasoning settings, output limits. A model looks different with native tool calls versus pasted terminal output, so hold the workflow constant across providers.

Don't let the plausible answer be the expensive one

The costly mistake: making the newest model default for everything, including routine work that didn't need it. Frontier output reads smoothly enough to hide the mistake, so measure it instead. Check what code can verify, have reviewers name concrete defects, keep every wrong output. Failures teach more about routing than another folder of successes.

Long context deserves the same suspicion. A bigger window doesn't erase prefill time, filter retrieval noise, or separate instructions from pasted-in data. Cache the stable prefix, keep volatile metadata off that boundary, send a checkpoint instead of full history. Output needs the same restraint: a short decision with evidence beats an unsolicited tutorial.

Tool use changes the risk math in ways better function selection doesn't fix. The app still validates arguments, authorizes the caller, caps side effects, catches duplicates, and logs outcomes. Web pages, files, and tool results are input, not instructions. A sharper model is no substitute for a narrower interface.

Write the lane into config, not into memory

Give the model a narrow default lane and a defined escalation path, in configuration, not in whoever remembers what's fashionable this month. Log model identity, phase timings, token categories, tool outcomes, and evaluation results, and skip retaining sensitive prompt content by default.

Keep a cheap, fast lane for routine work and a clear trigger for escalation. The expensive model should see only requests that benefit from it, not everything the gateway can send it. And a cheap lane stops being cheap once retries and review outrun the inference it saved.

Treat version changes as ordinary operations, the way model migration reality argues: pin dated versions, watch deprecation notices, canary new aliases before they take all traffic, keep a known-good fallback. Re-run the evaluation set whenever the model, prompt, tool contract, or reasoning default changes: any of those can move your numbers.

Do that and GLM-5.1 becomes one more entry in the stack, measured like everything else: what it completes reliably, what that costs, when the router should reach elsewhere.

One caveat: building labeled eval sets and config-driven routing for every release is real work, and for a small team it can cost more engineering time than it saves. Sometimes the right call is picking the obviously fine model and revisiting later.

#glm#zai#coding#evaluation