AI Models. GLM (Z.ai)
Code / agents / long context / open-weight

GLM (Z.ai)

GLM-5.2: 1M context and agents; GLM-4.7-Flash for lighter self-hosting

GLM is a model family from Z.ai, formerly known as Zhipu AI. Its flagship GLM-5.2 is a text model designed for long-running engineering and agentic work: it supports a 1M-token context, up to 128K output tokens, reasoning modes, function calling, context caching, structured output and MCP tools. It is available through an API compatible with the OpenAI client and as public weights under the MIT license. At roughly 753B parameters, running the full model requires data-center-class infrastructure. GLM-4.7-Flash is the more practical local option: a 30B-A3B MoE model with 200K context, also under MIT.

Verified: 2026-06-23

Purchase decision (when to choose / when to avoid)

Choose if...

  • You need long context for multi-step software-engineering work.
  • You are building agents with function calling, structured output or MCP tools.
  • You can benchmark a low-cost API against an open-weight deployment.

Avoid if...

  • You expect to run full GLM-5.2 on modest hardware; roughly 753B parameters require data-center resources.
  • Excellent Polish is required without additional evaluation; official materials focus on English and Chinese.
  • You need turnkey governance, data residency and regulated-sector contracts without further vendor review.

Cost in practice (scenarios)

GLM-5.2 API

$1.40 input / $0.26 cached input / $4.40 output per 1M tokens in the June 23, 2026 price list.

  • web search and other tools billed separately
  • prices may change
Self-host GLM-4.7-Flash

GPU and operating cost; the 30B-A3B variant is much more practical than full GLM-5.2.

  • vLLM or SGLang
  • monitoring, updates and guardrails managed by the deployer
Self-host GLM-5.2

Data-center-class infrastructure; do not treat public weights as a typical local-server option.

  • roughly 753B parameters
  • multi-GPU cluster and MLOps expertise
These are estimates/scenarios (not an invoice). Actual cost depends on context length, number of users, limits and retention policies.

Deployment / data / enterprise

Deployment channels

  • Z.ai API through the official SDK or an OpenAI-compatible client
  • Self-host GLM-4.7-Flash with vLLM, SGLang or compatible tools
  • Self-host GLM-5.2 only with infrastructure appropriate for a roughly 753B model

Data policy

Training on data
For self-hosting, controlled by the deployer; for the API, verify the current Z.ai service terms.
Retention
Depends on channel and contract; a public model card does not replace API service terms.
Data residency
Depends on self-hosting location or regions offered by the API service.
Before sending personal data or confidential code, review retention, transfers and vendor controls.

Enterprise readiness

Admin
The API provides keys, billing and official SDKs; broader organizational controls must be confirmed.
SSO/SCIM
Confirm with Z.ai for the selected plan.
Audit
Application logging and request auditing should be designed by the deployer.
DPA
Confirm before processing personal data.
Certifications
Check current documentation from Z.ai and the hosting provider.
Open weights increase control but do not automatically provide an enterprise operating layer.

Best use cases

  • long-running coding work across multiple files, tests, refactoring and tool use
  • agents using function calling, structured output or MCP integrations
  • self-hosting GLM-4.7-Flash when an open model for code and automation is needed at a more manageable scale.

Strengths

  • GLM-5.2 combines 1M context, up to 128K output and capabilities useful for agent workflows.
  • GLM-5.2 and GLM-4.7-Flash weights are published under MIT; the hosted API works with the OpenAI client.
  • GLM-4.7-Flash uses a 30B-A3B MoE design, making deployment more practical than the full GLM-5.2.

Weaknesses / risks

  • At roughly 753B parameters, public GLM-5.2 weights do not imply cheap or simple self-hosting.
  • The strongest quality comparisons and benchmarks are producer-reported; test on your own code and data.
  • Documentation focuses on English and Chinese; Polish quality and governance for regulated uses need separate validation.

Current models (examples)

  • GLM-5.2 - flagship text model: 1M context, up to 128K output, function calling, structured output and MCP; MIT weights and Z.ai API.
  • GLM-4.7-Flash - 30B-A3B MoE, 200K context and up to 128K output; MIT, deployable with vLLM or SGLang.
  • The wider family also includes specialist models such as GLM-5V-Turbo, GLM-OCR, GLM-Image and GLM-ASR.

Alternatives (if this model doesn't fit)