Best suited for
- 01
Visual document extraction
Combine page images and text instructions to extract fields, interpret layouts and prepare information for downstream systems.
- 02
High-volume conversations
Generate direct responses for chat and support workflows without a separate reasoning step.
- 03
Image-grounded tool use
Use visual context alongside function calling to turn information from images into application actions.
Build with the Sarvam SDK
pip install --upgrade sarvamaiV2 · Sarvam SDK · Streamingimport osfrom sarvamai import SarvamAIclient = SarvamAI(api_subscription_key=os.environ["SARVAM_API_KEY"])stream = client.chat.completions_v2(model="gemma4",messages=[{"role": "user", "content": "Explain why time to first token matters for a chat application briefly."}],max_tokens=8000,stream=True,)for chunk in stream:if not chunk.choices:continuetext = chunk.choices[0].delta.contentif text:print(text, end="", flush=True)
- 01 Install the Sarvam SDK
Install
sarvamaifor Python or JavaScript. Store your key inSARVAM_API_KEY. - 02 Choose your model
Use model ID
gemma4. The SDK callshttps://api.sarvam.ai/v2for this example.V2 Chat Completions. Thinking is off by default, so this example returns a direct answer.
- 03 Validate your application
Check output quality, supported parameters and tool behaviour on representative requests before moving production traffic.
Frequently Asked
Questions
Explore other models
View catalogueGLM 5.3
- Z.ai
- Reasoning and coding
- 1M context
Large-scale reasoning model built for complex software engineering and long-horizon agent tasks.
DeepSeek V4.1 Flash 1017
- DeepSeek
- Reasoning and coding
- 1M context
General-purpose open-weight model for long-document analysis and agentic workflows.
Sarvam 105B
- Sarvam
- Indian languages
- 128K context
Flagship 105B Mixture-of-Experts model trained from scratch for Indian-language understanding, complex reasoning, coding and agentic workflows.
From model choice to production. Bring your workload, traffic expectations and latency targets. Build on Sarvam’s serving stack in India.
From model choice to production.
Bring your workload, traffic expectations and latency targets. Build on Sarvam’s serving stack in India.