GenAIWiki
intermediate

Evaluate Sarvam 105B for Indic Language RAG

Build a practical evaluation loop for Indic and code-mixed RAG with Sarvam 105B: corpus design, chat API checks, 30B routing, and comparison against your quality bar.
sarvam-105bragindicevaluationmultilingualsarvam

11 min read

FeaturedUpdated 9 days agoVerified this monthInformation score 91

Key insights

Concrete technical or product signals.

  • Evaluate Indic and code-mixed questions—not English-only corpora.
  • Fix retrieval hit-rate before swapping generator models.
  • Use Sarvam 30B vs 105B as a routed quality/latency trade-off after measurement.

Use cases

Where this shines in production.

  • Standing up an Indic policy RAG pilot with Sarvam 105B
  • Comparing 30B and 105B on the same multilingual eval set
  • Adding citation checks for support-agent assistants

Limitations & trade-offs

What to watch for.

  • API base URLs, model IDs, and conversational variants change—confirm live Sarvam docs.
  • Vendor benchmarks are not application faithfulness.
  • Embedding/retriever language support can dominate generator choice.

Sarvam 105B is a strong fit when your product must answer in Indian languages, romanized text, and code-mixed user turns—not English-only demos. This tutorial shows how to evaluate it for RAG before you standardize model IDs or compare against Sarvam 30B and other frontier options such as DeepSeek R1 via comparison pages.

Sarvam documents OpenAI-compatible chat completions, a 128K context window on 105B, streaming, and Apache 2.0 licensing. Always confirm the live model ID and endpoint in Sarvam’s model docs.

1. Define the RAG job in product language

Write a one-paragraph success definition, for example:

“Support agents in Hindi, Tamil, and Hinglish can ask questions about our policy PDFs and get cited answers with ≤X% critical errors.”

Capture:

  • Languages and scripts you must support
  • Whether voice transcripts / romanization appear
  • Citation requirements
  • Latency and cost budgets
  • Whether coding or tool use is in scope (105B is also positioned for reasoning/coding—not only chat)

2. Build a tiny but nasty evaluation corpus

Do not evaluate with English Wikipedia only. Create 30–50 questions across:

SliceWhy it matters
Native scriptHindi/Tamil/etc. policy questions
RomanizedMobile-typing patterns
Code-mixedReal user mixes
Retrieval trapsNear-duplicate policies, outdated clauses
Refusal / privacyRequests for other customers’ data

Store gold answers or acceptable citation IDs. Keep PII out of the shared eval set.

3. Fix retrieval before you blame the LLM

For each question, log:

  • Top-k chunks and scores
  • Whether the gold passage was retrieved
  • Answer faithfulness given only those chunks

If retrieval misses, fix chunking, language-aware embedding, or hybrid search before swapping sarvam-105b for another model.

4. Call Sarvam with an OpenAI-compatible chat shape

Use the official chat-completions path and the exact model ID from current docs (sarvam-105b vs conversational variants such as sarvam-105b-conversations when you need dialogue-oriented behavior). Sketch:

from openai import OpenAI

client = OpenAI(
    api_key="YOUR_SARVAM_KEY",
    base_url="https://api.sarvam.ai/v1",  # confirm in current Sarvam docs
)

def answer(question: str, chunks: list[str]) -> str:
    context = "\n\n".join(chunks)
    resp = client.chat.completions.create(
        model="sarvam-105b",
        messages=[
            {
                "role": "system",
                "content": (
                    "Answer using only the provided context. "
                    "Cite chunk numbers. If context is insufficient, say so."
                ),
            },
            {
                "role": "user",
                "content": f"Context:\n{context}\n\nQuestion: {question}",
            },
        ],
        temperature=0.2,
    )
    return resp.choices[0].message.content

Verify base_url, auth headers, and model IDs against Sarvam’s current documentation before production.

5. Score with humans + simple automatic checks

For each item, score:

  • Correctness in the user’s language
  • Citation validity (chunk exists and supports the claim)
  • Language appropriateness (did it inappropriately switch to English?)
  • Safety (no cross-tenant leakage)

Track vendor-reported benchmarks separately from this application eval.

6. Decide 105B vs 30B routing

Sarvam positions 30B as lower-latency / lower-cost for many real-time chat turns (64K context documented) and 105B for harder reasoning and long-form quality (128K). A practical pattern:

  1. Route simple FAQ turns to 30B after it clears your language bar.
  2. Escalate long-context or high-risk answers to 105B.
  3. Keep a manual review queue for low-confidence citations.

7. Ship gate

  • Eval set covers native, romanized, and code-mixed traffic
  • Retrieval hit-rate on gold passages measured
  • Faithfulness scored with fixed chunks
  • 30B vs 105B latency/quality trade-off recorded
  • Logging redacts raw user PII where required

Official sources

Continue learning

Related models, implementation guides, comparisons, and concepts.