pi-sarvam0.1.0
Sarvam AI provider for Pi: Indian-language chat models over the OpenAI-compatible Sarvam API, with a live models.dev catalog.
Untested on omp
This is a pi package. No one has reported whether it works on omp yet. If you try it, add your result below.
Reports 0
No reports yet.
Readme
pi-sarvam
Sarvam AI models in Pi. Indian language chat models on top of the OpenAI compatible API at https://api.sarvam.ai/v2.
The extension registers the endpoint, the key, and the catalog. Requests flow through Pi's built in openai-completions implementation, so tools, images, thinking, streaming, usage, and cost accounting behave like a bundled provider.
Install
pi install npm:pi-sarvam
From git or a local checkout:
pi install git:github.com/madanlalit/pi-sarvam
pi install ./pi-sarvam
export SARVAM_API_KEY=sk_...
pi --model sarvam/glm5.3
pi list shows installed packages. pi remove pi-sarvam uninstalls.
Authenticate
Export SARVAM_API_KEY, or run /login and choose Sarvam AI to store the key in ~/.pi/agent/auth.json. Models appear once either source exists.
Models
sarvam-105b: 128K context, 128K output, thinking low/medium/highsarvam-105b-conversations: 32K context, 32K output, no thinkingglm5.3: 1M context, 131K output, thinking low/high/maxglm5.3-flash: 1M context, 131K output, thinking low/high/max, imagesgemma4: 262K context, 32K output, thinking none/low/high/max, imagesdeepseekv4.1-flash-1017: 1M context, 384K output, thinking none/low/high/max, imagesdeepseekv4.1-flash-1017-interactive: 1M context, 384K output, thinking none/low/high/max, images
Prefix each id with sarvam/. A bundled snapshot covers offline use and the first run.
Live catalog
refreshModels overlays the live sarvam entry from models.dev, so new models, limits, prices, and thinking options arrive without a release.
- Cached in Pi's model store and restored before any network access, so the provider works offline
- Rechecked at most once every 24 hours, with ETag revalidation
pi update --modelsskips extension providers, so open/modelor restart Pi to force a check- A failed or missing catalog keeps the cached or bundled list
Environment
SARVAM_API_KEY: key used when no stored credential existsSARVAM_BASE_URL: endpoint override, defaulthttps://api.sarvam.ai/v2SARVAM_CATALOG_URL: catalog override, defaulthttps://models.dev/api.jsonSARVAM_DISABLE_REASONING_EFFORT=1: stop sendingreasoning_effort
Compatibility
Sarvam takes max_tokens rather than max_completion_tokens, and has no developer role or strict tool schemas.
compat: {
supportsStore: false,
supportsDeveloperRole: false,
supportsStrictMode: false,
supportsReasoningEffort: true,
maxTokensField: "max_tokens",
}
Thinking arrives as reasoning_content, which Pi reads as a thinking block.
Development
npm test # 10 tests, no network, no dependencies
pi -e . --list-models sarvam
Tests cover catalog mapping, offline restore, cache freshness, ETag revalidation, empty catalogs, failures, and aborts.