omp packages

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.

lalitmadan Published 6 days ago MIT ~0 downloads/mo

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.

Did it work for you?

Result

One report per person. A new report replaces your old one.

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/high
  • sarvam-105b-conversations: 32K context, 32K output, no thinking
  • glm5.3: 1M context, 131K output, thinking low/high/max
  • glm5.3-flash: 1M context, 131K output, thinking low/high/max, images
  • gemma4: 262K context, 32K output, thinking none/low/high/max, images
  • deepseekv4.1-flash-1017: 1M context, 384K output, thinking none/low/high/max, images
  • deepseekv4.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 --models skips extension providers, so open /model or 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 exists
  • SARVAM_BASE_URL: endpoint override, default https://api.sarvam.ai/v2
  • SARVAM_CATALOG_URL: catalog override, default https://models.dev/api.json
  • SARVAM_DISABLE_REASONING_EFFORT=1: stop sending reasoning_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.