GLM-5

GLM-5

by Z.ai · Current; available through the Z.ai API and as open weights

GLM-5 is Z.ai’s large open-weight model for complex software engineering, repository-scale coding, long-horizon reasoning, and tool-using agents. It provides a 200K-token context, 128K-token maximum output, streaming, function calling, structured output, context caching, API access, and downloadable weights. Its main trade-offs are substantial deployment requirements, unverified current pricing, moderate speed, and text-only documented modalities.

Text Reasoning Coding
GLM-5 is a large open-weight model from Z.ai built for software engineering tasks that require planning, coding, debugging, tool use, and consistency across many steps. It is available through the Z.ai API under the model ID glm-5 and as downloadable weights under zai-org/GLM-5. With a documented 200K-token context window and 128K-token maximum output, it is designed for repository-scale work and long-running agent workflows rather than short, low-latency prompts.
Outputs

What GLM-5 can produce

Text
Inputs

What it can understand

Text
Capabilities

Support features

Tool use Streaming Structured output Prompt caching
Model profile

Performance characteristics

9/10 Reasoning
9/10 Coding
5/10 Speed
6/10 Cost efficiency
Specifications

Technical details

Family GLM-5
Type Reasoning
Context window 200K tokens
Max output tokens 128K tokens
Release date February 2026
Status Current; available through the Z.ai API and as open weights
Knowledge cutoff notes

No direct authoritative knowledge-cutoff date was identified in the reviewed Z.ai model documentation or model card.

Model notes

GLM-5 is an open-weight mixture-of-experts model from Z.ai. Official documentation describes approximately 744 billion total parameters, about 40 billion active parameters, a 200K context, and a 128K maximum output. The exact API model identifier is glm-5; the downloadable model identifier is zai-org/GLM-5. Z.ai documents text input and text output for the exact API model, so image, audio, and video capabilities are not marked as supported. Editorial scores are comparative estimates rather than vendor specifications. Z.ai documents structured output and context caching, but a separate legacy JSON-mode capability and official batch API support were not independently verified. Hosted API pricing was not populated because a current exact-model first-party price was not located in the reviewed documentation.

Model guide

GLM-5: Z.ai’s Open-Weight Model for Long-Horizon Engineering Agents

GLM-5 is Z.ai’s open-weight foundation model for complex software engineering, long-horizon reasoning, and tool-using agent workflows. It combines a large mixture-of-experts architecture, DeepSeek Sparse Attention, a 200K-token context window, a 128K-token maximum output, function calling, structured output, streaming, and downloadable weights. Its main trade-offs are substantial deployment requirements, moderate expected speed, and the absence of verified native multimodal input or output for this exact model.

What is GLM-5?

GLM-5 is Z.ai’s current open-weight foundation model for complex systems engineering, coding, and long-horizon agentic tasks. Instead of focusing only on producing a short code snippet or answer, it is designed for workflows in which an application or agent must plan a task, inspect information, call tools, modify files, test changes, and maintain context over multiple stages.

The model is available in two main forms. Hosted applications can access it through the Z.ai API using the canonical model identifier glm-5. Developers who need more control over hosting and data handling can download the open weights from the zai-org/GLM-5 model repository and deploy them with compatible serving frameworks.

GLM-5 is primarily a text model. The supplied Z.ai documentation identifies text input and text output for this exact model. Structured responses, reasoning content, and tool-call information can therefore be returned as text-oriented model results, but native image, audio, or video input and output are not verified for GLM-5.

Where GLM-5 fits in Z.ai’s lineup

GLM-5 occupies the large-model end of Z.ai’s catalog and is aimed at demanding engineering and agent workloads rather than lightweight conversational use. Its positioning is especially relevant for teams that want an open-weight model with a hosted API option, rather than choosing exclusively between a fully managed proprietary model and a small local model.

The model was listed with a February 2026 release date and a current status of being available through both the Z.ai API and open-weight distribution. The open-weight route distinguishes GLM-5 from an API-only service: organizations can evaluate compatible deployment stacks, control where inference runs, and make their own operational decisions. That flexibility comes with significant infrastructure demands because the model has approximately 744 billion total parameters, with about 40 billion active parameters per inference.

Architecture and context window

GLM-5 uses a mixture-of-experts, or MoE, architecture. In an MoE model, the full parameter set is divided among specialist components called experts, while only a subset is activated for each inference step. Z.ai’s documentation describes approximately 256 experts, about 744 billion total parameters, and roughly 40 billion active parameters per inference.

