Skip to content
Docs

Using GLM-5.1 on Chutes

GLM-5.1 is Z.ai's flagship for agentic engineering: a 754B-parameter MoE model, MIT-licensed, that took state-of-the-art on SWE-Bench Pro at release and is built to stay productive over sessions spanning thousands of tool calls. On Chutes it is served FP8 inside a Trusted Execution Environment through the OpenAI-compatible gateway.

Overview

GLM-5.1 succeeds GLM-5 with significantly stronger coding capabilities: 58.4 on SWE-Bench Pro (state-of-the-art at release), 42.7 on NL2Repo repository generation (vs 35.9 for GLM-5), and 63.5 on Terminal-Bench 2.0 with the Terminus-2 harness (69.0 self-reported in Claude Code). It also posts 68.7 on CyberGym and 68.0 on BrowseComp (79.3 with context management).

The distinguishing improvement is endurance. Z.ai reports that earlier models, including GLM-5, exhaust their repertoire early on agentic tasks and plateau even when given more time. GLM-5.1 handles ambiguous problems with better judgment, breaks problems down, runs experiments, reads results, and identifies blockers, sustaining optimization over hundreds of rounds and thousands of tool calls.

Architecturally it keeps GLM-5's design: a Mixture-of-Experts transformer (GlmMoeDsaForCausalLM) with 78 layers, hidden size 6144, 256 routed experts plus 1 shared (8 routed active per token), DeepSeek Sparse Attention, and a 202,752-token context window.

Model specifications

PropertyValue
Parameters~754B total (safetensors), 40B active per token (identical config to GLM-5, listed as 744B on its card)
ArchitectureMoE transformer with DeepSeek Sparse Attention; 78 layers, hidden size 6144
Experts256 routed + 1 shared; 8 routed active per token
Context length202,752 tokens
LicenseMIT
Precision on ChutesFP8 (official zai-org/GLM-5.1-FP8 build; upstream BF16)
ModalitiesText in, text out
ReleaseApril 2026

Quick start

Base URL https://llm.chutes.ai/v1, model zai-org/GLM-5.1-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.1-TEE",
    "messages": [{"role": "user", "content": "Diagnose why this CI pipeline is flaky."}],
    "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.1-TEE",
    messages=[{"role": "user", "content": "Generate a project scaffold for a Rust CLI."}],
    max_tokens=4096,
    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.1-TEE",
    messages: [{ role: "user", content: "Review this diff for regressions." }],
    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 substantially for agent workloads; the model is built for long, iterative outputs
temperature0.7Upstream generation_config.json defaults to 1.0 with top_p 0.95
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

  • Long autonomous coding sessions. The model's design goal: it sustains hundreds of iterations and thousands of tool calls without plateauing, so it suits agent harnesses that let it keep working.
  • Repository-scale generation and refactors. 58.4 SWE-Bench Pro and 42.7 NL2Repo make it a strong engine for whole-repo tasks, not just single-file patches.
  • Terminal automation. 63.5 on Terminal-Bench 2.0 (Terminus-2), 69.0 self-reported in Claude Code, for real-world shell-driven workflows.
  • Security research. 68.7 on CyberGym, a large jump over GLM-5's 48.3.
  • Web research agents. 68.0 BrowseComp, 79.3 with context management.

It is text-only, so no image, audio, or video inputs. For quick one-shot completions its long-horizon strengths go unused, and for contexts beyond ~200K tokens GLM-5.2's 1M window is the better fit.

How Chutes serves this model

This chute serves Z.ai's official FP8 release (zai-org/GLM-5.1-FP8) inside a TEE: inference runs on attested confidential-compute hardware, so prompts and outputs are processed within the enclave. It runs on the vLLM template with the OpenAI-compatible surface: 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

How is GLM-5.1 different from GLM-5?

Same architecture and size, retrained for agentic engineering. It reaches 58.4 on SWE-Bench Pro (state-of-the-art at release) and improves sharply on NL2Repo (42.7 vs 35.9) and Terminal-Bench 2.0 (63.5 vs 56.2). Most importantly, it stays productive over much longer autonomous sessions instead of plateauing early.

What context window does GLM-5.1 support?

The config.json sets max_position_embeddings to 202,752 tokens, roughly 200K. The chute's default max_tokens is 1,024, so raise it for long outputs.

Does GLM-5.1 support function calling and tool use?

Yes. Long-horizon tool use is the model's design focus: Z.ai reports it sustaining thousands of tool calls per session, and it scores 71.8 on MCP-Atlas and 40.7 on Tool-Decathlon. Pass OpenAI-style tools in your chat completion request.

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.1 commercially?

Yes. GLM-5.1 is released under the MIT license, which permits commercial use, modification, and redistribution.

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.1-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. The chute's own default temperature is 0.7 with max_tokens 1024; for agent workloads, raise max_tokens well above the default.

Sources