GLM-5.2
GLM-5.2
GLM-5.2 is an open-source model served by Sarvam in beta, and is not tuned for Indian languages. Beta access is granted per API key — contact us to request whitelisting. For Indian language workloads use Sarvam-105B instead.
A general-purpose open-source model. Its distinguishing feature on Sarvam is a very large 512K token context window — four times the 128K offered by Sarvam’s own chat models — which makes it a reasonable choice for reasoning over long documents or large codebases in a single request.
At a Glance
Why you might use it
A 524,288 token context window lets you pass entire books, long transcripts, or large code repositories in one request without chunking or retrieval.
Supports the OpenAI-compatible tools and tool_choice parameters, so it works with
agentic loops and function-calling frameworks.
Model Specifications
- Model ID:
glm5.2 - Context window: 524,288 tokens (512K)
- Tool calling: supported
- Image input: not supported — text only
- Reasoning: always on — the chain-of-thought arrives in a separate
reasoning_contentfield and counts againstmax_tokens; disable viaextra_body(see below) - Maximum request size: 10 MB
- Temperature range: 0 to 2 (unset uses the model’s own default)
- Top-p range: greater than 0, up to 1
- Supports streaming and non-streaming responses
- OpenAI-compatible chat completions format
GLM-5.2 vs Sarvam’s chat model
Pick GLM-5.2 only when your task genuinely needs more than 128K of context. For everything else — and especially for anything touching Indian languages — a Sarvam model will serve you better and comes with Sarvam’s own evaluation behind it.
Key Capabilities
Basic Chat Completion
Long-Context Analysis
Tool Calling
Streaming
A single-turn request. Only the model field differs from a Sarvam chat completion call.
The answer is in message.content. The model’s chain-of-thought arrives separately
in message.reasoning_content — see Reasoning below for how to budget
for it or turn it off.
Reasoning
GLM-5.2 thinks before every answer — by default, not only when reasoning_effort
is set. The chain-of-thought arrives in a separate reasoning_content field on the
message (delta.reasoning_content when streaming); content carries only the final
answer. Two practical consequences:
- Reasoning tokens are billed and count against
max_tokens. A small budget can be consumed entirely by reasoning, returningcontent: nullwithfinish_reason: "length". If your answers come back empty, raisemax_tokensor turn thinking off. - Turn thinking off when you set
response_format. With reasoning active, a JSON-constrained request returnscontent: nullinstead of JSON.
The off-switch goes through extra_body:
With thinking off, responses are faster, the whole max_tokens budget goes to the
answer, and Structured Outputs work reliably.
Parameters
GLM-5.2 accepts the standard OpenAI-compatible parameter set — temperature, top_p,
max_tokens, stream, stop, n, seed, frequency_penalty, presence_penalty,
reasoning_effort, response_format (Structured Outputs), tools, tool_choice, and
extra_body.
See the full parameter table
for types, defaults, and ranges.
Model-specific exceptions:
image_urlcontent parts are rejected (400) — GLM-5.2 is text only.response_formatrequires thinking off — see Reasoning above.seedis not currently reproducible on this model — identical seeds return different completions. Usetemperature: 0where you need stability.
Limits and errors
Common errors for every model on /v2/chat/completions are documented on the
Open-Source Models overview. GLM-5.2-specific cases:
Support
Sarvam supports the serving layer — auth, billing, rate limits, availability. Sarvam does not tune or evaluate this model, so its output quality, reasoning, and language coverage are properties of the model itself. See Open-Source Models for the full support boundary, and Talk to us for serving issues.