Sarvam AI
Google

EmbeddingGemma 2

Google's text embedding model for search, retrieval, clustering and classification.

  • Embeddings
Provisioned Throughput

Best suited for

  1. 01

    Semantic search

    Find relevant documents or code by meaning, including across languages.

  2. 02

    Retrieval for chat and agents

    Fetch the most relevant passages so answers draw on your own documents.

  3. 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 API
from openai import OpenAI​client = 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}")
  1. 01 Install the Sarvam SDK

    Install sarvamai for Python or JavaScript. Store your key in SARVAM_API_KEY.

  2. 02 Choose your model

    Use model ID embeddinggemma-2. The SDK calls https://api.sarvam.ai/v2/embeddings for this example.

    V2 Chat Completions. Max reasoning is the default. Reasoning tokens count toward the 8,000-token output budget.

  3. 03 Validate your application

    Check output quality, supported parameters and tool behaviour on representative requests before moving production traffic.

Read API docs

Frequently asked questions

Explore other models

View catalogue

Build with frontier open-weight models. Served from India.