> Documentation index for agents: https://docs.rocketride.ai/llms.txt

# llm_glm

A RocketRide LLM node that connects Zhipu AI's GLM family of open-weight hybrid-reasoning models to a pipeline through the OpenAI-compatible Z.ai cloud API or a self-hosted vLLM or SGLang deployment.

## About Zhipu AI GLM

GLM is Zhipu AI's family of open-weight models, served through the OpenAI-compatible Z.ai cloud API ([z.ai](https://z.ai)). The international cloud endpoint is `https://api.z.ai/api/paas/v4` and the mainland China endpoint is `https://open.bigmodel.cn/api/paas/v4`. GLM weights are openly published on Hugging Face under MIT-style licenses (`zai-org/GLM-5.2`, `zai-org/GLM-4.5-Air`, and so on), so the same models can be served locally.

## What it does

Provides chat completion using GLM models as an `llm`-class invoke filter. It can be wired directly via lanes or consumed by any agent or node that needs an LLM backend.

The GLM-4.5 through GLM-5 generations are hybrid-reasoning MoE models with thinking and non-thinking modes and strong agentic and coding performance. The vision variants (GLM-4V and GLM-4.5V), embedding, CogView (image), CogVideoX (video), rerank, and audio lines are out of scope for this chat node.

## Lanes

| Lane in | Lane out | Description |
| --- | --- | --- |
| `questions` | `answers` | Send a question directly, receive a generated answer |

## Profiles

Default: **GLM-5.2** (`glm-5-2`). The profile set matches the live Z.ai `/models` catalog (verified 2026-08).

| Profile | Model | Context | Output | Notes |
| ------- | ----- | ------- | ------ | ----- |
| GLM-5.2 **(default)** | `glm-5.2` | 1,000,000 | 32,768 | Frontier long-context reasoning and coding |
| GLM-5.1 | `glm-5.1` | 204,800 | 32,768 | Previous flagship |
| GLM-5 | `glm-5` | 204,800 | 32,768 | First GLM-5 generation |
| GLM-5 Turbo | `glm-5-turbo` | 204,800 | 32,768 | Fast cost-effective tier |
| GLM-4.7 | `glm-4.7` | 204,800 | 32,768 | Enhanced-reasoning 4.x flagship |
| GLM-4.6 | `glm-4.6` | 204,800 | 32,768 | Open-weight 4.x flagship |

<details>
<summary><strong>View 3 more models</strong></summary>

| Profile | Model | Context | Output | Notes |
| ------- | ----- | ------- | ------ | ----- |
| GLM-4.5 | `glm-4.5` | 131,072 | 32,768 | Open-weight |
| GLM-4.5 Air | `glm-4.5-air` | 131,072 | 32,768 | Open-weight, efficient cost/quality balance |
| `custom` | _(user-specified)_ | 131,072 | 8,192 | Any model on an OpenAI-compatible endpoint |

</details>

## Configuration

Choose a model profile. The profile supplies the model identifier and context window, so a cloud pipeline needs no additional model settings. Budget generous output tokens for reasoning-heavy prompts.

To use a self-hosted vLLM or SGLang deployment, select the **Custom Model** profile and point its server base URL at your OpenAI-compatible endpoint. Its output limit starts at 8,192 tokens and can be changed there. The API key may be left empty there: the node passes a dummy token, and local servers accept any value.

## Authentication

Cloud profiles require a Z.ai or Zhipu AI API key in `apikey`. The key requirement is enforced by base-URL match: if `serverbase` contains `api.z.ai` or `bigmodel.cn` and no key is set, the node raises `GLM API key is required for cloud profiles.` at startup. Key format is not validated beyond presence.

## Notes

### Reasoning output

GLM-4.5+ models are reasoning models. The Z.ai cloud returns reasoning in a separate `reasoning_content` field, and for endpoints that inline `<think>...</think>` blocks in `content` the engine's shared LangChain adapter strips them and routes the reasoning to the thinking lane, so the node needs no stripping of its own.

### Model sync

Profiles are maintained by the `sync_models` tooling (`llm_glm` provider, `ROCKETRIDE_GLM_KEY`). The include filter keeps only the `glm-*` text chat models; vision (4V and 4.5V), embedding, rerank, audio, and reward variants are excluded, because they belong in dedicated nodes.

## Upstream docs

- [Z.ai API documentation](https://docs.z.ai/api-reference)

<!-- ROCKETRIDE:GENERATED:PARAMS START -->
<!-- Generated by nodes:docs-generate. Do not edit by hand. -->

## Schema

| Field | Type | Description | Default |
|---|---|---|---|
| `glm.profile` | `string` | **Model**<br/>Zhipu AI GLM LLM model | `"glm-5-2"` |
| `glm.serverbase` | `string` | **Server base URL**<br/>OpenAI-compatible base URL for the GLM endpoint (e.g. https://api.z.ai/api/paas/v4 for the Z.ai cloud API, http://localhost:8000/v1 for a self-hosted vLLM / SGLang server). | `"https://api.z.ai/api/paas/v4"` |
| `model` | `string` | **Model**<br/>Zhipu AI GLM model |  |
| `modelOutputTokens` | `integer` | **Output Tokens**<br/>Most tokens the model may write in one reply (at least 1,024). Leave it empty to keep the node's default. Reasoning models count their thinking against this limit: set it well above the reply you expect, or they can spend it all thinking and return nothing. It cannot exceed Tokens; a larger value is lowered to it. |  |
| `modelTotalTokens` | `number` | **Tokens**<br/>Total Tokens |  |

## Dependencies

- `openai`
- `langchain-openai`
- `langchain-core`
- `langchain`

## Source

[<svg viewBox="0 0 16 16" width="15" height="15" fill="currentColor" aria-hidden="true" style="vertical-align:-0.15em;margin-right:0.35em"><path d="M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.013 8.013 0 0016 8c0-4.42-3.58-8-8-8z"/></svg> View source](https://github.com/rocketride-org/rocketride-server/tree/develop/nodes/src/nodes/llm_glm)
<!-- ROCKETRIDE:GENERATED:PARAMS END -->
