skillfed

sarvamai

sarvamai v0.1.30 177.5K downloads/30d#10,212 on PyPI
License unclear Active released

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 sarvamai

uv

uv add sarvamai

poetry

poetry add sarvamai

Installing 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

Intended Audience :: DevelopersOperating System :: MacOSOperating System :: Microsoft :: WindowsOperating System :: OS IndependentOperating System :: POSIXOperating System :: POSIX :: LinuxProgramming Language :: PythonProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Programming Language :: Python :: 3.15Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9Topic :: Software Development :: Libraries :: Python ModulesTyping :: Typed

Tags

sarvam api python clientindian language translation sdktext translation python libraryspeech to text api wrapperasync language translation clientmultilingual text processingsarvam ai integration
language-translationindian-languagesapi-client

More Python Modules packages