Skip to content
Docs

Using GLM-5.2 on Chutes

GLM-5.2 is Z.ai's latest flagship for long-horizon tasks, and the first GLM with a solid 1M-token context window. MIT-licensed, with 753B MoE parameters and flexible thinking effort levels, it is served on Chutes in NVIDIA's NVFP4 4-bit build inside a Trusted Execution Environment, behind the standard OpenAI-compatible gateway.

Overview

GLM-5.2 marks a substantial leap in long-horizon capability over GLM-5.1 and delivers it, for the first time in the GLM line, on a stable 1M-token context (config.json: 1,048,576 max position embeddings). Z.ai lists four headline changes: the solid 1M context; stronger coding with multiple thinking effort levels to balance performance and latency; IndexShare, an architecture improvement that reuses the same indexer across every four sparse attention layers and cuts per-token FLOPs by 2.9x at 1M context; and an improved MTP layer for speculative decoding that raises acceptance length by up to 20%.

Benchmark movement over GLM-5.1 is large: Terminal Bench 2.1 (Terminus-2) 81.0 vs 63.5, SWE-bench Pro 62.1 vs 58.4, DeepSWE 46.2 vs 18, HLE 40.5 vs 31.0, AIME 2026 99.2, IMOAnswerBench 91.0, MCP-Atlas 76.8. Long-context suites (FrontierSWE 74.4 dominance, SWE-Marathon 13.0, PostTrainBench 34.3) were evaluated at the full 1M context length.

Architecturally it keeps the GLM-5 MoE foundation (GlmMoeDsaForCausalLM): 78 layers, hidden size 6144, 256 routed experts plus 1 shared with 8 routed active per token, ~753B parameters in safetensors.

Model specifications

PropertyValue
Parameters753B total (safetensors)
ArchitectureMoE transformer with sparse attention + IndexShare; 78 layers, hidden size 6144
Experts256 routed + 1 shared; 8 routed active per token
Context length1,048,576 tokens (1M)
LicenseMIT
Precision on ChutesNVFP4 4-bit (nvidia/GLM-5.2-NVFP4, NVIDIA ModelOpt; upstream BF16)
ModalitiesText in, text out
ReleaseJune 2026

Quick start

Base URL https://llm.chutes.ai/v1, model zai-org/GLM-5.2-TEE, Bearer auth with your Chutes API key.

curl -X POST "https://llm.chutes.ai/v1/chat/completions" \
  -H "Authorization: Bearer $CHUTES_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "zai-org/GLM-5.2-TEE",
    "messages": [{"role": "user", "content": "Analyze this 500-page RFC bundle for conflicts."}],
    "stream": true,
    "max_tokens": 1024,
    "temperature": 0.7
  }'
import os
from openai import OpenAI

client = OpenAI(
    base_url="https://llm.chutes.ai/v1",
    api_key=os.environ["CHUTES_API_KEY"],
)

response = client.chat.completions.create(
    model="zai-org/GLM-5.2-TEE",
    messages=[{"role": "user", "content": "Map every call site of deprecate() in this repo dump."}],
    max_tokens=8192,
    temperature=0.7,
)
print(response.choices[0].message.content)
const res = await fetch("https://llm.chutes.ai/v1/chat/completions", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.CHUTES_API_KEY}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    model: "zai-org/GLM-5.2-TEE",
    messages: [{ role: "user", content: "Draft a fix plan for these failing tests." }],
    stream: false,
    max_tokens: 1024,
    temperature: 0.7,
  }),
});
const data = await res.json();
console.log(data.choices[0].message.content);

Parameters and tuning

Key request fields and their chute defaults, from the live llms.txt:

FieldDefaultNotes
max_tokens1024Raise well above the default for agent and long-context work; Z.ai's own evaluations used 32K-131K output budgets
temperature0.7Upstream generation_config.json defaults to 1.0 with top_p 0.95; the card's coding-agent runs used temperature 1.0 with top_p 1.0
streamtrue (streaming endpoint)Server-sent events on both chat and raw completions
seed42Set for reproducibility
top_p, top_k, min_p1 / -1 / 0Full vLLM sampling surface, including presence, frequency, and repetition penalties

