chat
Skill72 starsChanged 45 days agoApache-2.0View on GitHub
Write correct Sarvam AI chat-completion code (Sarvam-105B, Sarvam-30B) — OpenAI-compatible API, streaming, reasoning mode, and the content=None gotcha. Use this skill when building chatbots, Q&A, agents, or Indic LLM features in Python or JS/TS. For a live completion in chat via MCP, use sarvam-mcp instead.
- Reads credentials
8 other projects use a version of this.
Adopted by
Most recently taken up by
- vercel-labs/json-rendertheir own version, first seen Nov 8, 2026
- aniketshukla1/sdlc-kittheir own version, first seen Nov 8, 2026
- reutavidan/zetesis-plugintheir own version, first seen Nov 1, 2026
- agoopintsai/shiprighttheir own version, first seen Nov 1, 2026
- tonydzi/second-brain-starter-kittheir own version, first seen Sep 8, 2026
- maxwellsdm1867/wheelertheir own version, first seen Aug 8, 2026
Other versions8 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 8
- vercel-labs/json-render★ 19ksame name
- maxwellsdm1867/wheeler★ 12same name
- tonydzi/second-brain-starter-kit★ 6same name
- agoopintsai/shipright★ 2same name
- aniketshukla1/sdlc-kit★ 1same name
- Mheaus/claude-skills★ 1same name
- reutavidan/zetesis-plugin★ 0same name
- verging-ai/agent-skills★ 0same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository7 other files it gives its agents.
- doc-aiSkill
- dubbingSkill
- sarvam-mcpSkill
- speech-to-textSkill
- text-to-speechSkill
- vibe-codingSkill
- voice-agentsSkill
The file
Files
Chat Completions — Sarvam AI
Live in-chat completion → sarvam-mcp (
sarvam_tools_llm_complete). This skill = SDK code.
[!IMPORTANT] Auth:
api-subscription-keyheader — NOTAuthorization: Bearer. Base URL:https://api.sarvam.ai/v1
Models
| Model | Context | Best For |
sarvam-105b | 128K | Complex reasoning, coding, agentic workflows |
sarvam-105b-conversations | 32K | Real-time chat, voice agents, conversational AI |
sarvam-30b is deprecated — migrate to sarvam-105b for complex tasks or sarvam-105b-conversations for real-time/voice (the model built to fill sarvam-30b's old slot). The fixed-context variants (sarvam-105b-32k, sarvam-30b-16k) are retired — base models serve their full context window directly.
Also available (beta, on /v2/chat/completions): open-weight models glm5.3 (1M context, reasoning), deepseekv4-flash (1M context, reasoning), gemma4 (131K context, text+image, no reasoning). Requires beta access on your API key. Called via client.chat.completions_v2(...) in Python — not .completions(). Still under beta and expected to GA soon — see Full Docs for details.
Quick Start (Python)
from sarvamai import SarvamAI
client = SarvamAI()
response = client.chat.completions(
model="sarvam-105b-conversations",
messages=[{"role": "user", "content": "भारत की राजधानी क्या है?"}]
)
print(response.choices[0].message.content)Streaming (Python)
for chunk in client.chat.completions(
model="sarvam-105b-conversations",
messages=[{"role": "user", "content": "Write a poem about India"}],
stream=True
):
if chunk.choices and chunk.choices[0].delta.content:
print(chunk.choices[0].delta.content, end="", flush=True)Quick Start (JavaScript/TypeScript)
import { SarvamAIClient } from "sarvamai";
const client = new SarvamAIClient({ apiSubscriptionKey: "YOUR_SARVAM_API_KEY" });
const response = await client.chat.completions({
model: "sarvam-105b-conversations",
messages: [{ role: "user", content: "भारत की राजधानी क्या है?" }]
});
console.log(response.choices[0].message.content);OpenAI-Compatible (both languages)
from openai import OpenAI
client = OpenAI(api_key="your-key", base_url="https://api.sarvam.ai/v1")
response = client.chat.completions.create(model="sarvam-105b-conversations", messages=[...])Gotchas
| Gotcha | Detail |
| SDK method | Python: client.chat.completions(...), JS: client.chat.completions({...}) — no .create() in either. OpenAI SDK uses .create() as usual. |
| JS constructor | new SarvamAIClient({ apiSubscriptionKey: "..." }) — NOT SarvamAI(). Key is passed explicitly. |
content can be None | Models produce reasoning_content before content. If max_tokens is too low, reasoning consumes the budget, finish_reason is "length", and content is None. Omit max_tokens, set 500+, or disable reasoning with reasoning_effort=None. Check reasoning_content as fallback. Verified live: this is real and a little flaky — the same short prompt at max_tokens=500 returned content=None once and content="OK" on retry, with reasoning eating 251 of the 500 tokens that time. Don't treat 500 as a guarantee; check reasoning_content/finish_reason regardless. |
| reasoning_effort | Thinking is on by default at "low". Values: "low"|"medium"|"high", or None to disable reasoning entirely. NOT thinking=True. Reasoning tokens count toward completion tokens and billing. |
sarvam-30b now hard-errors, not just "deprecated" | Verified live: calling it returns 400 invalid_request_error — "Model 'sarvam-30b' has been deprecated. Please use one of the available models instead: sarvam-105b, sarvam-105b-conversations." It's not a soft warning; existing code on sarvam-30b is already broken. Migrate to sarvam-105b or sarvam-105b-conversations. |
| Open-weight models: Python-only for now | glm5.3 / gemma4 / deepseekv4-flash go through client.chat.completions_v2(...) on /v2/chat/completions in Python (verified working, all three, with a beta-enabled key). Verified live: the installed JS SDK (sarvamai@1.1.10) has no completionsV2 method at all (client.chat.completionsV2 is not a function) — only .completions() exists in JS right now. Don't generate JS code calling completionsV2 until the JS SDK ships it; check npm ls sarvamai / the changelog first. |
Full Docs
Fetch detailed parameters, tool calling, streaming, and examples from:
- https://docs.sarvam.ai/llms.txt — comprehensive docs index
- Chat Completion Guide
- Model Specs
- Rate Limits
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