The model also uses DeepSeek Sparse Attention. This is intended to make attention over long inputs more manageable by avoiding the same level of dense computation across every token relationship. In practical terms, the architecture is designed for documents, repositories, and multi-stage tasks where retaining a large amount of working context is important.

The official API documentation lists a 200,000-token context length. This is the combined space available for the relevant conversation or input context and the generated response, subject to the provider’s implementation and request limits. The documented maximum output is 128,000 tokens, which is unusually large for tasks that require extensive reasoning traces, long code changes, or detailed structured results.

A large context does not automatically make every task more reliable. Long inputs can still contain irrelevant material, ambiguous requirements, or incomplete project information. Developers should use retrieval, summarization, and tool-specific context selection when a full repository or document set is larger than the useful working set.

Reasoning and coding capabilities

GLM-5 is intended for reasoning-intensive software work. Its documented use cases include front-end and back-end development, repository-scale refactoring, debugging, terminal workflows, structured information extraction, and multi-step task execution.

The model supports an enabled thinking mode. This allows an application to request extended reasoning behavior when a task benefits from more deliberate planning. That mode is particularly relevant to tasks such as tracing a bug through several modules, deciding how a change affects existing interfaces, or coordinating a sequence of terminal operations. Reasoning can increase response time and token consumption, so it is not necessarily the best choice for every simple completion.

Z.ai reports a score of 77.8 on SWE-bench Verified and 56.2 on Terminal-Bench 2.0 under the documented evaluation settings. These are provider-reported benchmark results, not guarantees for an individual repository or production workflow. Benchmark performance can vary with prompting, tool configuration, test coverage, environment setup, and the way an agent is permitted to act.

For coding teams, GLM-5’s most useful distinction is its focus on sustained engineering work rather than isolated code generation. A suitable workflow might ask the model to inspect a repository, identify the relevant components, propose a change, edit files through tools, run tests, interpret failures, and revise the implementation. The model’s long context and tool support are relevant to this workflow, but the surrounding agent system still needs permissions, validation, timeouts, and safeguards.

API features and tool use

Z.ai documents GLM-5 as supporting the core features needed for text-based agent applications:

  • Text input and output: The exact model is documented as text-only for both input and output modalities.
  • Streaming: Supported, allowing an application to receive generated results incrementally rather than waiting for the complete response.
  • Function calling: Supported for connecting the model to external functions and tools.
  • Structured output: Supported for applications that need responses in a defined, machine-readable structure.
  • Context caching: Supported by the Z.ai API.
  • Extended context: A documented 200K-token context window.
  • Maximum output: Up to 128K tokens according to the supplied API information.

Function calling does not mean that GLM-5 independently performs arbitrary actions. The application defines the available tools, validates arguments, executes approved calls, and returns results to the model. This makes GLM-5 suitable for controlled terminal, repository, database, or business-system agents, provided the application applies appropriate access controls.

Z.ai documents structured output, including JSON-oriented formats. A separate legacy JSON-mode capability is not independently confirmed for this exact model, so structured output should not automatically be treated as proof of a distinct JSON-mode parameter or feature.

Hosted API and open-weight deployment

Hosted use is available through Z.ai’s chat-completions endpoint with the model ID glm-5. This is the simpler route for teams that want to integrate the model without operating the inference stack themselves. Streaming, function calling, structured output, and context caching are relevant to production applications built around the API.

For self-hosting, the downloadable model identifier is zai-org/GLM-5. The model card documents deployment with vLLM, SGLang, Transformers, KTransformers, and other compatible serving frameworks. The exact operational requirements will depend on quantization, parallelism, throughput targets, and the serving stack, but the model’s scale means that local deployment is not a lightweight workstation task.

Open-weight availability can be valuable when an organization needs more control over data handling, infrastructure location, or serving behavior. It also transfers responsibility for hardware, model loading, upgrades, monitoring, capacity planning, and reliability to the operator. Teams without the infrastructure to serve a model of this size may find the hosted API more practical.

Pricing, speed, and cost trade-offs

A current exact-model first-party hosted API price was not verified in the supplied research, so no numeric input or output price should be assumed. The absence of a populated price does not mean that API access is free; it means that a reliable current price for GLM-5 was not established from the reviewed documentation.