What it's best at

  • Million-token contexts. Whole-repository dumps, large document corpora, and multi-day agent transcripts fit in a single window; the long-context benchmarks were run at the full 1M length.
  • Long-horizon coding agents. 81.0 Terminal Bench 2.1, 62.1 SWE-bench Pro, 46.2 DeepSWE, 74.4 FrontierSWE dominance: a step-change over GLM-5.1 on sustained autonomous engineering.
  • Competition math and hard reasoning. 99.2 AIME 2026, 91.0 IMOAnswerBench, 40.5 HLE (54.7 with tools).
  • Agentic tool use. 76.8 MCP-Atlas public set, 48.2 Tool-Decathlon.
  • Cost/latency tuning. Flexible thinking effort levels plus 4-bit NVFP4 serving keep frontier-class output affordable.

It is text-only (no image, audio, or video inputs), and because this chute serves a 4-bit quantization, outputs will not be bit-identical to the BF16 checkpoint.

How Chutes serves this model

This chute serves nvidia/GLM-5.2-NVFP4, NVIDIA's ModelOpt 4-bit NVFP4 quantization of GLM-5.2, published under MIT and marked ready for commercial use. It runs inside a TEE: inference happens on attested confidential-compute hardware, so prompts and outputs are processed within the enclave. The endpoint surface is the OpenAI-compatible gateway: POST /v1/chat/completions, POST /v1/completions, and GET /v1/models, all with streaming and flat JSON request bodies. See the model page, llms.txt, and openapi.json.

FAQ

What context window does GLM-5.2 support?

The config.json sets max_position_embeddings to 1,048,576 tokens: a true 1M-token window. Z.ai's long-context evaluations (FrontierSWE, SWE-Marathon, PostTrainBench) ran at the full 1M length. The chute's default max_tokens is 1,024, so raise it for long outputs.

How is GLM-5.2 different from GLM-5.1?

Three things: a 1M-token context (up from ~200K), stronger coding with selectable thinking effort levels, and an IndexShare architecture change that cuts per-token FLOPs 2.9x at 1M context. Benchmark deltas are large: Terminal Bench 81.0 vs 63.5, SWE-bench Pro 62.1 vs 58.4, HLE 40.5 vs 31.0.

What does NVFP4 mean for output quality?

This chute serves nvidia/GLM-5.2-NVFP4, a 4-bit quantization produced with NVIDIA's ModelOpt (TensorRT Model Optimizer). It substantially cuts memory and cost per token; outputs will not be bit-identical to the BF16 checkpoint, but the quantized release is published by NVIDIA specifically for production deployment.

What does the TEE suffix mean?

TEE stands for Trusted Execution Environment. Inference runs inside attested confidential-compute hardware, so your prompts and the model's outputs are processed within a hardware-isolated enclave rather than on an open host.

Can I use GLM-5.2 commercially?

Yes. GLM-5.2 is MIT-licensed, which the card highlights as pure open with no regional limits. The NVFP4 quantization is likewise governed by the MIT license and marked ready for commercial use.

Does it support function calling and tool use?

Yes. GLM-5.2 is built for agentic work, scoring 76.8 on MCP-Atlas (public set) and 48.2 on Tool-Decathlon. Send OpenAI-style tools in your chat completion request.

How do I call it from the OpenAI SDK?

Set base_url to https://llm.chutes.ai/v1 with your Chutes API key and model to zai-org/GLM-5.2-TEE. Chat completions, raw completions, and streaming work through the standard SDK methods.

What sampling settings should I use?

The upstream generation_config.json defaults to temperature 1.0 and top_p 0.95, which Z.ai also used for reasoning evaluations. Their coding-agent runs (SWE-Bench Pro, Terminal-Bench) used temperature 1.0 with top_p 1.0. The chute's own default temperature is 0.7.

Sources