GLM 5.4 Launches on Vercel AI Gateway With Loop Transformer
Z.ai's Loop Transformer flagship GLM 5.4 is now live on Vercel AI Gateway with 1M context, image input, Zero Data Retention, and zero platform markup.
By Dillip Chowdary • Dec 02, 2026 • Source: Vercel Blog

At a glance
- Model ID
- zai/glm-5.4 (Z.ai flagship)
- Architecture
- Loop Transformer (shared block run twice)
- Context window
- 1M tokens with sparse attention & caching
- New input
- Image input plus 3D/CAD/game/video coding
- Privacy option
- Team-wide Zero Data Retention (ZDR)
- Pricing fee
- Provider rate; 0% Vercel Gateway markup
In this post
Z.ai's new flagship coding and agentic model, GLM 5.4, is now available on Vercel AI Gateway with Zero Data Retention support. As detailed in Vercel Blog's report, GLM 5.4 is the first GLM release built on a Loop Transformer architecture, running a shared block of layers twice per forward pass to deepen reasoning without adding parameters.
This product update covers what changed in GLM 5.4's architecture and multimodal inputs, how AI Gateway handles Zero Data Retention and Bring Your Own Key routing, and the exact commands and SDK configuration needed to switch agents and apps to zai/glm-5.4. Application engineers and coding-agent users can adopt the model without platform fees or provider markup.
01Loop Transformer architecture and generalized coding
Unlike earlier GLM flagship releases, GLM 5.4 introduces image input support alongside what Z.ai describes as generalized coding capabilities. Developers can prompt the model to write code for videos, games, interactive 3D scenes, and CAD-style mechanical designs in addition to standard software engineering.
The Loop Transformer design executes a shared layer block twice per forward pass so reasoning improves without expanding parameter count. Z.ai reports that shifting part of the reasoning process into that second pass reduces visible thinking tokens and shortens the chain of thought.
Note: Z.ai notes that on certain difficult tasks, GLM 5.4 may still spend a long time reasoning before returning its final answer.
02Improvements over earlier GLM flagship models
GLM 5.4 preserves a 1M-token context window while combining prompt caching, sparse attention, tool calling, and structured outputs to keep long-context agent requests efficient. Because Vercel AI Gateway mirrors provider pricing with zero markup and charges no platform fee on inference—including Bring Your Own Key (BYOK) traffic—teams pay only underlying provider rates.
| Capability | Earlier GLM flagships | GLM 5.4 on AI Gateway |
|---|---|---|
| Core architecture | Standard single-pass layers | Loop Transformer (shared block run twice) |
| Reasoning trace | Longer visible thinking tokens | Part of reasoning shifted to second pass |
| Multimodal input | Text-only flagship input | Accepts image input plus generalized coding |
| Context & agent features | Standard context handling | 1M context, sparse attention, caching, tool calling |
| Privacy & gateway markup | Provider-dependent terms | Zero Data Retention toggle; 0% gateway markup |
03Zero Data Retention and unified routing controls
Advertisement
Tech Pulse Daily
Get tomorrow's pulse first
Join engineers who read Tech Pulse before stand-up. Free, weekday mornings.
Vercel AI Gateway exposes GLM 5.4 with Zero Data Retention (ZDR) support out of the box. Organizations can toggle the team-wide ZDR setting so requests route strictly to ZDR-compliant providers rather than standard endpoints.
Beyond privacy routing, AI Gateway centralizes retries, automatic failover, custom usage and cost reporting, per-API-key budgets, and latency optimizations across models. According to Vercel, those routing layers aim to deliver higher uptime than calling individual model providers directly.
04How to configure GLM 5.4 in SDKs and coding agents
Developers calling the model from TypeScript or JavaScript applications pass the identifier zai/glm-5.4 directly to the AI SDK streamText API or Chat Completions endpoint.
```js
import { streamText } from 'ai';To use GLM 5.4 inside coding agents such as Claude Code, Codex, and Cursor, install the latest Vercel CLI, run the AI Gateway setup wizard, and select zai/glm-5.4 inside your agent configuration.
npx vercel ai-gateway setup- Install or update Vercel CLI Ensure your local environment has the latest Vercel CLI available before running the gateway setup command.
- Run AI Gateway setup Execute npx vercel ai-gateway setup in your terminal to link your coding agent environment to Vercel AI Gateway.
- Select the model ID Choose zai/glm-5.4 inside Claude Code, Codex, Cursor, or your AI SDK streamText configuration, and enable team-wide ZDR if required.
05Long-context efficiency and agentic adoption
Shipping GLM 5.4 with a 1M-token context window, sparse attention, structured outputs, prompt caching, and Zero Data Retention gives enterprise agent builders a single endpoint for software engineering, 3D/CAD scripting, and multimodal tasks. Because Vercel AI Gateway exposes the model alongside an interactive playground and unified API for Chat Completions and the AI SDK, teams can test zai/glm-5.4 across coding agents or production pipelines without paying extra platform fees.
Developers evaluating GLM 5.4 for long-horizon coding and visual workflows can monitor how its Loop Transformer dual-pass execution balances response latency against reduced visible thinking tokens on complex engineering tasks. Watch how team-wide ZDR routing and BYOK compatibility shape enterprise adoption across Vercel AI Gateway deployments.
Frequently asked questions
How does GLM 5.4's Loop Transformer architecture work?
The Loop Transformer runs a shared block of layers twice per forward pass, allowing GLM 5.4 to reason more deeply without adding parameters and shifting some reasoning out of visible thinking tokens.
What new capabilities does GLM 5.4 add compared with earlier GLM flagship models?
Unlike earlier GLM flagships, GLM 5.4 accepts image input and adds generalized coding for videos, games, 3D scenes, and CAD-style mechanical design alongside a 1M-token context window, tool calling, structured outputs, and prompt caching.
How do I use GLM 5.4 in Claude Code, Codex, or Cursor via Vercel AI Gateway?
Install the latest Vercel CLI, run npx vercel ai-gateway setup, and select zai/glm-5.4 in your coding agent, or pass model: 'zai/glm-5.4' to the AI SDK streamText function.
Does Vercel AI Gateway charge extra fees or support Zero Data Retention for GLM 5.4?
GLM 5.4 supports team-wide Zero Data Retention routing on AI Gateway, and Vercel reflects provider pricing with zero markup and no platform fee, including on Bring Your Own Key requests.
Sources
Author
Dillip Chowdary
Writes Tech Bytes coverage of AI, engineering, and the tools that actually ship. Editor of Tech Pulse Daily.
Related on Tech Bytes
Advertisement