GLM 5.2 and the imminent collapse of margins with AI
The artificial intelligence market is experiencing a moment of effervescence, but also of deep economic reevaluation. Not long ago, the "DeepSeek moment" shook the stock markets, with the perception that if a model like R1 cost less than US$6 million to train, the massive capex investment for model training was numbered. Nvidia's shares, among others, felt the impact. But, as in many moments of panic, the market's reading was fundamentally wrong. The real cost of AI is not where most people think, and this misunderstanding is about to be brutally corrected by the rise of open weights models.
The True Cost of AI and the Illusion of the "DeepSeek Moment"
The confusion lies in distinguishing training costs from inference costs. Training a cutting-edge AI model is, without a doubt, capex-intensive and requires hundreds of millions of dollars. It's a fixed, upfront cost that you pay once and, in theory, "you're done." Inference, on the other hand, which is the use of the model in production to generate responses, scales with demand. It has genuine marginal costs.
AI API providers, such as Anthropic and OpenAI, charge fees that, at first glance, seem to reflect their true costs. However, a quick analysis suggests that these companies operate with extremely high gross profit margins. My back-of-the-napkin calculations indicate that, for inference, the margin can reach 90% over the cost of compute compared to the list price. Although leaked financial reports from OpenAI suggest a gross margin of about 60% on total revenue (which includes other costs like support and payment processing), the business model of leading AI labs is clear: spend a lot on salaries and compute to train a model, and then amortize that cost with highly profitable inference. If you can amortize that cost over enough inference, your operation indeed becomes profitable.
GLM 5.2 Enters the Game: Open Weights Quality
It is in this scenario that Z.ai's GLM 5.2 enters the scene. I've been testing GLM 5.2 for the past few weeks, and for me, it's the first model that reaches the level of a genuine open weights competitor for models like Opus and GPT (at the time the original article was written, the latest GPT was 5.5). The quality is impressive; it's genuinely difficult for me to differentiate it from Opus, which I use daily.
Of course, it has its peculiarities. GLM 5.2 tends to be a bit slow due to the amount of "thinking" it performs. For non-interactive agentic tasks (like reviewing pull requests in the background), where time is not critical, this is not a problem. But for interactive use, it's a bit too slow to hold my attention, which also reduces its cost-effectiveness (more "thinking" means more tokens, increasing costs).
Another notable limitation is the lack of vision support. It's curious how quickly I went from never wanting to use vision (due to inaccuracy) to using it all the time, especially since Opus 4.7 introduced much higher resolution vision capabilities. It's frustrating not being able to read image-based PDFs, screenshots, and design files. I'm sure a multimodal model is in development, but this is a significant weakness compared to leading labs.
Finally, and something I truly didn't expect to be an obstacle, is the absence or low quality of web search capabilities. I found that almost every agentic session involves a lot of web research. Z.ai offers an MCP (Meta-Cognitive Processor) for web search, but it's quite bad and slow. Fireworks doesn't offer any. I managed to work around this by instructing the agent to use a CLI search like ddgr, but it's a real weakness. However, I am optimistic about the potential of third-party web search APIs; this is a huge gap for open weights model providers, and quality search is essential for many agentic tasks. In time, this will surely be resolved.
The Fall of Barriers: Trivial Migration and Cost Savings
Where the situation becomes truly daunting for leading labs is the ease of migrating to open weights models. Both Z.ai and Fireworks offer OpenAI and Anthropic-compatible endpoints. This makes it trivial to use with tools like Claude Code and Codex. Simply configure the base URL to point to your inference provider, provide the API key, and instruct it to use GLM 5.2.
Considering that Anthropic recently announced (and then backtracked) on charging API fees for non-interactive agentic use of Claude, you'll find that for many (or most) of these use cases, you can simply "drop" GLM in its place. And for interactive use, aside from the lack of vision and slightly slower speed, it was almost impossible for me to notice I wasn't using Opus in Claude Code.
We're not talking about lock-in like Microsoft's or Salesforce's, where you need years to plan a migration. Switching costs are incredibly low, and I would argue, even lower than trying to keep up with all the policy and terms changes that leading lab models tend to make. It's possible that Claude Code will make it difficult to use third-party providers, but there are many good open source options (like Codex itself and OpenCode, among dozens).
One concern I hear from companies is data privacy and security. There's no doubt that using the official API and Z.ai subscription is almost certainly unfeasible, with its terms being, at best, weak, and the deep connection to mainland China. But, of course, as open weights are open, there are many other providers on the market, many with adequate contractual provisions. And, if that's not enough, you can, naturally, host the model on-premises, which opens up the possibility of working with even more sensitive data — that couldn't be sent to third parties — in Opus-quality agentic workflows.
Why This Matters
The AI landscape is rapidly changing. The rise of high-quality open weights models like GLM 5.2, combined with the ease of integration and the possibility of on-premises hosting, is about to implode the profit margins that major AI labs currently enjoy in inference. For us developers, this means more options, lower cost, and greater control over our data and infrastructure. Prepare for a future where cutting-edge AI will be more accessible and customizable than ever before.
Sources
📬 Enjoyed this? Subscribe to the Vaccari's Code newsletter for the next wave of software & AI trends, straight to your inbox: Subscribe here