Best suited for
- 01
Semantic search
Find relevant documents or code by meaning, including across languages.
- 02
Retrieval for chat and agents
Fetch the most relevant passages so answers draw on your own documents.
- 03
Classification and clustering
Group similar content, assign labels and identify near-duplicates using embedding similarity.
API usage
Build with the Sarvam SDK
pip install --upgrade sarvamaiV2 · Sarvam SDK · Embeddings APIfrom openai import OpenAIclient = OpenAI(api_key="YOUR_SARVAM_API_KEY",base_url="https://api.sarvam.ai/v2",)response = client.embeddings.create(model="embeddinggemma-2",input=["task: search result | query: how do I reset my password","title: none | text: To reset your password, open Settings > Security.",],)query, document = (item.embedding for item in response.data)similarity = sum(q * d for q, d in zip(query, document))print(f"cosine similarity: {similarity:.3f}")
- 01 Install the Sarvam SDK
Install
sarvamaifor Python or JavaScript. Store your key inSARVAM_API_KEY. - 02 Choose your model
Use model ID
embeddinggemma-2. The SDK callshttps://api.sarvam.ai/v2/embeddingsfor this example.V2 Chat Completions. Max reasoning is the default. Reasoning tokens count toward the 8,000-token output budget.
- 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 catalogueSarvam Prism
- Sarvam
- Decisions
System-1 decision model on Sarvam 105B. Send a state and typed questions; get a calibrated probability for every option in one call, with no text to parse.
Gemma 4 31B
- Chat
- Vision
31B-parameter instruction-tuned model for text and image understanding, with tool calling and optional reasoning.
Sarvam 105B
- Sarvam
- Chat
- Indian languages
Chat and tool calling across Indian languages and English, trained from scratch by Sarvam.
Build with frontier open-weight models. Served from India.
Build with frontier open-weight models. Served from India.