indictrans2-en-indic-1B

Translation • ai4bharat

@cf/ai4bharat/indictrans2-en-indic-1B

  • Cloudflare-hosted

IndicTrans2 is the first open-source transformer-based multilingual NMT model that supports high-quality translations across all the 22 scheduled Indic languages

Model Info
Unit Pricing $0.342 per M input tokens, $0.342 per M output tokens

Usage

export interface Env {
  AI: Ai;
}

export default {
  async fetch(request, env): Promise<Response> {

    const response = await env.AI.run(
      "@cf/ai4bharat/indictrans2-en-indic-1B",
      {
        text: "Hello, how are you?",
        target_language: "hin_Deva",
      }
    );

    return new Response(JSON.stringify(response));
  },
} satisfies ExportedHandler<Env>;
import requests

API_BASE_URL = "https://api.cloudflare.com/client/v4/accounts/{ACCOUNT_ID}/ai/run/"
headers = {"Authorization": "Bearer {API_TOKEN}"}

def run(model, input):
    response = requests.post(f"{API_BASE_URL}{model}", headers=headers, json=input)
    return response.json()

output = run('@cf/ai4bharat/indictrans2-en-indic-1B', {
  "text": "Hello, how are you?",
  "target_language": "hin_Deva"
})

print(output)
curl https://api.cloudflare.com/client/v4/accounts/$CLOUDFLARE_ACCOUNT_ID/ai/run/@cf/ai4bharat/indictrans2-en-indic-1B  \
    -X POST  \
    -H "Authorization: Bearer $CLOUDFLARE_API_TOKEN"  \
    -d '{ "text": "Hello, how are you?", "target_language": "hin_Deva" }'

Parameters

▶text

one ofrequired

target_language

stringrequireddefault: hin_Devaenum: asm_Beng, awa_Deva, ben_Beng, bho_Deva, brx_Deva, doi_Deva, eng_Latn, gom_Deva, gon_Deva, guj_Gujr, hin_Deva, hne_Deva, kan_Knda, kas_Arab, kas_Deva, kha_Latn, lus_Latn, mag_Deva, mai_Deva, mal_Mlym, mar_Deva, mni_Beng, mni_Mtei, npi_Deva, ory_Orya, pan_Guru, san_Deva, sat_Olck, snd_Arab, snd_Deva, tam_Taml, tel_Telu, urd_Arab, unr_DevaTarget langauge to translate to

▶translations[]

arrayTranslated texts

API Schemas (Raw)

Input Open Download

Output Open Download

Was this helpful?

YesNo

On this page

indictrans2-en-indic-1B - 图1Docs

{"@context":"https://schema.org","@type":"TechArticle","@id":"https://developers.cloudflare.com/workers-ai/models/indictrans2-en-indic-1B/#page","headline":"indictrans2-en-indic-1B","description":"IndicTrans2 is the first open-source transformer-based multilingual NMT model that supports high-quality translations across all the 22 scheduled Indic languages","url":"https://developers.cloudflare.com/workers-ai/models/indictrans2-en-indic-1B/","inLanguage":"en","image":"https://developers.cloudflare.com/og-docs.png","publisher":{"@type":"Organization","name":"Cloudflare","description":"One platform for your apps, agents, and workforce. Build, secure, and scale without managing infrastructure","url":"https://www.cloudflare.com/","sameAs":["https://github.com/cloudflare","https://www.linkedin.com/company/cloudflare","https://x.com/cloudflare"],"logo":{"@type":"ImageObject","url":"https://developers.cloudflare.com/logo.svg"},"address":{"@type":"PostalAddress","streetAddress":"101 Townsend St","addressLocality":"San Francisco","addressRegion":"CA","postalCode":"94107","addressCountry":"US"},"contactPoint":[{"@type":"ContactPoint","contactType":"Customer Support","url":"https://support.cloudflare.com/","availableLanguage":["English"]},{"@type":"ContactPoint","contactType":"Sales","url":"https://www.cloudflare.com/contact/","availableLanguage":["English"]}]},"isPartOf":{"@type":"WebSite","@id":"https://developers.cloudflare.com/#website","name":"Cloudflare Docs","url":"https://developers.cloudflare.com/"}}


description: SEA-LION stands for Southeast Asian Languages In One Network, which is a collection of Large Language Models (LLMs) which have been pretrained and instruct-tuned for the Southeast Asia (SEA) region. title: gemma-sea-lion-v4-27b-it image: https://developers.cloudflare.com/og-docs.png


Skip to content

Documentation Index
Fetch the complete documentation index at: https://developers.cloudflare.com/llms.txt
Use this file to discover all available pages before exploring further.

a