Skip to main content
GLM is Z.ai’s (Zhipu’s) open-weight family, built for coding and agentic workflows, and released under the MIT license. The family spans a wide range: a small 9B model that pulls and runs on a single consumer GPU, a 106B-total mixture-of-experts model (GLM-4.5-Air) that needs a big-VRAM or unified-memory rig, and the current flagship GLM-5.2 — a ~frontier-scale MoE with a 1M-token context that is realistically a cloud or multi-GPU-server model, not something you pull onto a single workstation. This page leads with what actually runs locally, then covers GLM-5.2 for when you want Z.ai’s best model and either use a hosted endpoint or have the hardware to self-host it. Pair Tokios with whatever you land on to reach it from any machine, teammate, or hosted agent through https://api.tokios.com — no inbound ports, no VPN.

Run it locally with Ollama

For a true one-command local pull, use the small classic GLM-4:
This pulls glm4:9b (aliased to :latest), Z.ai’s ~9B dense model — the only GLM tag that installs weights straight to your machine. See the Ollama library page for the full tag list.
GLM-4.5-Air and GLM-5.2 are not Ollama local pulls. GLM-5.2 is listed on Ollama only as glm-5.2:cloud, which routes to Z.ai’s hosted infrastructure rather than downloading weights. To run GLM-4.5-Air yourself, use a GGUF build with llama.cpp or LM Studio — see below.

Variants & tags

Every value below is from each model’s Hugging Face config and the Ollama library. Tags and download sizes change as new quantizations ship — confirm against the linked pages before you standardize on one. Sources: ollama.com/library/glm4, ollama.com/library/glm-5.2, zai-org/GLM-4.5-Air model card, zai-org/GLM-5.2 model card, unsloth/GLM-4.5-Air-GGUF.
GLM-4.5-Air and GLM-5.2 are mixture-of-experts models: GLM-4.5-Air activates only 12B of its 106B parameters per token, and GLM-5.2 activates 8 of 256 experts. That keeps decoding fast relative to their total size, but all parameters still have to fit in memory (or be offloaded) — don’t size your hardware off the active-parameter count alone. See how inference works for why.

Quantization & formats

Ollama’s glm4:9b ships as GGUF. For GLM-4.5-Air, unsloth/GLM-4.5-Air-GGUF publishes a full quant ladder — Q2_K (~45 GB) up through Q8_0, plus Unsloth’s “UD” dynamic quants (for example UD-Q4_K_XL at ~68 GB) that trade a little size for better quality at the same bit-width. GLM-5.2 is currently distributed as full-precision safetensors for server-side inference (vLLM/SGLang) or accessed as a hosted/cloud endpoint — it isn’t a practical GGUF download yet. See Quantization formats and the hardware they need for the full matrix, and what quantization is for how to read Q4_K_M-style names.

Hardware fit

Treat every entry as an estimate — the ground truth is the actual GGUF size plus the KV cache for your context. See what size model fits your GPU? for the sizing math.

Run it — beginner to advanced

Leave Ollama listening on the default http://127.0.0.1:11434. This is glm4:9b — for GLM-4.5-Air or GLM-5.2, use one of the tabs below.

Capabilities

  • Reasoning: GLM-4.5-Air and GLM-5.2 are hybrid reasoning models — thinking mode for complex reasoning and tool use, non-thinking mode for immediate responses. GLM-5.2 adds adjustable thinking-effort levels to trade latency for quality. The small GLM-4 (glm4:9b) does not have this hybrid reasoning mode.
  • Native tool-calling: Yes, on GLM-4.5-Air and GLM-5.2. On vLLM/SGLang, set --tool-call-parser glm45 (paired with --reasoning-parser glm45); Ollama applies templates for you where a local tag exists.
  • Coding & agentic tasks: This is the family’s focus — Z.ai built GLM for agentic engineering, and GLM-5.2’s release emphasizes long-horizon coding-agent workflows specifically.
  • Long context: glm4:9b and GLM-4.5-Air are natively 131,072 tokens (128K). GLM-5.2 is natively 1,048,576 tokens (1M), positioned for project-level engineering context and long agent trajectories.

Connect it with Tokios

Once your GLM model is running — locally via Ollama, or self-hosted for GLM-4.5-Air/GLM-5.2 — pair the Tokios connector so you can reach it as https://api.tokios.com from Claude Code, Cline, or any other compatible client — instead of only from localhost.
1

Pair the Tokios connector

Sign in at tokios.com/console, open the Setup tab, and click Start pairing to get a one-time claim code (TKS-XXXX-XXXX). Install and run the connector on the machine running your model:
Windows
macOS
Linux
Then approve the device on the Setup or Connectors tab.
2

Point the connector at your model's API

Ollama exposes an OpenAI-compatible surface at /v1. For a single-model setup, the console’s Setup wizard fills this in automatically as http://127.0.0.1:11434/v1. LM Studio’s local server uses http://127.0.0.1:1234/v1. For vLLM/SGLang or multiple models, set the endpoint explicitly in tokios-connector.json — see Connector config.
3

Register a deployment

In the Models tab, register the model and choose a public deployment name, for example glm-tunnel. This name — not Ollama’s local model id — is what clients send in the model field.
4

Create an API key

In the Keys tab, click Create key. Copy the sk-tok-… key now — it’s shown only once.

Call it from anywhere

The model field is always your registered deployment name (glm-tunnel above), never Ollama’s local model id. See Use Claude Code and Use Cline for full client setup.

Caveats

  • GLM-5.2 is not a realistic single-GPU local model: on Ollama it’s glm-5.2:cloud only (no weight download), and its full-precision size puts self-hosting in multi-GPU-server territory. If you want GLM’s frontier tier without that hardware, use a hosted/cloud endpoint.
  • GLM-4.5-Air’s GGUF builds need a big-VRAM GPU or a large-unified-memory machine (Apple Silicon, Strix Halo) even at Q4-class quantization — it isn’t a fit for a single 24 GB consumer card.
  • Tool-call and reasoning parsing on GLM-4.5-Air/GLM-5.2 depend on the runtime applying the glm45 parser. If you self-host with vLLM/SGLang, pass the flags above explicitly or tool calls and thinking output won’t separate correctly.
  • The small glm4:9b doesn’t have the hybrid thinking mode or native tool-calling that GLM-4.5-Air and GLM-5.2 have — pick the tier that matches the capability you need, not just what fits your GPU.

Quickstart

Pair a connector and register your first model end to end.

What size model fits your GPU?

Match a GLM variant to your available VRAM before you pull it.

Quantization & hardware

Which of GLM’s formats — GGUF, safetensors — runs on your hardware.

Which local model for which task?

See how GLM compares to other local models by task.