Logo vun Chat

Chat

Organisatioun
sarvamai
chat

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.

Iwwersiicht

Editeursarvamai
Repositoryskills
Skill-Nummchat
Stären
72
Forks
24
Matgeliwwert Fichieren
Nëmmen Instruktiounen
LizenzApache-2.0
Linken
  • Instruktiounen am Markdown-Format

    Eng SKILL.md-Datei, déi de Modell bei Bedarf luet, soudatt nëmmen Token ufalen, wann eng Ufro tatsächlech dozou passt.

  • Funktionéiert mat all LLM

    KI-Skills si reng Markdown, keen ubidderspezifesche Code. Dofir funktionéiert dëse Skill mat GPT, Claude, Gemini, Grok oder engem lokale Modell.

  • Alles an den Instruktiounen

    Alles, wat de Modell brauch, steet an den Instruktiounen — keng zousätzlech Dateien ze synchroniséieren.

  • Open Source

    Vum sarvamai op GitHub verëffentlecht. Liest de Quelltext, ier Dir de Skill installéiert.

Installatioun

Installéiert de KI-Skill Chat an TypingMind, fir e mat all LLM ze benotzen, oder füügt en an en anere KI-Agent an, deen SKILL.md liest.

1

An TypingMind installéieren

TypingMind installéiert e Skill direkt aus sengem GitHub-Dossier — dobäi gëtt SKILL.md gelies, d'Ressourcedateie gi gebëndelt an d'Resultat gëtt lokal gespäichert.

  1. Maacht d'App op a gitt op Plugins → Skills.
  2. Wielt „Vun GitHub installéieren“.
  3. Pecht d'URL vum Skill-Dossier hei drënner an a bestätegt.
    https://github.com/sarvamai/skills/tree/main/chat
  4. Aktivéiert de Skill an all Chat, an deem Dir e benotze wëllt.
Plugins → Skills → Skill afügen → Vu GitHub-URL, pecht dann d'URL vum Dossier an a klickt op Weider.
2

An engem anere KI-Agent installéieren

All KI-Agent, deen d'Format Agent Skills liest, kann dëse Skill benotzen — kopéiert den Dossier an de Skill-Verzeechnes vun deem KI-Agent.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/sarvamai/skills.git /tmp/skills
mkdir -p .claude/skills
cp -r /tmp/skills/chat .claude/skills/chat
Start Claude Code nom Kopéieren nei, fir datt den neie Skill erkannt gëtt.

An TypingMind benotzen

Aktivéiert Chat an engem Chat vun TypingMind, an de Modell iwwerhëlt de Rescht. Den Numm an d'Beschreiwung stinn am System-Prompt. Soubal eng Ufro dozou passt, luet de Modell déi komplett Instruktioune selwer — Dir musst de Skill ni manuell opruffen, an et fale keng Token un, bis en tatsächlech benotzt gëtt.

De Modell luet Chat automatesch, soubal eng Ufro dozou passt.

Funktionéiert mat all KI-Modell

KI-Skills si reng Markdown-Instruktiounen amplaz vun ubidderspezifeschem Code. Dofir ass Chat net un de Modell gebonnen, fir deen de Skill geschriwwe gouf. Installéiert en eemol an TypingMind a benotzt e mat GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama oder engem lokale Modell, deen Dir selwer bedreift — alles mat Ären eegenen API-Keys.

  • Gëtt nëmme gelueden, wann et néideg ass

    De System-Prompt enthält nëmmen den Numm an d'Beschreiwung. D'Instruktioune gi bei der éischter passender Ufro gelueden, soudatt en onbenotzte Skill näischt kascht.

  • De Modell am lafende Chat wiesselen

    Well de Skill aus Instruktiounen amplaz vu Code besteet, funktionéiert en och no engem Modellwiessel — den nächste Modell liest déi selwecht SKILL.md-Datei.

Skill-Instruktiounen

Dëst ass den Inhalt vu SKILL.md, deen de Modell luet. Liest e virun der Installatioun — e Skill besteet aus Instruktiounen, déi Äre Modell befollegt.

Chat Completions — Sarvam AI

Live in-chat completion → sarvam-mcp (sarvam_tools_llm_complete). This skill = SDK code.

