> ## Documentation Index
> Fetch the complete documentation index at: https://docs.tokios.com/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> Tokios exposes private local models through https://api.tokios.com using an outbound-only connector tunnel.
> Use 'connector' for the local tokios-connector process.
> Use 'deployment' for the public model name in the API model field.
> Use 'upstream model id' for the model served by Ollama, llama.cpp, vLLM, LM Studio, or another local backend.
> API keys use the prefix sk-tok-. Connector tokens use the prefix ct-tok-.

# Run GLM 5.2 and the GLM family locally, from anywhere

> Serve Z.ai's GLM family — GLM-4 for a one-command local pull, GLM-4.5-Air for big-VRAM rigs, GLM-4.6 for multi-GPU servers, and the frontier GLM-5.2.

> [!NOTE]
>
> Last verified: 2026-10-14

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, `GLM-4.6` — a `357B`-total MoE flagship with a 200K-token context that requires multi-GPU serving, and the current frontier `GLM-5.2` — a 753B-total 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 the larger models for when you want Z.ai's best and either use a hosted endpoint or have the hardware to self-host. 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.

Looking for [GLM-5.3](https://docs.tokios.com/models/glm-5.3.md)? It launched on 2026-08-14 through Z.ai's API, built on the same base model as GLM-5.2, with weights released on 2026-08-27. That page covers its hardware profile and the breaking API change; this one covers the GLM models you can download and run today.

> [!TIP]
>
> Already running a GLM model locally? [Register it with Tokios](https://docs.tokios.com/setup/register-model.md) to reach it as `https://api.tokios.com` from any client.

## Run it locally with Ollama

For a true one-command local pull, use the small classic GLM-4:

```bash theme={"theme":{"light":"github-light","dark":"css-variables"}}
ollama run glm4
```

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](https://ollama.com/library/glm4) for the full tag list.

> [!NOTE]
>
> `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.

| Property | `GLM-4` (`glm4:9b`) | `GLM-4.5-Air` | `GLM-4.6` | `GLM-5.2` (flagship) |
| - | - | - | - | - |
| How you run it | Ollama, one command | `GGUF` via llama.cpp/LM Studio, or vLLM/SGLang | Multi-GPU vLLM/SGLang, or hosted API | Ollama Cloud (`:cloud`), a hosted API, or self-hosted vLLM/SGLang on multiple GPUs |
| Ollama tag | `glm4:9b` (alias `:latest`) | Not on Ollama for local pull | Not on Ollama for local pull | `glm-5.2:cloud` only (no local weight pull) |
| Download size | 5.5 GB (Ollama default quant) | \~68–73 GB (`GGUF` `Q4`-class) | \~178 GB (`Q4`-class) or \~89 GB (`Q2`) | Not distributed as a single download at this size class — hundreds of GB in `bf16`/`fp8` |
| Parameters | \~9B dense | 106B total / **12B active** (128 experts, 8 routed + 1 shared) | 357B total / **32B active** (160 experts) | 753B total / 8 active experts of 256 + 1 shared (78 layers) |
| Context window | 131,072 (128K) on Ollama | 131,072 native | 200,000 native (200K) | 1,048,576 native (1M) |
| Reasoning | — | Hybrid: thinking mode + non-thinking mode | Hybrid: thinking mode + non-thinking mode | Thinking with adjustable effort levels |
| Modalities | Text | Text | Text + vision | Text |
| License | MIT | MIT | MIT | MIT |
| Hugging Face | [`zai-org/GLM-4-9B-0414`](https://huggingface.co/zai-org/GLM-4-9B-0414) | [`zai-org/GLM-4.5-Air`](https://huggingface.co/zai-org/GLM-4.5-Air) | [`zai-org/GLM-4.6`](https://huggingface.co/zai-org/GLM-4.6) | [`zai-org/GLM-5.2`](https://huggingface.co/zai-org/GLM-5.2) |

Sources: [ollama.com/library/glm4](https://ollama.com/library/glm4), [ollama.com/library/glm-5.2](https://ollama.com/library/glm-5.2), [zai-org/GLM-4.5-Air model card](https://huggingface.co/zai-org/GLM-4.5-Air), [zai-org/GLM-4.6 model card](https://huggingface.co/zai-org/GLM-4.6), [zai-org/GLM-5.2 model card](https://huggingface.co/zai-org/GLM-5.2), [unsloth/GLM-4.5-Air-GGUF](https://huggingface.co/unsloth/GLM-4.5-Air-GGUF), [Z.ai GLM-4.6 blog](https://z.ai/blog/glm-4.6) (as of July 2026).

> [!TIP]
>
> `GLM-4.5-Air`, `GLM-4.6`, and `GLM-5.2` are mixture-of-experts models: `GLM-4.5-Air` activates only 12B of its 106B parameters per token, `GLM-4.6` activates 32B of its 357B parameters, 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](https://docs.tokios.com/concepts/how-inference-works.md) for why.

## Quantization & formats

Ollama's `glm4:9b` ships as `GGUF`. For `GLM-4.5-Air`, [unsloth/GLM-4.5-Air-GGUF](https://huggingface.co/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-4.6` is distributed as full-precision `safetensors` for multi-GPU server-side inference (vLLM/SGLang); community `GGUF` and `AWQ` quants exist on Hugging Face (for example [bullpoint/GLM-4.6-AWQ](https://huggingface.co/bullpoint/GLM-4.6-AWQ) at \~176 GB) but remain too large for single-workstation use. `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](https://docs.tokios.com/models/quantization-and-hardware.md) for the full matrix, and [what quantization is](https://docs.tokios.com/concepts/quantization.md) 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?](https://docs.tokios.com/guides/model-fit.md) for the sizing math.

| Target | `GLM-4` `9B` (5.5 GB) | `GLM-4.5-Air` (\~68–73 GB at `Q4`) | `GLM-4.6` (\~178 GB at `Q4`) | `GLM-5.2` (frontier) |
| - | - | - | - | - |
| RTX 3090 / 4090 (24 GB) | Comfortable | Won't fit | Won't fit | Won't fit |
| RTX 5090 (32 GB, Blackwell) | Comfortable, long context | Won't fit | Won't fit | Won't fit |
| RTX 6000 Ada / A6000 (48 GB) | Comfortable | Won't fit at `Q4`; needs heavy CPU offload | Won't fit | Won't fit |
| Apple Silicon (128 GB+ unified) | Comfortable | Comfortable at `Q4`-class quant | Won't fit | Not practical |
| AMD Strix Halo (ROCm/Vulkan, ≤128 GB) | Comfortable | Tight at `Q4`-class quant | Won't fit | Not practical |
| DGX Spark (128 GB unified) | Overkill | Comfortable | Won't fit — needs 2+ Sparks | Won't fit — 377 GB at INT4 needs 4 Sparks; see [feasibility details](https://docs.tokios.com/guides/dgx-spark-model-compatibility.md#glm-52-feasibility) |
| Multi-GPU server / cloud | Overkill | Comfortable | This is the intended tier — 2× RTX 5090 or a multi-GPU server at `Q4` | Self-host on multiple data-center GPUs, or use a hosted/cloud endpoint |

## Run it — beginner to advanced

> [tab] Ollama (easiest)
>
> ```bash theme={"theme":{"light":"github-light","dark":"css-variables"}}
> ollama run glm4
> ```
>
> 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.

> [tab] LM Studio (GUI)
>
> Search for **GLM-4.5-Air** in LM Studio's model catalog (or point it at [unsloth/GLM-4.5-Air-GGUF](https://huggingface.co/unsloth/GLM-4.5-Air-GGUF)), download a quant that fits your VRAM or unified memory, then start LM Studio's local server. It exposes an OpenAI-compatible API on `http://127.0.0.1:1234/v1`.

> [tab] vLLM (advanced)
>
> For `GLM-4.5-Air`, set the GLM reasoning and tool-call parsers explicitly:
>
> ```bash theme={"theme":{"light":"github-light","dark":"css-variables"}}
> vllm serve zai-org/GLM-4.5-Air \
>   --max-model-len 131072 \
>   --reasoning-parser glm45 \
>   --enable-auto-tool-choice \
>   --tool-call-parser glm45
> ```
>
> Add `--tensor-parallel-size <N>` to shard across GPUs. For `GLM-4.6`, swap the model id and use `--tensor-parallel-size 2` (or more) to shard the 357B weights across multiple GPUs:
>
> ```bash theme={"theme":{"light":"github-light","dark":"css-variables"}}
> vllm serve zai-org/GLM-4.6 \
>   --max-model-len 200000 \
>   --tensor-parallel-size 2 \
>   --reasoning-parser glm45 \
>   --enable-auto-tool-choice \
>   --tool-call-parser glm45
> ```
>
> For `GLM-5.2`, swap the model id and expect to need multiple high-memory GPUs to hold the full weights. Parser names are from [vLLM's reasoning outputs](https://github.com/vllm-project/vllm/blob/main/docs/features/reasoning_outputs.md) and tool-calling docs.

> [tab] SGLang (advanced)
>
> ```bash theme={"theme":{"light":"github-light","dark":"css-variables"}}
> python -m sglang.launch_server \
>   --model-path zai-org/GLM-4.5-Air \
>   --context-length 131072 \
>   --reasoning-parser glm45 \
>   --tool-call-parser glm45
> ```
>
> Add `--tp-size <N>` for tensor parallelism. SGLang registers the same `glm45` detector for both reasoning and tool-call parsing.

> [tab] Ollama Cloud / hosted (GLM-5.2)
>
> `GLM-5.2` isn't a local weight pull. On a machine with Ollama installed, `ollama run glm-5.2:cloud` routes requests to Z.ai's hosted infrastructure instead of running locally. Point Tokios at whichever endpoint you use for GLM-5.2 the same way you'd point it at any other OpenAI-compatible API.

## Capabilities

* **Reasoning:** `GLM-4.5-Air`, `GLM-4.6`, 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`, `GLM-4.6`, 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.
* **Vision input:** `GLM-4.6` accepts both text and images as input (as of July 2026, per the [Z.ai blog](https://z.ai/blog/glm-4.6)). The other GLM variants are text-only.
* **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-4.6` is natively 200,000 tokens (200K). `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](https://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:

```powershell Windows theme={"theme":{"light":"github-light","dark":"css-variables"}}
irm https://tokios.com/downloads/install/windows | iex; tokios-install -Code 'TKS-XXXX-XXXX'
```

```bash macOS theme={"theme":{"light":"github-light","dark":"css-variables"}}
curl -fsSL https://tokios.com/downloads/install/macos | sh -s -- --code TKS-XXXX-XXXX
```

```bash Linux theme={"theme":{"light":"github-light","dark":"css-variables"}}
curl -fsSL https://tokios.com/downloads/install/linux | sh -s -- --code TKS-XXXX-XXXX
```

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](https://docs.tokios.com/reference/connector-config.md).

**3. Register a deployment**

In the [Models](https://tokios.com/console/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](https://tokios.com/console/keys) tab, click **Create key**. Copy the `sk-tok-…` key now — it's shown only once.

### Call it from anywhere

```bash curl (OpenAI-compatible) theme={"theme":{"light":"github-light","dark":"css-variables"}}
curl https://api.tokios.com/v1/chat/completions \
  -H "Authorization: Bearer sk-tok-YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "glm-tunnel",
    "stream": true,
    "messages": [{"role": "user", "content": "Refactor this function and explain your reasoning."}]
  }'
```

```bash Claude Code (Anthropic-compatible) theme={"theme":{"light":"github-light","dark":"css-variables"}}
export ANTHROPIC_BASE_URL=https://api.tokios.com
export ANTHROPIC_API_KEY=sk-tok-YOUR_KEY
claude --model glm-tunnel
```

> [!TIP]
>
> The `model` field is always your registered **deployment** name (`glm-tunnel` above), never Ollama's local model id. See [Use Claude Code](https://docs.tokios.com/guides/claude-code.md) and [Use Cline](https://docs.tokios.com/guides/cline.md) for full client setup.

## Caveats

* `GLM-5.2` is not a consumer-GPU model, and it is not a single-DGX-Spark model either: at 753B stored parameters the weight floor is roughly 377 GB at INT4 and 753 GB at FP8, against 128 GB per Spark. On Ollama it's `glm-5.2:cloud` only (no weight download), so self-hosting means a multi-GPU server or a 4-Spark cluster. See the [DGX Spark compatibility guide](https://docs.tokios.com/guides/dgx-spark-model-compatibility.md#glm-52-feasibility) for memory sizing. For anything smaller, use a hosted/cloud endpoint.
* `GLM-4.6` at 357B total parameters does not fit on a single 128 GB machine (DGX Spark, Strix Halo, or Apple Silicon). At `Q4`-class quantization it needs \~178 GB — plan on at least 2 high-VRAM GPUs or a multi-GPU server. For 128 GB hardware, use `GLM-4.5-Air` instead.
* `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-4.6`/`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`, `GLM-4.6`, and `GLM-5.2` have — pick the tier that matches the capability you need, not just what fits your GPU.

## FAQ

> [accordion] Which GLM model fits a 24 GB GPU?
>
> `GLM-4` (`glm4:9b`) at 5.5 GB is the only GLM model that fits a 24 GB card — it runs comfortably on an RTX 3090 or 4090 with room for long context. `GLM-4.5-Air` at \~68–73 GB (`Q4`) does not fit, nor do the larger models. For 24 GB hardware, `GLM-4` is the choice.

> [accordion] Is GLM open source?
>
> The models on this page — `GLM-4`, `GLM-4.5-Air`, `GLM-4.6`, and `GLM-5.2` — are all released under the **MIT license**. For the newer GLM-5.3 line, check its [own page](https://docs.tokios.com/models/glm-5.3.md) — licensing can differ by version. Note that open weights and open source are not the same thing — the training data and pipeline are not released.

> [accordion] Does GLM support tool calling?
>
> Yes — `GLM-4.5-Air`, `GLM-4.6`, and `GLM-5.2` all support native tool calling. On vLLM or SGLang, pass `--tool-call-parser glm45` (paired with `--reasoning-parser glm45`) so tool calls and thinking output separate correctly. The small `GLM-4` (`glm4:9b`) does not have native tool calling — pick the tier that matches the capability you need.

> [accordion] What is the difference between GLM-4, GLM-4.5-Air, GLM-4.6, and GLM-5.2?
>
> `GLM-4` is a 9B dense model that pulls in one command on Ollama — text-only, 128K context, no hybrid reasoning. `GLM-4.5-Air` is a 106B-total MoE (12B active) with hybrid reasoning and tool calling, needing \~68–73 GB at `Q4`. `GLM-4.6` is a 357B-total MoE (32B active) that adds vision input and a 200K context, requiring multi-GPU serving. `GLM-5.2` is the frontier 753B-total MoE with a 1M-token context and adjustable thinking effort — a cloud or multi-GPU-server model, not a consumer-GPU pull.

> [card] [Quickstart](https://docs.tokios.com/quickstart.md)
>
> Pair a connector and register your first model end to end.

> [card] [What size model fits your GPU?](https://docs.tokios.com/guides/model-fit.md)
>
> Match a GLM variant to your available VRAM before you pull it.

> [card] [Quantization & hardware](https://docs.tokios.com/models/quantization-and-hardware.md)
>
> Which of GLM's formats — `GGUF`, `safetensors`, `AWQ` — runs on your hardware.

> [card] [Which local model for which task?](https://docs.tokios.com/guides/model-by-task.md)
>
> See how GLM compares to other local models by task.

> [card] [DGX Spark compatibility](https://docs.tokios.com/guides/dgx-spark-model-compatibility.md#glm-52-feasibility)
>
> Memory sizing and cluster configuration for GLM-5.2 on DGX Spark.

> [card] [GLM-5.3 release watch](https://docs.tokios.com/models/glm-5.3.md)
>
> What is verifiable about the next GLM release, and what is rumour.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.