Blog

GLM 5.2 Is Now Available in Puter.js

On this page

Puter.js now supports GLM-5.2, Z.AI's latest flagship coding model featuring a 1M-token context window and two thinking effort levels for long-horizon agentic tasks.

What is GLM-5.2?

GLM-5.2 is the newest release in the GLM-5 family from Z.AI (the international brand for Zhipu AI). It builds on the 744B-parameter Mixture of Experts architecture (40B active per token) and extends the context window far beyond its predecessors. Key highlights include:

  • 1M-Token Context Window: Process entire codebases in a single pass with a 1,048,576-token context window—roughly 5x larger than GLM-5.1's 200K context (up to 262,144 output tokens per response)
  • Two Thinking Effort Levels: Choose between High (faster, lighter tasks) and Max (complex, multi-step coding) to match compute to the job
  • Long-Horizon Coding: Designed for autonomous coding workflows that span planning, implementation, testing, and iteration in a single session

Examples

Full-codebase review

puter.ai.chat(`Review this entire repository and identify all places where error handling is missing or incomplete:
${repoContents}`,
  { model: 'z-ai/glm-5.2', stream: true }
);

Multi-step feature implementation

puter.ai.chat(`Implement a rate-limiting middleware for this Express API:
1. Design the token bucket algorithm
2. Add Redis-backed storage for distributed deployments
3. Write unit tests covering burst and steady-state scenarios
4. Document the configuration options`,
  { model: 'z-ai/glm-5.2' }
);

Large document processing

puter.ai.chat(`Summarize the key decisions and open questions from these 500 pages of architecture docs:
${architectureDocs}`,
  { model: 'z-ai/glm-5.2' }
);

Complex debugging

puter.ai.chat(`Trace this bug through the call stack, identify the root cause, and propose a fix with minimal side effects:
${stackTrace}
${relevantSourceFiles}`,
  { model: 'z-ai/glm-5.2' }
);

Get Started Now

Just add one library to your project:

// npm install @heyputer/puter.js
import { puter } from '@heyputer/puter.js';

Or add one script tag to your HTML:

<script src="https://js.puter.com/v2/"></script>

No API keys needed. Start building with GLM-5.2 immediately.

Learn more:

Free, Serverless AI and Cloud

Start creating powerful web applications with Puter.js in seconds!

Get Started Now

Read the Docs Try the Playground