Back to blog
ChatGPTUpdated October 27, 202615 min read

How to Prompt GLM-5.3: What Actually Changes (2026)

How to prompt GLM-5.3: forced reasoning, tool_choice, sampling defaults and caching, checked against Z.ai's docs, plus copy-paste prompt templates.

NH
Nafiul Hasan
Founder, Prompt Architects

TL;DR: GLM is Z.ai's (formerly Zhipu AI's) model family, and the current flagship is GLM-5.3, not GLM-5.2. Z.ai shipped 5.3 on 18 August 2026, about two weeks before this was checked. Z.ai publishes no dedicated GLM prompting guide. Prompting GLM well is mostly ordinary prompting, plus a short list of real parameter-level differences covered below, each sourced directly from Z.ai's own docs.

If you searched "glm prompting" expecting a distinctive syntax the way Midjourney or Kling have one, the honest answer is: there isn't one. GLM is Z.ai's large language model family (the company most people still know as Zhipu AI), and it takes ordinary chat-formatted prompts through an OpenAI-compatible API. What actually changes when you switch to GLM is a handful of documented parameters: how reasoning is forced or toggled, what sampling defaults Z.ai recommends, and a couple of API constraints that will surprise you if you're used to OpenAI's or Anthropic's equivalents. This page covers those, corrects a version assumption worth catching before you write anything else about GLM, and is honest about where Z.ai's own documentation stops.

GLM-5.3 vs GLM-5.2 at a glance

Every row below comes from Z.ai's own documentation, covered in detail in the sections that follow.

SettingGLM-5.3GLM-5.2
ReasoningAlways on; thinking.type: disabled errorsOn by default; can be disabled
reasoning_effortlow, high, maxSeven values, only three distinct behaviors
Default effortmaxmax
tool_choiceauto onlyauto only
Context cachingAutomatic, no markersAutomatic, no markers
temperature / top_p defaults1.0 / 0.95; tune one, not both1.0 / 0.95; tune one, not both
max_tokensDefault 65,536, ceiling 131,072Default 65,536, ceiling 131,072
Context window1M tokens1M tokens

GLM-5.3 prompt templates (copy and paste)

Z.ai publishes no GLM-only prompt syntax, so these are general patterns that work well on GLM, not GLM magic. Swap the bracketed parts for your own details.

1. Coding-agent prompt (the Goal / Context / Constraints / Done-when pattern, expanded):

Goal: [one sentence: what must change]
Context: [files, error messages or examples that matter; paste them below]
Constraints:
- Follow the existing code style and architecture.
- Do not add new dependencies.
- Do not touch files outside [folder].
Plan first: list the steps you will take, then wait for my "go" before editing.
Done when: [the test, behavior or check that proves it is finished].
Report: list every file you changed and why, in one line each.

2. System prompt for JSON extraction (pair it with response_format: json_object):

You are a data extraction service. Return JSON only, no commentary.
Schema: {"sentiment": "positive|negative|neutral", "confidence": 0.0-1.0, "summary": "string, max 20 words"}
If the text does not contain enough information, set sentiment to "neutral" and confidence to 0.0.

3. Tool-calling prompt that names the tool in text (needed because tool_choice only accepts auto):

Use the search_orders tool to look up order [ORDER_ID] before you answer.
Do not answer from memory. If search_orders returns nothing, say so and ask me for a different order number.

4. Long-context summarisation prompt:

Below are [N] documents. Summarise each in 3 bullet points, then list the 3 points on which they disagree.
Quote the exact sentence for every disagreement and name the document it came from.
If something is not in the documents, write "not stated" instead of guessing.

[paste documents]

What is a good GLM system prompt?

Keep it to four lines: the role, the output format, the constraints, and what to do when information is missing. Template 2 is a complete example. Nothing in Z.ai's docs suggests GLM needs a special format here, so I would not invent one.

What is GLM, and who makes it?

