(MOT-4670) feat(provider-sarvam): Sarvam AI chat, transcription and speech behind llm-router - #1079
(MOT-4670) feat(provider-sarvam): Sarvam AI chat, transcription and speech behind llm-router#1079rohitg00 wants to merge 2 commits into
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Team Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
skill-check — worker0 verified, 72 skipped (no docs/).
Four for four. Nicely done. |
7854373 to
71b0b66
Compare
183f39e to
2772244
Compare
…ription and speech One provider worker that puts every Sarvam model behind llm-router: sarvam-105b, sarvam-30b and sarvam-m for router::chat (OpenAI-compatible SSE with reasoning_content surfaced as thinking, tools, response_format), saaras/saarika for router::transcribe and bulbul for router::speak. The chat lineup and the speech models are a hand-maintained catalog because Sarvam exposes no models endpoint. Credential is SARVAM_API_KEY resolved through the router, sent as api-subscription-key. Token counts are a tiktoken estimate. Speech calls use the origin of the chat api_url so a single override moves all three surfaces. Refs MOT-4664
…ng it The size limit applied only after the base64 decode had already allocated the full buffer; the encoded length is checked first now.
71b0b66 to
35335bd
Compare
2772244 to
b903492
Compare
What
A
provider-sarvamworker that puts every Sarvam AI model behind llm-router, so one credential serves chat, transcription and speech:sarvam-105b,sarvam-30b,sarvam-mthroughrouter::chat(OpenAI-compatible SSE). Sarvam reasons by default and streams it asreasoning_content; it is surfaced as thinking blocks, and the router reasoning levels fold into Sarvamreasoning_effort(low/medium/high). Tools andresponse_formatjson_object are passed through.saaras:v3(default),saaras:v4,saarika:v2.5throughrouter::transcribe. Word timestamps are folded into sentence segments; a language hint maps onto Sarvamxx-INcodes.bulbul:v3(default speakershubh) andbulbul:v2(anushka) throughrouter::speak, withmp3/wav/pcm16/opusoutput formats.Sarvam exposes no models endpoint, so the catalog is a hand-maintained table in
curated.rs;refresh_modelsreconciles it whenever a credential exists. Token counts are a tiktoken estimate (no public tokenizer). The speech endpoints derive from the origin of the chatapi_url, so one override moves all three surfaces. Credential:SARVAM_API_KEY, sent asapi-subscription-key.Also registers the worker in
.deploy/workers.yamland the dependency range override the speech surfaces need (llm-router ^1.4.16).Stacked
Base is
feat/provider-elevenlabs(#1075), itself onfeat/router-speech-surfaces(#1074). Merge bottom-up to main. The worker-compose count tests will conflict trivially with #1075 on the way in.Verified on a local rig (engine 0.23.0, llm-router from #1074)
router::provider::listshowssarvamconfigured;router::models::listreturns the three chat models by default and the speech rows undermodality=stt/modality=tts.router::completewithsarvam-105bstreams thinking plus text with usage.router::transcribewithsarvam::saaras:v3returns the spoken sentence withen-INand a timed segment;router::speakwithprovider=sarvamreturns a real MPEG stream in Hindi.sarvam-105banswers, and the context chip counts usage. The voice worker onsarvam::saaras:v3/sarvam::bulbul:v3transcribes files and reads aloud through the router.cargo fmt,cargo clippy --all-targets --all-features -D warnings, unit and wire-schema tests (goldens regenerated), release build,.github/scripts/tests(17 passed).Refs MOT-4664