Groundwork

Open-weights models

Open models are the option you own.

GLM is the leading open-weights model family for coding and agentic work, and it stands here for a whole category: models whose weights you can download, run locally, or point any agent at. Knowing how to use one keeps every vendor honest.

When you'll want this You want a capable model without a subscription, need work to stay on your own machine, or want to understand what "open weights" buys you as leverage.

#What "open weights" means, and why you care

A frontier lab like Anthropic or OpenAI serves its models only through its own apps and APIs. An open-weights model publishes the model file itself — you can download it and run it on hardware you control, and the copy you hold can't be re-priced or turned off underneath you. One precision that matters: "open weights" is a distribution fact, not a rights guarantee. What you may do with the model — commercial use, modification, redistribution — comes from each model's specific license, so read it the way you'd read any dependency's (GLM's is MIT, one of the most permissive). For an agentic engineer this is not ideology; it is leverage: the skill of pointing your tools at any model means no single vendor owns your workflow.

#Meet GLM

GLM is the flagship open-weights family from Z.ai — formerly Zhipu AI, a Tsinghua University spinout that rebranded internationally in 2025 and listed on the Hong Kong Stock Exchange in January 2026 — and the standard-bearer for this category. GLM-5.2, released mid-2026, is a mixture-of-experts model: roughly 744 billion parameters in total, but only about 40 billion of them activate for any given token, which is what keeps a model this large affordable to serve at all. On Terminal-Bench 2.1 — a public test of how well a model works a real terminal — it scores 81.0, a few points behind Claude Opus 4.8 (85.0) and GPT-5.5 (84.0), the closed models Z.ai publishes comparisons against; on SWE-bench Pro, which measures fixing real bugs in real repositories, it scores 62.1, ahead of GPT-5.5 (58.6) though still behind Opus (69.2). That is the honest shape of it: GLM-5.2 leads every other open-weights model on the benchmarks that matter for agent work, and sits close enough to the closed frontier to be a real choice rather than a consolation prize. You can use it three ways, in rising order of ownership:

Hosted API & coding plansZ.ai serves GLM through an API and a subscription GLM Coding Plan (Lite, Pro, and Max tiers, priced from roughly $18 to $160 a month as of mid-2026) that plugs directly into coding agents including Claude Code, Cline, and OpenCode.
Hosted by othersThe weights are MIT-licensed and published on Hugging Face under the zai-org organization, so third-party providers can serve GLM too — you can pick a host on price, region, or privacy terms.
Run it yourselfDownload the weights and run them on your own hardware. The full 744-billion-parameter model needs serious multi-GPU infrastructure; a smaller variant such as GLM-4.7-Flash (30 billion parameters, 3 billion active) is the realistic option for a single well-equipped machine.

#Point a coding agent at GLM

Using GLM as an agent's backing model doesn't mean switching tools — it means swapping the endpoint the tool already talks to. Z.ai documents this pattern for three agents directly: Claude Code, Cline, and OpenCode. For Claude Code, the GLM Coding Plan adds two settings to ~/.claude/settings.json:

ANTHROPIC_BASE_URLZ.ai's Anthropic-compatible endpoint (https://api.z.ai/api/anthropic), so requests route to GLM instead of Claude.
ANTHROPIC_AUTH_TOKENA Z.ai API key, created from the Z.ai open platform.

Everything else about the session — permissions, hooks, AGENTS.md — stays exactly as configured; only the model behind the conversation changes. That is the general shape of the open-model ecosystem, not just Z.ai's: most serving options speak an OpenAI- or Anthropic-compatible API, so an agent that lets you set a base URL and a key can usually be pointed at any model behind it, hosted or local.

#Local models on this machine

Groundwork installs Ollama, a local model runtime that downloads and serves open models on your machine at localhost:11434. It is the shortest path to a model that works with the network cable unplugged:

ollama run <model>Download (first run) and chat with a model in the terminal.
ollama psShow what's loaded, its size, and whether it's running on your machine or as a :cloud model — the local equivalent of a usage gauge.
ollama lsList the models you've downloaded and what they cost in disk.

GLM is in Ollama's library, but check which GLM before you pull anything multi-gigabyte. glm-5.2 is listed only as a glm-5.2:cloud tag, meaning Ollama proxies the request to its own cloud infrastructure instead of running the full model on your machine — it needs an ollama.com account and a network connection, the same tradeoff as any hosted model. The smaller GLM-4.7-Flash (30 billion parameters, 3 billion active) does download and run locally, at around 19 GB for its smallest build — enough that it wants a machine with generous memory, not an entry-level one.

For a first local model that any modern machine can hold comfortably, reach for something smaller. Google's Gemma 3 1B is a fast, well-documented pick for getting the workflow under your fingers before you reach for anything GLM-sized.

1

Try it now: run a model with the network off

Pull a small open model and ask it something, entirely on your own machine:

ollama
$ ollama pull gemma3:1b
$ ollama run gemma3:1b "In one paragraph, explain what open model weights are."

The pull is under a gigabyte; the run loads the model and answers in seconds. Turn off Wi-Fi and run it again — it still works, because nothing left your machine.

The budget here isn't tokens or dollars — it's your machine's memory and patience. A model that fits comfortably answers fast; one that barely fits crawls and starves everything else. Know your AI budget covers reading that gauge.

#Honest tradeoffs

Local and open models are not a free replacement for the frontier. Even GLM-5.2, the strongest open-weights model available, still trails Claude Opus 4.8 on Terminal-Bench 2.1 and SWE-bench Pro — it is close, not ahead. And a model small enough to run comfortably on a laptop, like the Gemma 3 1B in the drill above, is well behind either one; it is a tool for learning the workflow and handling small local tasks, not for agentic coding on a real codebase. The point is options — knowing what the open tier can do at each size, what it costs to run, and when it's the right tool — so your choice of the frontier is a choice, not a dependency.

#References

  • Ollama — for a reader starting out: the local runtime Groundwork installs, and its Gemma 3 library page for the drill above.
  • Z.ai — for a reader deciding whether to try GLM hosted: models, API, and the GLM Coding Plan.
  • GLM Coding Plan docs — for a reader ready to point an agent at it: tiers, quotas, and per-tool setup for Claude Code, Cline, and OpenCode.
  • zai-org on Hugging Face — for a reader evaluating or self-hosting: every GLM release's weights, license, and model card, GLM-5.2 included.