Z.ai publishes GLM-5.2, an open-weights model for long-context code

Z.ai releases GLM-5.2, an open-weights Mixture-of-Experts model with a 1-million-token context window optimized for long-context code agent trajectories.

GLM-5.2, the new flagship model from Z.ai (the Chinese company formerly known as Zhipu AI), targets long and autonomous tasks. The architecture remains a Mixture-of-Experts with approximately 744 billion parameters, with about forty billion active per query. Its main evolution is a context window extended from 200,000 to one million tokens, which Z.ai says it has made usable for long code agent trajectories, and not just wider. Two levels of reasoning effort, High and Max, balance between performance, latency, and cost.

Regarding architecture, the company details IndexShare, a shared indexer every four sparse attention layers which lowers the computational cost per token in very long contexts. According to its own measurements, Z.ai ranks GLM-5.2 first among open-weights models on several long-term code benchmarks, ahead of GPT-5.5 on one of them and a few points shy of Claude Opus 4.8, for a significantly lower usage cost than that of closed models. The weights are available under an MIT license on Hugging Face, and the model can also be used via Z.ai's API and chat, in about twenty code tools including Claude Code, or locally.