Sarvam Translate

Overview

Sarvam Translate enables high-quality translation between English and 22 Indian languages.

Features

Wide Language Support

Support for all 22 scheduled Indian languages and English with automatic language detection

Formal Style Translation

Default translation mode is formal to ensure clarity and consistency

Preprocessing Option

Optional smart preprocessing for better handling of complex input

Numeral Format Control

Option to choose between international and native numeral systems

Basic Usage

1from sarvamai import SarvamAI
2
3client = SarvamAI(api_subscription_key="YOUR_API_SUBSCRIPTION_KEY")
4
5response = client.text.translate(
6input="भारत एक महान देश है। इसकी संस्कृति बहुत पुरानी और समृद्ध है।",
7source_language_code="hi-IN",
8target_language_code="gu-IN",
9model="sarvam-translate:v1",
10
11)
12print(response)

The output_script option is not supported in Sarvam Translate. For script control, use the Mayura model.

Language Support

LanguageCodeDirection
Assameseas-INBoth
Bengalibn-INBoth
Bodobrx-INBoth
Dogridoi-INBoth
Englishen-INBoth
Gujaratigu-INBoth
Hindihi-INBoth
Kannadakn-INBoth
Kashmiriks-INBoth
Konkanikok-INBoth
Maithilimai-INBoth
Malayalamml-INBoth
Manipurimni-INBoth
Marathimr-INBoth
Nepaline-INBoth
Odiaod-INBoth
Punjabipa-INBoth
Sanskritsa-INBoth
Santalisat-INBoth
Sindhisd-INBoth
Tamilta-INBoth
Telugute-INBoth
Urduur-INBoth