Open-Weight Models

Beta
View as Markdown

Sarvam serves a curated set of open-weight models using your existing Sarvam API key and credits. Open-weight models are available on /v2.

Available in beta. GLM-5.3, Gemma 4 31B, and DeepSeek V4 Flash are rolling out gradually. Your API key must be whitelisted for beta access before these models respond. Contact us to request access.

Available models

All three models support tool calling and produce text output. GLM-5.3 and DeepSeek V4 Flash expose reasoning output.

ModelContext windowModalityReasoning
GLM-5.31,048,576 tokensText → textYes
Gemma 4 31B131,072 tokensText + image → textNo
DeepSeek V4 Flash1,048,576 tokensText → textYes

Reasoning (glm5.3, deepseekv4-flash)

Three levels: low, high, and max. Default when omitted is max.

RouteFieldValues
Chat Completion V2reasoning_effortlow, high, or max — omit or pass max for maximum
Responsesreasoning.effortlow, high, or omit for max — do not send the string max (400)

Chat: choices[].message.reasoning_content. Responses (glm5.3): reasoning item in output, summary[0].text. Reasoning tokens count toward max_tokens / max_output_tokens (default 2048 when omitted on glm5.3). Gemma 4 31B does not expose reasoning.

Using open-weight models

Chat Completion

from sarvamai import SarvamAI
client = SarvamAI(api_subscription_key="YOUR_SARVAM_API_KEY")
response = client.chat.completions_v2(
model="glm5.3",
messages=[
{"role": "user", "content": "Summarise the causes of the 2008 financial crisis."}
],
temperature=1,
top_p=0.95,
max_tokens=1000,
)
print(response.choices[0].message.content)

Shared behaviour