GLM stands for General Language Model, and it's built by Z.ai, the renamed and rebranded continuation of Zhipu AI. The company's own developer platform, docs.z.ai, and its Hugging Face organization both publish under the zai-org / Z.ai name today, with the open-weight repos still carrying the model family's original THUDM lineage in their history. If your source material still says "Zhipu AI" without qualification, that's not wrong, just dated branding. The current developer-facing name is Z.ai.

The current lineup, per Z.ai's own model overview page, checked 3 September 2026:

ModelPositioningContext windowReleased
GLM-5.3Flagship, coding + agent focus1M tokens18 Aug 2026
GLM-5.3-FlashNative multimodal, lower cost1M tokens26 Aug 2026
GLM-5.2Prior flagship, still documented1M tokens16 Jun 2026
GLM-5.1Long-horizon focus, 200K context200K tokens7 Apr 2026

The model IDs you actually pass to the API are lowercase: glm-5.3, glm-5.3-flash, glm-5.2, and so on, confirmed straight from Z.ai's own quick-start code samples, not inferred from the marketing names.

Does Z.ai publish an official GLM prompting guide?

Not a dedicated one, and this is worth saying plainly rather than papering over. Z.ai's full documentation index lists guides for every API parameter, every model, and every capability (thinking mode, function calling, structured output, context caching), but the closest thing to prompting advice, anywhere in that index, is a page titled "Best Practice", subtitled "Best Practices for Coding Agents: Managing Prompts, Plans, Skills, and Workflows".

Read that page and it turns out to be genuinely useful, but it is not GLM-specific. It opens with a framework for structuring any coding-agent task into four parts (goal, context, constraints, and "done when") and its own worked example of the pattern cites Claude Code by name as an illustration of planning before execution. It would apply just as well to Codex, Cursor, or any other agentic coding tool. Z.ai's honest position, read from its own docs rather than assumed, is that the model-specific advice lives in the API reference (how reasoning, sampling and tool calls behave), and everything above that layer is the same agentic-workflow advice you'd get anywhere.

That four-part structure is genuinely worth copying, regardless of which model you point it at:

Goal:        What needs to change, in one sentence.
Context:     The files, error messages, or examples that matter.
Constraints: Standards, architecture rules, or dependencies to respect.
Done when:   The test, behavior, or check that proves it's finished.

What actually changes when you prompt GLM instead of a generic model?

Three things, all parameter-level rather than stylistic, and all confirmed directly from Z.ai's API docs.

Reasoning is forced on GLM-5.3, and cannot be disabled. Z.ai's own migration guide is direct about this: GLM-5.3 always operates with reasoning enabled, with three effort levels (low, high, max), and "Disabling reasoning is no longer supported." That's a change from GLM-5.2, GLM-5.1 and GLM-5, which auto-decide whether to think and can still be set to disabled. If your workflow depends on a model that skips reasoning entirely for simple turns, GLM-5.3 will error on that request; GLM-5.2 is the one that still supports it.

tool_choice accepts only auto. Z.ai's chat completion reference documents the parameter as controlling "how the model selects which function to call." Its description states plainly that the default value is auto, and only auto is supported. There's no none to suppress tool use for one turn and no way to force a specific named function the way OpenAI's or Anthropic's APIs allow. If you need GLM to call one particular tool, the documented approach is to say so directly in the prompt, not to constrain it through the parameter.

Context caching is automatic, with nothing to mark in the prompt. Z.ai's own feature list, under the heading Automatic Cache Recognition, describes it as "Implicit caching that intelligently identifies repeated context content without manual configuration". A repeated system prompt or conversation history gets cached and billed at a lower rate without you doing anything, which is a real difference from Anthropic's API, where you place explicit cache_control breakpoints yourself.

Past those three, ordinary prompting rules apply: clear instructions, explicit output format, examples when the task is genuinely ambiguous. Z.ai's own function-calling best practices are generic advice any vendor would give (single-responsibility functions, clear naming, detailed parameter descriptions), not a GLM-specific technique.

How do you control GLM's reasoning depth?

