GLM (Z.ai)
Prompting GLM
How to prompt Z.ai's GLM-5.3 and GLM-5.3-Flash for agentic coding, reasoning, and multimodal builds through the API or local serving.
What this model is particularly good at:
- Cost-efficient reasoning and coding across the family, from GLM-5.3-Flash's near-frontier coding scores at a few cents per task to GLM-5.3's $1.40 input / $4.40 output per million tokens
- Open-weight releases with local serving across common frameworks; GLM-5.3-Flash ships MIT, GLM-5.3 ships under Z.ai's own GLM-5.3 license
- Native visual input inside the coding loop for UI and 3D work on GLM-5.3-Flash; GLM-5.3 is text-only
Current model routing
| Model | Status | Best fit | API ID |
|---|---|---|---|
| GLM-5.3 | open-weight | Higher-capability text reasoning and coding when budget allows more than Flash pricing | glm-5.3 |
| GLM-5.3-Flash | open-weight | Agentic coding and multimodal builds on a tight budget | glm-5.3-flash |
Which model to choose
Use GLM-5.3 for harder reasoning and coding work where the extra capability is worth $1.40 input / $4.40 output per million tokens. It is a 753B-parameter model, text-only with no native image input, and ships under Z.ai’s own GLM-5.3 license rather than MIT.
Use GLM-5.3-Flash when the task needs strong coding at low cost instead. Z.ai reports an Intelligence Index of 57 at about four cents per task with coding scores near Claude Opus 4.8, and it is the only model in the family with native image input.
Do not treat Flash as a compressed GLM-5.3. It starts from a newly trained base with sparse-plus-linear attention, so prompts tuned for one do not transfer automatically to the other. Both models handle a 1M-token context window with 128K max output.
For serving, choose the Z.ai API for zero setup or a local stack such as vLLM, SGLang, Transformers, or Unsloth for control.
Prompting in agents and local apps
In an agentic harness, let the model look at rendered output. Its visual coding loop expects screenshots or screen recordings as input, followed by build, render, inspect, and refine rounds.
Through the GLM Coding Plan the model carries triple the quota of GLM-5.3, so batch visual iterations in one session instead of rationing them.
Prompting through the API
Send glm-5.3-flash as the model code with temperature 1 and top_p 0.95. Thinking stays enabled and cannot be switched off. Control spend with reasoning_effort, which accepts low, high, and max with a default of max. Keep max for hard tasks and leaderboard reproduction, and pass low or high explicitly for simpler work.
For images, attach each one as an image_url content block with a URL or Base64 data URL. For streaming, enable both stream and tool_stream. The model card sets clear_thinking to false by default while telling chat users to pass true explicitly, so confirm which default your surface applies before copying a snippet across surfaces.
GLM-5.3 uses the same request shape with glm-5.3 as the model code and the same reasoning_effort values (low, high, max, default max), but drop the image_url block since it has no native image input. Z.ai serves GLM-5.3 through OpenAI Chat Completion, OpenAI Response, and Anthropic Message-compatible endpoints; an integration still sending thinking.type: "disabled" will get a hard failure on this model, so switch it to "enabled" with an explicit reasoning_effort first.
API request skeleton:
{
"model": "glm-5.3-flash",
"temperature": 1,
"top_p": 0.95,
"reasoning_effort": "max",
"messages": [
{
"role": "user",
"content": [
{
"type": "text",
"text": "Recreate this landing page with Next.js and TypeScript from the attached screenshots. Render each page and compare against the references before finishing."
},
{
"type": "image_url",
"image_url": {
"url": "{{screenshot_url}}"
}
}
]
}
],
"stream": true,
"tool_stream": true
}
Current prompting guidance
- Keep max reasoning effort for hard tasks and pass a lower level explicitly otherwise.
- Route image-dependent tasks to GLM-5.3-Flash; GLM-5.3 has no native visual input.
- Put the visual reference in the prompt and ask for render-and-compare rounds.
- For office deliverables, demand rendered inspection for overflow and overlap before accepting the file.
- For financial work, require disclosed facts, assumptions, and conclusions to stay labeled separately.
- Cite sources for business data instead of letting the model fill gaps.
Examples
Local app prompt:
Using the screenshots in this folder, rebuild the settings page. Compare your
render against each reference and fix layout, spacing, and color differences
before calling it done.
Prompt upgrade example:
Stale pattern: “Run my GLM-5.3 prompts unchanged on the Flash endpoint to save money.”
Better pattern: “Treat Flash as its own checkpoint with its own template and effort levels. Verify the model card before porting prompts across the family.”