Skip to navigation

Open-Weight Models

View as Markdown

Run leading open-weight models on Sarvam infrastructure through the same OpenAI-compatible /v2 API, with your existing Sarvam API key and credits. Switching models is a one-line change to the model field.

GLM-5.3, GLM-5.3 Flash, and Gemma 4 31B are generally available. DeepSeek V4.1 Flash 1017, DeepSeek V4 Pro, Kimi K3, MiMo V2.6 Flash, and MiMo V2.6 Pro are in beta.

Choose a model

Pick a use case, or filter by status and input type. Click a model ID to copy it.

I need
Accepts

Showing 8 of 8 models

GLM-5.3 GA

Software engineering and long-horizon agents.

Context
1M
Reasoning
On, can't turn off
Input
Text
₹ per 1M in / out
₹126 / ₹390
GLM-5.3 Flash GA

Faster GLM-5.3 with image input.

Context
1M
Reasoning
On, can't turn off
Input
TextImage
₹ per 1M in / out
₹13.5 / ₹45
Gemma 4 31B GA

Fast direct answers and image understanding.

Context
256K
Reasoning
Off by default
Input
TextImage
₹ per 1M in / out
₹35 / ₹90
DeepSeek V4.1 Flash 1017 Beta

Low-cost reasoning for long documents and agents.

Context
1M
Reasoning
On, can turn off
Input
TextImage
₹ per 1M in / out
₹25 / ₹105
DeepSeek V4 Pro Beta

Larger DeepSeek V4 for harder text reasoning.

Context
1M
Reasoning
On, can turn off
Input
Text
₹ per 1M in / out
₹115 / ₹350
Kimi K3 Beta

Always-on reasoning with image and video input.

Context
1M
Reasoning
On, can't turn off
Input
TextImageVideo
₹ per 1M in / out
₹270 / ₹1,350
MiMo V2.6 Flash Beta

Lowest-cost reasoning across text, image, audio, and video.

Context
1M
Reasoning
On, can turn off
Input
TextImageAudioVideo
₹ per 1M in / out
₹12.5 / ₹25
MiMo V2.6 Pro Beta

Larger MiMo V2.6 for harder multimodal tasks.

Context
1M
Reasoning
On, can turn off
Input
TextImageAudioVideo
₹ per 1M in / out
₹40 / ₹80

Prices are in ₹ per 1M tokens; reasoning is billed as output. See Pricing. Each model’s reasoning default, and how to turn it off, is under Reasoning.

Every model supports tool calling, streaming, and structured output (response_format). Support for log probabilities, multiple choices (n > 1), and other parameters varies by model — see each model’s own Supported Parameters table, or V2 feature support for the full matrix.

ModelContextInput₹ per 1M in / out
GLM-5.3
glm5.3
1MText126 / 390
GLM-5.3 Flash
glm5.3-flash
1MText, image13.5 / 45
Gemma 4 31B
gemma4
256KText, image35 / 90
DeepSeek V4.1 Flash 1017 (beta)
deepseekv4.1-flash-1017
1MText, image25 / 105
DeepSeek V4 Pro (beta)
deepseekv4-pro
1MText115 / 350
Kimi K3 (beta)
kimi-k3
1MText, image, video270 / 1,350
MiMo V2.6 Flash (beta)
mimo-v2.6-flash
1MText, image, audio, video12.5 / 25
MiMo V2.6 Pro (beta)
mimo-v2.6-pro
1MText, image, audio, video40 / 80
  • Coding and agents: glm5.3, the strongest reasoning
  • Lowest cost: mimo-v2.6-flash, the lowest per-token price
  • Fastest answers, with image input: gemma4, which skips reasoning by default
  • Reasoning on images: glm5.3-flash or kimi-k3

Quickstart

1

Get an API key

Create an API key in the dashboard.

2

Set your key

export SARVAM_API_KEY="your-api-key"
3

Make your first call

Open-weight models are served on POST /v2/chat/completions. Pick your SDK:

import os
from sarvamai import SarvamAI
client = SarvamAI(api_subscription_key=os.environ["SARVAM_API_KEY"])
response = client.chat.completions_v2(
model="glm5.3", # or "gemma4", "deepseekv4.1-flash-1017", "kimi-k3", ...
messages=[
{"role": "user", "content": "Summarise the causes of the 2008 financial crisis."}
],
max_tokens=1000,
)
print(response.choices[0].message.content)