Through two parameters that interact, and the accepted values differ by model generation. Z.ai's core-parameters reference lays it out:

ParameterGLM-5.3 / GLM-5.3-FlashGLM-5.2 and earlier
thinking.typeenabled only; disabled errorsenabled (default) or disabled
reasoning_effort valueslow, high, maxmax, xhigh, high, medium, low, minimal, none
Defaultmaxmax

On GLM-5.2, passing none or minimal for reasoning_effort skips thinking entirely, while low and medium both get mapped up to high, and xhigh maps to max, so of the seven documented values, only three actually produce distinct behavior. On GLM-5.3 the parameter was simplified to exactly those three real levels. For anything you'd call complex (multi-file coding, long-horizon planning), Z.ai's own guidance recommends max; reach for low deliberately when you want a faster, lighter-touch answer and can tolerate the drop in depth.

Reasoning controls work differently on GPT-5.6, which is a useful contrast: see How to Prompt GPT-5.6. A basic call with reasoning forced to maximum:

curl -X POST "https://api.z.ai/api/paas/v4/chat/completions" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -d '{
    "model": "glm-5.3",
    "messages": [
      {"role": "system", "content": "You are a senior backend engineer."},
      {"role": "user", "content": "Design a rate limiter for a multi-tenant API."}
    ],
    "thinking": {"type": "enabled"},
    "reasoning_effort": "max",
    "temperature": 1.0
  }'

If you're building a tool-calling agent, one more mechanic matters: GLM supports interleaved thinking between tool calls by default, and Z.ai's docs are explicit that when you do this, "thinking blocks should be explicitly preserved and returned together with the tool results" in your next request. Reordering or editing the returned reasoning_content can degrade both accuracy and cache hit rate. That's an implementation detail for whoever's writing the agent loop, not the prompt itself, but it will silently break your results if the harness drops it.

What sampling settings does Z.ai actually recommend?

Z.ai's migration guide gives one clear rule: temperature defaults to 1.0, top_p defaults to 0.95, and the documented advice is to tune only one of the two, not both at once. Lower temperature for factual, deterministic output; higher for creative or exploratory generation, standard guidance rather than a GLM-specific override. For how that compares across other vendors task by task, see AI Temperature Settings by Task.

max_tokens limits vary by model rather than following one flat number (see Max Tokens vs Max Output Tokens for the general difference). Z.ai's parameter reference lists a default of 65,536 and a hard ceiling of 131,072 for every model in the current GLM-5.x line (5.3, 5.3-Flash, 5.2, 5.1, 5), while older GLM-4.5-series models cap lower, at 98,304. If you're porting a prompt or an integration from an older model, check the ceiling for the specific model ID rather than assuming it carries over.

One more constraint worth knowing before you rely on it: Z.ai's own API reference describes stop as a word list, but its description states plainly that "only one stop word is supported". If your prompting relies on multiple stop sequences the way OpenAI's four-sequence limit allows, GLM's documented behavior is narrower.

Can you get valid, structured JSON out of GLM?

Yes, through response_format set to {"type": "json_object"}, on models Z.ai lists as GLM-5, GLM-4.7, GLM-4.6 and GLM-4.5. Unlike the strict json_schema mode some other vendors document, Z.ai's structured-output guide shows the schema defined inside the system message itself, in prose or example form, rather than passed as a separate enforced schema object. Its own advice: start with a simple structure and add complexity gradually, and give key fields descriptions and examples so the model has something concrete to match.

{
  "response_format": { "type": "json_object" },
  "messages": [
    {
      "role": "system",
      "content": "Return JSON only, matching: {\"sentiment\": \"positive|negative|neutral\", \"confidence\": 0.0-1.0, \"summary\": \"string\"}"
    },
    { "role": "user", "content": "The onboarding flow confused three testers in a row." }
  ]
}

For the vendor-neutral view of schemas and enforced output, see Structured Outputs and response_format. Z.ai's own warning on this feature is worth repeating rather than glossing over: forcing JSON mode "may affect the naturalness of responses" in complex scenarios, so it's worth testing whether a plain-prose answer with a follow-up parse step actually serves you better than forcing structure on every call.

