Skip to content
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -363,6 +363,7 @@ For MCP OAuth, an upstream may advertise dynamic client registration but refuse
| [Replicate (`replicate`)](https://docs.litellm.ai/docs/providers/replicate) | ✅ | ✅ | ✅ | | | | | | | |
| [Sagemaker Chat (`sagemaker_chat`)](https://docs.litellm.ai/docs/providers/aws_sagemaker) | ✅ | ✅ | ✅ | | | | | | | |
| [Sambanova (`sambanova`)](https://docs.litellm.ai/docs/providers/sambanova) | ✅ | ✅ | ✅ | | | | | | | |
| [Sarvam (`sarvam`)](https://docs.litellm.ai/docs/providers/sarvam) | ✅ | ✅ | ✅ | | | | | | | |
| [Snowflake (`snowflake`)](https://docs.litellm.ai/docs/providers/snowflake) | ✅ | ✅ | ✅ | | | | | | | |
| [Text Completion Codestral (`text-completion-codestral`)](https://docs.litellm.ai/docs/providers/codestral) | ✅ | ✅ | ✅ | | | | | | | |
| [Text Completion OpenAI (`text-completion-openai`)](https://docs.litellm.ai/docs/providers/text_completion_openai) | ✅ | ✅ | ✅ | | | ✅ | ✅ | ✅ | ✅ | |
Expand Down
484 changes: 484 additions & 0 deletions litellm/llms/sarvam/realtime/transformation.py

Large diffs are not rendered by default.

22 changes: 22 additions & 0 deletions litellm/model_prices_and_context_window_backup.json
Original file line number Diff line number Diff line change
Expand Up @@ -58886,6 +58886,28 @@
"mode": "embedding",
"source": "https://docs.libertai.io/apis/text/"
},
"sarvam/saaras:v3-realtime": {
"litellm_provider": "sarvam",
"metadata": {
"note": "Sarvam prices speech to text in INR per hour, billed per second; this registry is USD only, so sessions log their billed audio duration and no cost"
},
"mode": "audio_transcription",
"source": "https://docs.sarvam.ai/api/pricing",
"supported_endpoints": [
"/v1/realtime"
]
},
"sarvam/saaras:v4": {
"litellm_provider": "sarvam",
"metadata": {
"note": "Sarvam prices speech to text in INR per hour, billed per second; this registry is USD only, so sessions log their billed audio duration and no cost"
},
"mode": "audio_transcription",
"source": "https://docs.sarvam.ai/api/pricing",
"supported_endpoints": [
"/v1/realtime"
]
},
"sarvam/sarvam-m": {
"cache_creation_input_token_cost": 0,
"cache_creation_input_token_cost_above_1hr": 0,
Expand Down
6 changes: 6 additions & 0 deletions litellm/proxy/dev_config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,12 @@ model_list:
model: openai/gpt-4o-mini
api_key: os.environ/OPENAI_API_KEY

# ---------- Sarvam realtime speech to text ----------
- model_name: sarvam-stt
litellm_params:
model: sarvam/saaras:v3-realtime
api_key: os.environ/SARVAM_API_KEY

general_settings:
master_key: os.environ/LITELLM_MASTER_KEY
# Opt-in: let CheckBatchCost track cost for unmanaged batches created with a raw
Expand Down
22 changes: 22 additions & 0 deletions litellm/types/llms/sarvam.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
from typing import Literal, TypeAlias

from typing_extensions import NotRequired, ReadOnly, TypedDict

SarvamEndpointing: TypeAlias = Literal["vad", "manual"]
SarvamSampleRate: TypeAlias = Literal[8000, 16000]
SarvamControlEventType: TypeAlias = Literal["speech_start", "speech_end", "flush", "end"]


class SarvamAudioInput(TypedDict):
event: ReadOnly[Literal["audio_input"]]
audio: ReadOnly[str]


class SarvamControlEvent(TypedDict):
event: ReadOnly[SarvamControlEventType]


class SarvamConfigUpdate(TypedDict):
event: ReadOnly[Literal["config.update"]]
language_code: NotRequired[ReadOnly[str]]
endpointing: NotRequired[ReadOnly[SarvamEndpointing]]
1 change: 1 addition & 0 deletions litellm/types/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -4286,6 +4286,7 @@ class LlmProviders(str, Enum):
CURSOR = "cursor"
BEDROCK_MANTLE = "bedrock_mantle"
GDC = "gdc"
SARVAM = "sarvam"


# Create a set of all provider values for quick lookup
Expand Down
4 changes: 4 additions & 0 deletions litellm/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -9528,6 +9528,10 @@ def get_provider_realtime_config(
from litellm.llms.meta.realtime.transformation import MetaRealtimeConfig

return MetaRealtimeConfig()
if LlmProviders.SARVAM == provider:
from litellm.llms.sarvam.realtime.transformation import SarvamRealtimeConfig

return SarvamRealtimeConfig()
return None

@staticmethod
Expand Down
22 changes: 22 additions & 0 deletions model_prices_and_context_window.json
Original file line number Diff line number Diff line change
Expand Up @@ -58886,6 +58886,28 @@
"mode": "embedding",
"source": "https://docs.libertai.io/apis/text/"
},
"sarvam/saaras:v3-realtime": {
"litellm_provider": "sarvam",
"metadata": {
"note": "Sarvam prices speech to text in INR per hour, billed per second; this registry is USD only, so sessions log their billed audio duration and no cost"
},
"mode": "audio_transcription",
"source": "https://docs.sarvam.ai/api/pricing",
"supported_endpoints": [
"/v1/realtime"
]
},
"sarvam/saaras:v4": {
"litellm_provider": "sarvam",
"metadata": {
"note": "Sarvam prices speech to text in INR per hour, billed per second; this registry is USD only, so sessions log their billed audio duration and no cost"
},
"mode": "audio_transcription",
"source": "https://docs.sarvam.ai/api/pricing",
"supported_endpoints": [
"/v1/realtime"
]
},
"sarvam/sarvam-m": {
"cache_creation_input_token_cost": 0,
"cache_creation_input_token_cost_above_1hr": 0,
Expand Down
Empty file.
Empty file.
Loading
Loading