Skip to content

(MOT-4670) feat(provider-sarvam): Sarvam AI chat, transcription and speech behind llm-router - #1079

Open
rohitg00 wants to merge 2 commits into
feat/provider-elevenlabsfrom
feat/provider-sarvam
Open

(MOT-4670) feat(provider-sarvam): Sarvam AI chat, transcription and speech behind llm-router#1079
rohitg00 wants to merge 2 commits into
feat/provider-elevenlabsfrom
feat/provider-sarvam

Conversation

@rohitg00

@rohitg00 rohitg00 commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

What

A provider-sarvam worker that puts every Sarvam AI model behind llm-router, so one credential serves chat, transcription and speech:

  • Chat: sarvam-105b, sarvam-30b, sarvam-m through router::chat (OpenAI-compatible SSE). Sarvam reasons by default and streams it as reasoning_content; it is surfaced as thinking blocks, and the router reasoning levels fold into Sarvam reasoning_effort (low / medium / high). Tools and response_format json_object are passed through.
  • Speech to text: saaras:v3 (default), saaras:v4, saarika:v2.5 through router::transcribe. Word timestamps are folded into sentence segments; a language hint maps onto Sarvam xx-IN codes.
  • Text to speech: bulbul:v3 (default speaker shubh) and bulbul:v2 (anushka) through router::speak, with mp3 / wav / pcm16 / opus output formats.

Sarvam exposes no models endpoint, so the catalog is a hand-maintained table in curated.rs; refresh_models reconciles it whenever a credential exists. Token counts are a tiktoken estimate (no public tokenizer). The speech endpoints derive from the origin of the chat api_url, so one override moves all three surfaces. Credential: SARVAM_API_KEY, sent as api-subscription-key.

Also registers the worker in .deploy/workers.yaml and the dependency range override the speech surfaces need (llm-router ^1.4.16).

Stacked

Base is feat/provider-elevenlabs (#1075), itself on feat/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::list shows sarvam configured; router::models::list returns the three chat models by default and the speech rows under modality=stt / modality=tts.
  • router::complete with sarvam-105b streams thinking plus text with usage.
  • router::transcribe with sarvam::saaras:v3 returns the spoken sentence with en-IN and a timed segment; router::speak with provider=sarvam returns a real MPEG stream in Hindi.
  • Console: the composer picker lists a Sarvam group, a chat on sarvam-105b answers, and the context chip counts usage. The voice worker on sarvam::saaras:v3 / sarvam::bulbul:v3 transcribes files and reads aloud through the router.
  • Gates: 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

@vercel

vercel Bot commented Sep 3, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
workers Ready Ready Preview Sep 3, 2026 2:46pm UTC
workers-tech-spec Ready Ready Preview Sep 3, 2026 2:46pm UTC

Request Review

@coderabbitai

coderabbitai Bot commented Sep 3, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Team

Run ID: 76026994-e7b4-47fb-8b16-8818f2bacb28

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions

github-actions Bot commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

skill-check — worker

0 verified, 72 skipped (no docs/).

Layer Result
structure
vale
ai
render

Four for four. Nicely done.

…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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant