feat: add Sarvam AI provider support - #129
Conversation
- Add Sarvam to provider-presets.ts with OpenAI-compatible API - Register Sarvam provider kind in register-built-in-providers.ts - Add 'sarvam' to PROVIDER_KINDS in llm-config.ts - Preserve xAI (Grok) and all existing providers - Support sarvam-105b and sarvam-105b-conversations models - Full configuration validation and error handling
ef90f00 to
9656bf3
Compare
|
Hi @yablokolabs, thank you for putting this together — and for the detailed writeup. We're going to pass on this one, but the reasoning is about our architecture rather than the quality of your work, so let me explain properly. The provider presets in Two smaller notes for context:
The good news: Sarvam already works today without any code changes. In the TUI provider wizard, pick the manual OpenAI-compatible entry, set the base URL to Sarvam's API root and paste your key — the model list comes from the server's own If you'd like Sarvam to appear as a named row in the wizard, we'd welcome a much smaller PR: a single entry in Thanks again for the contribution and for the interest in the project. |
|
hi sosidudku1 Thanks, that makes sense. I understand the distinction now: this should be a preset-only addition rather than a new provider kind. I'll follow up with a much smaller PR that just adds the Sarvam preset entry and confirms the base URL responds to /v1/models. |
|
Opened the smaller follow-up PR here: #205 It contains just the preset entry and the /v1/models confirmation, per your guidance. |
Summary
Adds first-class Sarvam AI provider support, routed through the existing OpenAI-compatible
OpenAiProvider— the same pattern as every other compat provider.Changes
src/config/llm-config.tssarvamtoPROVIDER_KINDSsokind: "sarvam"entries validatesrc/llm/provider/registry/register-built-in-providers.tssarvamprovider kind (OpenAI-compatible transport, vision defaulted off, parallel tools on)src/tui/providers/provider-presets.tshttps://api.sarvam.ai,SARVAM_API_KEY) to the TUI provider wizardFeatures
SARVAM_API_KEY, donellm.providers[].kind = "sarvam"or the openai-compatible flowsarvam-105bandsarvam-105b-conversations(model list comes from the live/v1/modelsendpoint, per existing preset convention)SARVAM_API_KEYenv-var authentication with the preset's own env var (no cross-service key collisions)Verification
npm run lint(tsc noEmit): passesnpm test: 3982+ passed; the only failures are pre-existing onmain(splash-banner, llm-health-poller, send-message-concurrency, persist-embedding-hybrid-recall) and unrelated to this change — verified on a cleanmaincheckoutnpm run build: passesprovider-presets.test.ts("is sorted alphabetically by label") andproviders-wizard-key-bindings.test.ts: Sarvam sits between "Ollama Cloud" and "Together AI"Notes
supportsVisiondefaults tofalse(Sarvam models are text-only today).