sarvamai
What it is and what it does
Sarvamai is a Python SDK that wraps the Sarvam API, a cloud service for text translation and speech processing focused on Indian languages. It provides both synchronous and asynchronous clients, allowing developers to translate text between supported Indian language pairs (including Bengali, Hindi, Tamil, Telugu, Kannada, Malayalam, Marathi, Gujarati, Punjabi, Odia, and newer additions like Assamese, Bodo, Dogri, Konkani, Kashmiri, Maithili, Manipuri, Nepali, Sanskrit, Santali, Sindhi, and Urdu) with optional tone/style modes and transliteration output.
The SDK handles HTTP communication via httpx, includes automatic retry logic with exponential backoff for transient failures (408, 429, 5xx status codes), configurable timeouts (default 60 seconds), and exception handling for API errors. It is typed with pydantic validation and supports custom httpx clients for proxy or transport customization. The library is generated programmatically and requires an active API subscription key for all requests.
Use it for:
- Translate user-generated text between Indian languages in a web or mobile application backend
- Build a multilingual chatbot or customer support system that handles conversations in regional Indian languages
- Process and transliterate text to different scripts (e.g., Hindi to Roman script) for accessibility or display purposes
- Integrate speech-to-text transcription into a Python application using the Sarvam API
- Batch translate content with automatic language detection and optional preprocessing for complex vocabulary
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Python SDK for the Sarvam API, providing access to text translation and speech-to-text services across Indian languages with both synchronous and asynchronous clients.
Yes, with conditions. The package is actively maintained, has low install friction, and provides a clean async-capable interface to a specialized translation service. However, install only if you have a Sarvam API subscription and can verify the license terms independently—the package metadata does not declare a license, creating uncertainty about redistribution and commercial use. No known vulnerabilities as of the query date.
Install
sarvamai on PyPI
pip
pip install sarvamaiuv
uv add sarvamaipoetry
poetry add sarvamaiInstalling sarvamai
Before you install
Low install friction with a pure-Python wheel distribution. Actively maintained with a recent release 11 days ago. Depends on standard libraries (httpx, pydantic, websockets) with no compiled dependencies.
License in practice
License treatment is unclear—no SPDX identifier or raw license text is available in the package metadata. Verify the actual license terms before using in proprietary or restricted contexts.
Quickstart
pip install sarvamai
from sarvamai import SarvamAI
client = SarvamAI(api_subscription_key="YOUR_API_SUBSCRIPTION_KEY")
client.text.translate(
input="input",
source_language_code="auto",
target_language_code="bn-IN"
)
Requires a valid Sarvam API subscription key to authenticate requests.
Verify before relying
- Actual license terms and restrictions—metadata shows no SPDX or raw license field
- Rate limits and quota behavior for the translation API beyond the default retry configuration
- Whether speech-to-text functionality is fully implemented or still in development
Package facts
| License | not declared (unclear) |
| Python support | supports the current Python release (<4.0,>=3.8) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 5 — httpx, pydantic, pydantic-core, typing_extensions, websockets |
| Maintenance | actively maintained — 11 days since the last release |
| First released | |
| Downloads | 177,501/month — #10,212 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: sarvamai-0.1.30-py3-none-any.whl
Tags
More Python Modules packages
Converts domain names between Unicode and…
permissive · top 100 on PyPI
setuptoolsSetuptools is a Python build backend and…
permissive · top 100 on PyPI
PyYAMLPyYAML parses and emits YAML 1.1 data format,…
permissive · top 100 on PyPI
pydanticPydantic validates Python data structures…
permissive · top 100 on PyPI
annotated-typesProvides reusable metadata objects for use with…
permissive · top 100 on PyPI
typing-inspectionProvides runtime tools to inspect and…
permissive · top 100 on PyPI
python-intercomA Python client library for the Intercom API,…
unclear · top 15,000 on PyPI
azure-ai-translation-textProvides a Python client for Azure's neural…
unclear · top 15,000 on PyPI
livekit-plugins-sarvamIntegrates Sarvam.ai's Indian-language voice AI…
permissive · top 15,000 on PyPI
vapi-server-sdkA Python SDK for the Vapi API, providing…
unclear · top 15,000 on PyPI
reka-apiProvides a Python client library for accessing…
permissive · top 15,000 on PyPI
deep-translatorTranslates text between languages using…
permissive · top 5,000 on PyPI
google-cloud-translatePython client library for Google Cloud…
permissive · top 1,000 on PyPI
translatorsTranslators provides a unified Python interface…
copyleft · top 15,000 on PyPI
indic-nlp-libraryIndic NLP Library provides text processing and…
permissive · top 15,000 on PyPI
agentmailAgentmail provides a Python client library for…
unclear · top 5,000 on PyPI