[!IMPORTANT] Auth: api-subscription-key header — NOT Authorization: Bearer. Base URL: https://api.sarvam.ai/v1

Models

ModelContextBest For
sarvam-105b128KComplex reasoning, coding, agentic workflows
sarvam-105b-conversations32KReal-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)

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)

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)

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)

python
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

GotchaDetail
SDK methodPython: client.chat.completions(...), JS: client.chat.completions({...}) — no .create() in either. OpenAI SDK uses .create() as usual.
JS constructornew SarvamAIClient({ apiSubscriptionKey: "..." }) — NOT SarvamAI(). Key is passed explicitly.
content can be NoneModels 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_effortThinking 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 nowglm5.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:

Heefeg gestallte Froen

Wat mécht de KI-Skill Chat?

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.

Firwat Chat op TypingMind benotzen?

Well Dir en eemol installéiert a mat all Modell benotze kënnt. Chat besteet aus einfachem Markdown amplaz vun ubidderspezifeschem Code. Dee selwechte Skill funktionéiert also mat GPT-5, Claude, Gemini, Grok oder engem lokale Modell – an Dir kënnt de Modell matzen am Chat wiesselen, ouni datt de Skill ophält ze funktionéieren. TypingMind benotzt Är eegen API-Schlësselen, sou datt Dir d'Ubidder direkt bezuelt amplaz vun engem Abonnement pro Benotzerplaz. Är Skills a Chats bleiwen an Ärem eegene Späicher.

Wéi installéieren ech Chat an TypingMind?

Maacht an TypingMind Plugins → Skills → Vu GitHub installéieren op a setzt https://github.com/sarvamai/skills/tree/main/chat an. TypingMind liest d'Datei SKILL.md an installéiert de Skill, deen Dir pro Chat aktivéiere kënnt.

Wéi eng KI-Modeller kënnen Chat benotzen?

All Modell, deen Dir an TypingMind verbënnt. KI-Skills sinn einfach Markdown-Instruktiounen an net ubidderspezifesche Code. Dofir kënne GPT, Claude, Gemini, Grok a lokal Modeller dëse Skill lueden, wann eng Ufro dozou passt.

Wéi vill KI-Modeller kann ech mat Chat benotzen?

Esou vill Dir wëllt. Soulaang e Modell Skills ënnerstëtzt, kënnt Dir Chat domat benotzen – GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama a méi – alles op TypingMind mat Ären eegenen API-Schlësselen.

Ass de KI-Skill Chat gratis?

Jo. De Skill gëtt vum sarvamai ënner der Lizenz Apache-2.0 op GitHub publizéiert. Dir bezuelt nëmmen Ären eegene KI-Ubidder fir d'Token, déi Dir benotzt.

Wat si KI-Skills?

E KI-Skill ass e weiderverwendbaart Pak vun Instruktiounen, dat engem KI-Modell bäibréngt, wéi en eng bestëmmt Aufgab erfëllt. E follegt dem oppenen Agent Skills-Format: eng Datei SKILL.md mat engem Numm an enger Beschreiwung, plus all Scripten, Virlagen oder Referenzdateien, déi de Modell eventuell brauch. De Modell liest d'Instruktiounen eréischt, wann Är Ufro zum Skill passt. En installéierte Skill kascht also näischt, bis e benotzt gëtt.

Wéi ënnerscheede sech KI-Skills vu Plugins oder MCP-Serveren?

E Plugin oder MCP-Server gëtt engem Modell nei Tools, déi en opruffe kann – Code, deen iergendwou leeft an e Resultat zeréckgëtt. E KI-Skill gëtt dem Modell dogéint Wëssen an eng Virgoensweis: wéi en eng Aufgab ugeet, wéi eng Schrëtt en nokënnt a wéi eng gutt Ausgab ausgesäit. Skills bestinn aus einfachem Markdown, brauche kee Server, keen API-Schlëssel a keng Lafzäitëmfeld a funktionéiere mat all Modell.

All weisen

Elo Ären eegene KI-Workspace ariichten

Abonnéiert Iech op eisen Newsletter, fir iwwer nei Funktiounen an zukünfteg Gewënnspiller informéiert ze ginn 👇