Already use the OpenAI SDK? Point base_url at https://api.sarvam.ai/v2 and pass your Sarvam key as api_key. The endpoint also accepts Authorization: Bearer <key>. Native Sarvam clients use the api-subscription-key header. See Authentication.

Common patterns

Set stream=True to receive server-sent events. Reasoning models stream reasoning_content deltas first, then the final content.

stream = client.chat.completions.create(
model="glm5.3",
messages=[{"role": "user", "content": "What is 17 * 23?"}],
reasoning_effort="low",
max_tokens=1000,
stream=True,
)
for chunk in stream:
if not chunk.choices:
continue
delta = chunk.choices[0].delta
if getattr(delta, "reasoning_content", None):
print(delta.reasoning_content, end="", flush=True) # thinking
if delta.content:
print(delta.content, end="", flush=True) # answer

Reasoning

Most models think before answering; Gemma 4 does only when you set an effort. Defaults, and whether thinking can be turned off, differ by model:

ModelDefault effortTurn thinking off
glm5.3maxNot supported
glm5.3-flashhighNot supported
gemma4Off; turn it on with reasoning_effort (low or high on Responses)Off by default
deepseekv4.1-flash-1017highreasoning_effort: "none"
deepseekv4-prohighreasoning_effort: "none" or thinking: {"type": "disabled"}
kimi-k3maxNot supported; thinking is always on
mimo-v2.6-flash, mimo-v2.6-proOnreasoning_effort: "none", thinking: {"type": "disabled"}, or chat_template_kwargs.enable_thinking: false. Other effort values only switch thinking on

Send thinking and chat_template_kwargs through extra_body in the SDKs. Accepted effort values are listed on each model page.

On the Responses API, do not send the string "max" to glm5.3 or glm5.3-flash. It returns 400. Omit reasoning.effort instead: that gives max on glm5.3 and high on glm5.3-flash.

Reasoning tokens count toward max_tokens and are billed as output. If you see empty content with finish_reason: "length", the model spent the whole budget thinking. Raise max_tokens or lower the effort. On glm5.3, max_tokens defaults to 2048.

Troubleshooting

SymptomLikely causeFix
403 invalid_api_key_errorMissing or wrong key headerCheck api-subscription-key or the Bearer token
404 not_found_errorUnknown or wrongly cased model IDIDs are case-sensitive. List the models enabled for your key with GET /v2/models
400 “This model is currently in beta”Your key doesn’t have beta accessContact us to enable beta models for your key
Empty content, finish_reason: "length"Reasoning used the token budgetRaise max_tokens or lower reasoning_effort
400 invalid_request_error on a specific parameterParameter unsupported by this modelCheck the model’s own Supported Parameters table
402 insufficient_quota_errorNo credits leftAdd credits in the dashboard
429 rate_limit_exceeded_error / model_rate_limit_exceeded_error, or 503 model_overloadedRate limit, model capacity, or overloadRetry with exponential backoff

Production tips

Rate limits and temporary overload are retryable. The OpenAI SDK retries these automatically with backoff when you raise max_retries:

client = OpenAI(
base_url="https://api.sarvam.ai/v2",
api_key=os.environ["SARVAM_API_KEY"],
max_retries=4,
timeout=120, # reasoning at high effort can take a while
)

Set max_tokens well above your expected answer length, at least a few thousand for high or max effort, because thinking tokens share the same budget.

Use low for extraction, classification and chat. Reserve high and max for math, debugging and multi-step planning, where extra thinking improves quality at higher latency and cost.

Read the model ID from configuration, for example model=os.environ.get("SARVAM_MODEL", "glm5.3"), so you can compare models on your own prompts. Only change parameters the target model supports, see the comparison table above.

Platform details

  • Chat: POST https://api.sarvam.ai/v2/chat/completions, see the API reference.
  • Responses: POST https://api.sarvam.ai/v2/responses, see the API reference.
  • Models: GET /v2/models lists the models enabled for your key. Beta models appear only for keys that have beta access.

Usage is metered per token against your Sarvam credits, see Pricing. Reasoning is billed as output. Limits apply per API key, see Credits & Rate Limits.

DeepSeek V4.1 Flash 1017, DeepSeek V4 Pro, Kimi K3, MiMo V2.6 Flash, and MiMo V2.6 Pro are in beta. See Beta models.

Next steps