provider::sarvam::abort
Cancel the in-flight upstream stream for a request_id (router::abort fan-out), stopping billed generation immediately.
- request_idstringrequired
- abortedbooleanrequired
Sarvam AI provider worker; implements provider::sarvam::stream for the Sarvam chat models plus provider::sarvam::transcribe (Saaras) and provider::sarvam::speak (Bulbul) behind llm-router.
iii trigger compose::add worker=provider-sarvamRun in your project with the iii engine running. Exact versions are immutable and digest-pinned.
Cancel the in-flight upstream stream for a request_id (router::abort fan-out), stopping billed generation immediately.
Estimate prompt tokens for {model, system_prompt?, tools?, messages} locally with tiktoken; never runs the model and costs nothing.
Wire agent messages, the same shape `provider::sarvam::stream` accepts. Must be non-empty.
Optional link to the stored original in the session-manager attachment store. Transcript bookkeeping for lazy readers only: the harness clears it before `router::chat`, and no provider mapping reads it. Tolerated here so a block that still carries it deserializes instead of failing the request; omitted on the wire when absent.
Optional link to the stored original in the session-manager attachment store. Transcript bookkeeping for lazy readers only: the harness clears it before `router::chat`, and no provider mapping reads it. Tolerated here so a block that still carries it deserializes instead of failing the request; omitted on the wire when absent.
Optional link to the stored original in the session-manager attachment store. Transcript bookkeeping for lazy readers only: the harness clears it before `router::chat`, and no provider mapping reads it. Tolerated here so a block that still carries it deserializes instead of failing the request; omitted on the wire when absent.
Optional link to the stored original in the session-manager attachment store. Transcript bookkeeping for lazy readers only: the harness clears it before `router::chat`, and no provider mapping reads it. Tolerated here so a block that still carries it deserializes instead of failing the request; omitted on the wire when absent.
Single-variant role tags: exact-match on deserialize, correct wire string on serialize, and they let `AgentMessage` be an untagged union.
Model id the prompt targets; reported back unchanged.
System prompt counted as its own wire message when present.
Function invocation schemas; each serialized schema counts toward the total.
Always `tiktoken`: a local tokenizer produced the estimate.
Estimated prompt tokens for the assembled request.
Internal: router::ready subscriber that re-declares this provider and refreshes its catalog.
Reconcile the curated Sarvam catalog slice, chat and speech models, through the router (Sarvam has no models-listing endpoint); returns the count written.
Text to speech on Sarvam Bulbul behind router::speak: text, a speaker name and a language in, base64 audio out (mp3, wav, pcm16, opus).
`mp3` (default), `wav`, `pcm16`, `opus`.
Language of the text (`hi`, `hi-IN`, ...); English when omitted.
Text-to-speech model id; `bulbul:v3` when omitted.
Speaking-rate multiplier, 0.5 to 2.0; 1.0 is the voice's own pace.
Text to speak, up to 2500 characters. Write Indic words in their own script for natural speech.
Speaker name (`shubh`, `shreya`, `manan`, `ishita`, ...; the v2 voices `anushka`, `abhilash`, ... only with `bulbul:v2`).
The speaker used.
Stream a Sarvam chat completion: resolve credentials, call the upstream Chat Completions API, and relay AssistantMessageEvent frames to writer_ref.
Optional link to the stored original in the session-manager attachment store. Transcript bookkeeping for lazy readers only: the harness clears it before `router::chat`, and no provider mapping reads it. Tolerated here so a block that still carries it deserializes instead of failing the request; omitted on the wire when absent.
Optional link to the stored original in the session-manager attachment store. Transcript bookkeeping for lazy readers only: the harness clears it before `router::chat`, and no provider mapping reads it. Tolerated here so a block that still carries it deserializes instead of failing the request; omitted on the wire when absent.
Optional link to the stored original in the session-manager attachment store. Transcript bookkeeping for lazy readers only: the harness clears it before `router::chat`, and no provider mapping reads it. Tolerated here so a block that still carries it deserializes instead of failing the request; omitted on the wire when absent.
Optional link to the stored original in the session-manager attachment store. Transcript bookkeeping for lazy readers only: the harness clears it before `router::chat`, and no provider mapping reads it. Tolerated here so a block that still carries it deserializes instead of failing the request; omitted on the wire when absent.
Single-variant role tags: exact-match on deserialize, correct wire string on serialize, and they let `AgentMessage` be an untagged union.
Set on speech models only; see [`SpeechModel`].
BCP-47 tags of the languages the model handles; empty when the provider does not say.
What a speech model does. Chat models carry no `speech` block.
Realtime input (stt) or streamed audio output (tts) is available.
Whether `thinking_level: off` can switch the model's reasoning off. `Some(true)`: a native off switch exists. `Some(false)`: the model always reasons, or the provider has no switch. `None`: the provider does not know; consoles show the choice disabled.
Stable conversation identity for provider cache affinity.
Ordered sections behind `system_prompt` (always forwarded alongside the flat string, which equals the sections joined with "\n\n").
Speech to text on Sarvam Saaras behind router::transcribe: base64 audio in, text with timed segments and the detected language out; 22 Indian languages and English.
The audio, base64. WAV, MP3, AAC, OGG, OPUS, FLAC, M4A, WebM.
Language hint (`hi`, `hi-IN`, ...); detected when omitted.
MIME type of the audio; `audio/wav` when omitted.
Speech-to-text model id; `saaras:v3` when omitted.
Accepted for the shared contract; Saaras takes no prompt.
Language Saaras detected or was told, as `hi-IN`.
Sentences, cut at punctuation or a pause, with word timings.
Find workers, kits and executables, or jump to a page.