Does the SWE-bench Pro score you've seen still apply?

Only to GLM-5.2: Z.ai's GLM-5.2 page reports 62.1 versus 58.4 for GLM-5.1, while GLM-5.3's own page reports different benchmarks. Attribute 62.1% to GLM-5.2, not to GLM generically.

Is GLM open source, and can you self-host it?

Partly. GLM-5.3 and GLM-5.2 are open weights on Hugging Face under a Z.ai-authored license that permits commercial use, with a security-review carve-out that only applies above $10 billion a year in Model-as-a-Service revenue. Documented serving frameworks include SGLang, vLLM, Transformers, KTransformers and Unsloth. One self-hosting detail: in the open-weight chat template clear_thinking defaults to false, and for ordinary chat Z.ai's model card recommends passing clear_thinking=true.

How do you compare GLM prompting to what Claude or Qwen document?

If you've read how Claude or Qwen handle this, covered in How to Prompt Qwen Models, the pattern with GLM is closer to Qwen than it is to a vendor with a distinct prompting philosophy. Neither Chinese lab publishes an invented syntax; both publish parameter-level guidance (thinking-mode switches, sampling defaults) and expect ordinary structured prompting to carry the rest. DeepSeek, covered separately in DeepSeek Prompt Templates, fits the same pattern: no distinct syntax, just parameter-level guidance. Kimi, covered in Kimi K3 Prompt Templates, is similar. Where GLM differs from Qwen specifically: Qwen still lets you disable thinking on its current flagship, while GLM-5.3 forces it on, and Qwen documents a prompt-level /no_think toggle that GLM does not have an equivalent for.

The reasoning-versus-chat distinction itself (when a "thinking" model needs a different prompt than a plain chat model, and what happens to sampling parameters when you switch) is covered vendor-by-vendor, GLM included, in Reasoning Models vs Chat Models: Prompt Them Differently.

One more genuinely useful, and underused, GLM-specific option: Z.ai documents an Anthropic Message Protocol endpoint (api.z.ai/api/anthropic) alongside its OpenAI-compatible one. Z.ai's own GLM-5.3 benchmark methodology runs its coding evaluations inside Claude Code itself, pointed at GLM through that endpoint. That's proof the compatibility layer is real, not just documented and untested.

Does Prompt Architects support GLM?

Not as a named integration, as of 27 October 2026 (re-checked on the live page). Our own /integrations page lists ChatGPT, Gemini, Claude, Grok, Perplexity, Kimi, Merlin, DeepSeek, V0.Dev, Bolt, Lovable, Base44 and our MCP server. GLM and Z.ai are not on it. What that means in practice: the in-page enhance menu that appears on the platforms above won't appear on Z.ai's own chat surface or a self-hosted GLM deployment's UI. Prompts built with our generator are plain text either way, so they carry over by copy-paste; if GLM support is something you'd use, that's a feature request rather than a gap we're pretending doesn't exist. Our free plan is 5 prompt enhancements per day.

The short version

GLM prompting is ordinary prompting, with three real parameter-level differences worth remembering: GLM-5.3 forces reasoning on and only exposes three effort levels, tool_choice supports nothing but auto, and caching is automatic rather than something you mark in the prompt. Z.ai does not publish a distinct prompting philosophy the way some vendors claim to. Its own closest document on how to prompt is generic coding-agent advice that name-checks Claude Code. And the version matters more than the technique here: GLM-5.2, the model most existing content still describes, was superseded by GLM-5.3 in mid-August 2026, with the same base model and only post-training separating them.

Frequently asked questions

Free plan · Chrome extension included

Stop rewriting prompts. Start shipping.

Turn a rough idea into a structured prompt in one click, inside ChatGPT, Claude, Gemini and 40+ AI tools. 5 free prompts a day, no card. 4.8★ on the Chrome Web Store.

Create a free account