GLM-5 is also not positioned as a low-latency model. Its large architecture, extended reasoning capability, and very high output ceiling can require more computation than a smaller model designed for short answers. Editorial evaluations in the supplied data rate its reasoning and coding highly, speed moderately, and cost in the middle range. Those scores are comparative editorial estimates, not Z.ai specifications.

The practical trade-off is capability and task persistence versus response speed and infrastructure efficiency. GLM-5 may be appropriate when a failed coding task, incomplete refactor, or weak tool decision is more expensive than waiting longer for a stronger attempt. A smaller or faster model may be more appropriate for simple classification, short extraction, routine autocomplete, high-volume lightweight requests, or applications with strict latency targets.

Best use cases for GLM-5

GLM-5 is a strong candidate when the task combines technical complexity, multiple steps, and a need to preserve substantial context. Appropriate use cases include:

  • Repository-scale software development and refactoring.
  • Debugging that requires reading code, logs, tests, and configuration together.
  • Terminal-based agents that can inspect environments and run approved commands.
  • Front-end and back-end implementation across multiple files or services.
  • Long-running engineering tasks with planning, tool calls, validation, and iteration.
  • Technical research involving large collections of text or code.
  • Structured information extraction from long documents.
  • Self-hosted deployments where data control and infrastructure ownership are important.

For these scenarios, the 200K-token context and 128K-token output limit can reduce the need to split a task into many small exchanges. Tool calling and structured output also make it easier to connect the model to an agent runtime or application workflow.

Limitations and when another option may be better

GLM-5’s main limitation is the operational cost of its scale. The open-weight version requires a substantial serving environment, and the hosted version may be less attractive for workloads where low cost or very low latency matters. The model’s high maximum output also needs governance: an agent should normally impose task-specific limits rather than allowing every request to generate an unnecessarily long response.

GLM-5 is not the right default when native multimodal processing is essential. The supplied documentation verifies text input and text output for this exact model, but not image, audio, or video input or generation. An application that must directly analyze images, process audio, or create media should use a model with those modalities explicitly documented.

Another option may be preferable for short, repetitive, high-volume tasks, resource-constrained local deployment, or strict response-time requirements. A smaller model can provide a better capability-to-cost ratio when the task does not need long context, extended reasoning, or complex tool coordination. Conversely, a managed model with clearer published pricing or operational guarantees may be easier to evaluate if open-weight deployment is not a priority.

Overall assessment

GLM-5 is best understood as an engineering-oriented open-weight model for difficult, extended tasks. Its documented strengths are the combination of large-scale reasoning, coding specialization, tool and function support, structured output, long context, and availability through both an API and downloadable weights.

It should be evaluated as an agent-engineering component rather than simply as a faster chatbot. The model is most compelling when it must work through a substantial codebase or technical task over many steps. Before adoption, teams should verify current API pricing, test it on representative repositories, measure latency and token usage, and confirm that their hosting environment can support the open-weight release. For lightweight or multimodal workloads, a different model type may offer a more practical balance.


Answers to Frequently Asked Questions

What are the main limitations of GLM-5?
GLM-5 requires substantial infrastructure for self-hosting and may be slower or more expensive than smaller models for simple, high-volume, or low-latency tasks. Its documented modalities are text input and text output, so native image, audio, and video processing are not verified for this model.
Does GLM-5 support function calling and structured output?
Yes. GLM-5 supports streaming, function calling, structured output, context caching, and extended context through the Z.ai API. The application remains responsible for defining tools, validating arguments, executing approved calls, and enforcing access controls.
How can developers access and deploy GLM-5?
Developers can access GLM-5 through the Z.ai API using the model identifier `glm-5`, or download the open weights from `zai-org/GLM-5` for self-hosted deployment. The model card documents compatibility with serving frameworks including vLLM, SGLang, Transformers, and KTransformers.
What is GLM-5?
GLM-5 is Z.ai’s open-weight foundation model for complex software engineering, coding, reasoning, and long-horizon agentic tasks. It is designed to plan work, inspect information, use tools, modify files, run tests, and maintain context across multiple stages.
What are GLM-5’s context window and output limits?
The Z.ai API documents a 200,000-token context window and a maximum output of 128,000 tokens. These limits are useful for repository-scale coding, long documents, detailed reasoning, and multi-step agent workflows.


Sources 5
AI Provider

About Z.ai