Indic Chat Translator (small): Hinglish and romanized Indic → English
A 483M-parameter model that translates chat-style Indian text into English:
- Hinglish and other code-mixed messages ("yaar kal ki meeting cancel ho gayi, ab kya karein?")
- romanized text in 10 languages (Hindi, Bengali, Tamil, Telugu, Marathi, Gujarati, Kannada, Malayalam, Punjabi, Urdu)
- the same languages in native script, including Devanagari mixed with English words
Most open translation models expect clean, native-script text, and they often just copy romanized or code-mixed input back out (see Results). This model is a fine-tuned facebook/m2m100_418M, small enough to run on a CPU or in the browser (ONNX, transformers.js).
On the PHINC test set (human translations of Hinglish social-media posts) it scores 57.0 chrF++, against 42.5 for NLLB-200-distilled-600M and 36.5 for opus-mt-mul-en. Simply copying the input scores 43.8. On held-out chat messages in all 10 languages, an LLM judge rates its romanized-input translations 3.48 out of 5, against 1.14 for NLLB-200-distilled-600M.
This is the commercial-clean revision (Dec 2026): every part of its training data and teacher allows commercial use (see Commercial use).
Try it in your browser: altslate/indic-chat-mt Space (runs locally, int8, optional auto-detect of the language with altslate/indic-chat-lid-small).
Usage
Set src_lang to the source language. Use hi for Hinglish. Telugu: use kn, and map Telugu letters to Kannada script
first (see below).
from transformers import AutoModelForSeq2SeqLM, AutoTokenizer
tok = AutoTokenizer.from_pretrained("altslate/indic-chat-mt-small")
model = AutoModelForSeq2SeqLM.from_pretrained("altslate/indic-chat-mt-small")
def translate(texts, lang="hi"):
# M2M100's vocabulary has no Telugu letters: write Telugu in Kannada script (same layout, Unicode offset 0x80)
texts = ["".join(chr(ord(c) + 0x80) if 0xC00 <= ord(c) <= 0xC7F else c for c in t) for t in texts]
tok.src_lang = "kn" if lang == "te" else lang
enc = tok(texts, return_tensors="pt", padding=True)
out = model.generate(**enc, forced_bos_token_id=tok.get_lang_id("en"), num_beams=4, max_new_tokens=256)
return tok.batch_decode(out, skip_special_tokens=True)
print(translate(["yaar kal ki meeting cancel ho gayi, ab kya karein?", "bhai tu kab aa raha hai ghar pe?"]))
print(translate(["naan naalaikku office ku varala, udambu sari illa"], "ta"))
Language codes: hi bn ta mr gu kn ml pa ur, and te → kn with the script map. Romanized and native-script input both
use the language's code.
ONNX and transformers.js
onnx/ has the encoder and merged decoder in fp32 (2.9 GB), fp16 (1.4 GB) and int8 (*_quantized.onnx, 0.7 GB).
tokenizer.json is for transformers.js only. Python uses the sentencepiece tokenizer files, and the tokenizer.json is
ignored there. It is the Xenova/m2m100_418M tokenizer, which gave the same
token ids as the Python tokenizer on 586 test sentences.
import { pipeline } from "@huggingface/transformers";
const translate = await pipeline("translation", "altslate/indic-chat-mt-small", { dtype: "q8" });
const te2kn = (s) => [...s].map((c) => { const u = c.codePointAt(0); return u >= 0xC00 && u <= 0xC7F ? String.fromCodePoint(u + 0x80) : c; }).join("");
const [out] = await translate(te2kn("yaar kal ki meeting cancel ho gayi"), { src_lang: "hi", tgt_lang: "en", max_new_tokens: 128 });
console.log(out.translation_text);
We checked all three variants in transformers.js 4.3.2 (Node, CPU) against PyTorch greedy decoding on 250 sentences: 150 PHINC dev, 50 native-script Telugu and 50 romanized Tamil.
| same output as PyTorch (spacing around punctuation ignored) | chrF++ | ms per sentence (Apple M-series CPU) | |
|---|---|---|---|
| PyTorch, greedy | — | 52.1 | |
| fp32 | 250 / 250 | 52.1 | 520 |
| fp16 | 246 / 250 | 52.1 | 1,880 (fp16 is slow on CPU; use it with WebGPU) |
int8 (q8) | 146 / 250 | 52.2 | 200 |
int8 changes about 40% of the outputs slightly but loses no quality on this sample. transformers.js decodes greedily, so expect somewhat lower quality than the Python example, which uses beam search (beam 4). transformers.js also writes "a, b" where Python writes "a , b".
Results
Metrics: chrF++ and BLEU (sacrebleu 2.6, lower-cased), and an LLM judge. No test set was used for choosing between versions. This revision was trained on the COMI-LINGUA MT train split, so the COMI test set is in-domain for it and not for the other models; read the COMI columns with that in mind.
Test sets
- PHINC test: 3,000 Hinglish social-media sentences with human English translations, from PHINC (CC-BY-4.0). The references are noisy: some are untranslated, half-translated or wrong.
- COMI-LINGUA MT test: the 5,000 sentences in the MT test split of COMI-LINGUA (CC-BY-4.0), news-style Hindi–English. Each is given twice: roman (fully romanized) and mixed (Devanagari with English words in Latin script). The English references were drafted by Llama-3.3 and corrected by three annotators, and we score against the first annotator's.
| chrF++ / BLEU | PHINC test | COMI roman | COMI mixed |
|---|---|---|---|
| copy the input (no translation) | 43.8 / 28.8 | 38.6 | 19.1 |
| Helsinki-NLP/opus-mt-mul-en (77M) | 36.5 / 16.3 | 37.7 | 47.6 |
| facebook/nllb-200-distilled-600M (600M, CC-BY-NC) | 42.5 / 26.9 | 38.8 | 66.2 |
| this model (483M, beam 4) | 57.0 / 36.1 | 76.7 | 66.8 |
| previous revision of this model | 57.8 / 37.0 | 68.7 | 62.9 |
LLM judge: Qwen3.8-27B saw only the source and a candidate translation, with no reference, and rated meaning preservation from 1 to 5. Scores are means over 300 random rows of each test set. The human references are scored as a system too, to show where the ceiling is.
| judge mean (share rated ≥ 4) | PHINC test | COMI test (roman and mixed) |
|---|---|---|
| human references | 3.95 (71%) | 4.64 (91%) |
| opus-mt-mul-en | 1.45 (8%) | 1.52 (7%) |
| nllb-200-distilled-600M | 1.54 (11%) | 2.66 (39%) |
| this model | 3.37 (48%) | 4.18 (74%) |
| previous revision (same run) | 3.48 (51%) | 3.81 (62%) |
The other small models mostly copy romanized input unchanged, so they score low here.
Chat test, 10 languages: PHINC and COMI are Hindi only, so we also tested on 577 casual chat messages (55–60 per language), each given romanized and in native script (1,154 inputs). Qwen3.8-27B wrote each message in native script and romanized it, and GlotLID confirmed the language. There are no English references, so these are judge scores only (same judge and scale as above, every input scored). None of these messages, and no message from the same generator, was used for training. Our chat training messages were written by a different model, Ornith.
| judge mean | bn | gu | hi | kn | ml | mr | pa | ta | te | ur | mean |
|---|---|---|---|---|---|---|---|---|---|---|---|
| this model, romanized | 3.41 | 3.64 | 4.69 | 2.82 | 3.23 | 3.21 | 3.55 | 2.88 | 3.05 | 4.36 | 3.48 |
| nllb-200-distilled-600M, romanized | 1.14 | 1.09 | 1.00 | 1.09 | 1.43 | 1.11 | 1.02 | 1.17 | 1.25 | 1.03 | 1.14 |
| this model, native script | 4.29 | 3.66 | 4.69 | 3.56 | 3.75 | 3.82 | 3.60 | 3.66 | 3.63 | 4.25 | 3.89 |
| previous revision, romanized | 3.29 | 3.40 | 4.45 | 2.82 | 3.02 | 3.18 | 3.20 | 3.00 | 3.12 | 4.12 | 3.36 |
| previous revision, native script | 4.29 | 3.47 | 4.27 | 3.29 | 3.60 | 3.54 | 3.43 | 3.00 | 3.36 | 3.88 | 3.61 |
| nllb-200-distilled-600M, native script | 4.45 | 3.67 | 4.51 | 3.76 | 4.03 | 3.96 | 4.25 | 3.32 | 3.85 | 4.56 | 4.03 |
Other languages (development set, used to choose this version, so treat it as optimistic): 100 FLORES sentences per language (IndicGenBench copy of FLORES-200 dev, CC BY-SA 4.0), given in native script and romanized by our own romanizer. The model was trained on text from the same romanizer, so the romanized numbers favour it. Real users romanize less consistently.
| chrF++ | bn | gu | hi | kn | ml | mr | pa | ta | te | ur | mean |
|---|---|---|---|---|---|---|---|---|---|---|---|
| this model, native script | 54.0 | 55.1 | 57.5 | 48.2 | 51.8 | 51.9 | 54.1 | 46.2 | 54.9 | 54.7 | 52.9 |
| this model, romanized | 45.4 | 52.8 | 52.6 | 47.5 | 47.5 | 48.3 | 52.5 | 40.7 | 51.4 | 48.9 | 48.8 |
| nllb-200-distilled-600M, native | 61.3 | ||||||||||
| nllb-200-distilled-600M, romanized | 15.4 |
Where other models are better
- Native-script text: NLLB-200-distilled-600M is clearly better on clean text (FLORES native 61.3 vs 52.9 chrF++) and on native-script chat in most languages (judge 4.03 vs 3.89; this model is ahead only on Hindi and Tamil). If your input is in native script, prefer NLLB where its license allows. NLLB's license is non-commercial (CC-BY-NC-4.0). For native-script Indic → English, also consider AI4Bharat's IndicTrans2 (gated, so we did not evaluate it).
- Our previous revision was better on Hinglish social-media text (PHINC test 57.8 vs 57.0 chrF++, judge 3.48 vs 3.37). It was trained with a dataset whose sources are not fully documented (see Commercial use). This revision is better on chat in the 10 languages (judge 3.68 vs 3.48 over all chat inputs) and on FLORES dev (50.9 vs 49.9).
- Large LLMs are better. Qwen3.8-27B scored 56.3 chrF++ on our PHINC development set (this model 56.6), but large models translate noticeably more of the meaning: the training teacher, Ornith-1.5-35B-A3B, was rated 4.35 by the judge on the development set, against this model's 3.35.
Known limitations
- Slang and idioms are often translated literally or wrongly (for example, body-shaming slang such as moti/patli, or jokes that depend on a pun). Expect about half of messages to be fully right (judge ≥ 4 on 48% of PHINC test rows).
- Telugu needs the script map shown above. Without it, native-script Telugu input is mostly unknown tokens and the output is invented English. Romanized Telugu works without it.
- Kannada and Tamil are the weakest languages (chat judge 2.82 and 2.88 on romanized input; FLORES romanized Tamil 40.7 chrF++). Outside Hindi and Urdu, roughly one message in two loses some meaning. Negation in Dravidian verbs (Tamil varala, Telugu raanu) is sometimes lost.
- Ambiguous time words: Hindi kal means both "yesterday" and "tomorrow", and the model sometimes picks the wrong one ("kal ki meeting cancel ho gayi" → "yesterday's meeting").
- Usernames, hashtags and URLs are usually kept, but sometimes translated or dropped.
- Trained on inputs up to 128 tokens. Split long text into sentences.
- One source language per input. A message mixing two Indic languages is not supported.
Training
Training and evaluation code: github.com/AltSlate-Labs/indic-chat-toolkit.
- Base: facebook/m2m100_418M (MIT).
- Run: 20k steps (batch 64, AdamW, lr 5e-5, bf16) on 1.0M pairs, with a per-row source-language token. Then 4k more steps (lr 3e-5) after adding the Telugu → Kannada script map, with the native-Telugu rows weighted ×5. Then 5k more steps (lr 3e-5) with the chat pairs below added (×4). About 5 hours on one NVIDIA GB10 (DGX Spark).
- Data:
- The PHINC train split (our split: 9,443 sentences; seed 13), CC BY 4.0.
- COMI-LINGUA MT train split (CC BY 4.0): the annotators' romanized-Hindi translations → the English translation, about 34k pairs (×2).
- About 39k Hinglish chat lines with their English meaning, written by Ornith-1.5-35B-A3B (MIT) (×3).
- allenai/nllb (ODC-BY 1.0) mined Indic–English pairs. Each was used both in native script and romanized by our romanizer, a word list from the Aksharantar and Dakshina train splits with a rule-based fallback for words not in the list.
- English translations of the PHINC train sources, written by Ornith as a teacher (about 8k after filtering out refusals, non-English output and length outliers).
- Chat: 21,337 casual chat messages in the 10 languages, written in native script and romanized by Ornith for our earlier language-ID and transliteration models, translated into English by Ornith. Each gives two pairs (romanized → English, native → English). Many of the non-Hindi messages are not fully fluent, so this data is noisy. 40 messages per language were held out to choose this version.
- No FLORES text and no COMI-LINGUA test text was used for training (22 of the 10,000 COMI test rows also occur in the training data; removing them changes no conclusion). Qwen3.8-27B was used only as the judge, not to make training data.
- PHINC dev/test and our chat test messages were removed from every training source.
Commercial use
Every part of the training chain allows commercial use: the base model (MIT), the teacher that wrote training targets and chat pairs (Ornith, MIT), and datasets under CC BY 4.0 (PHINC, COMI-LINGUA) and ODC-BY 1.0 (allenai/nllb). No training text was generated by a closed or API model. Qwen3.8-27B was used only to write and judge test data.
Revision note (Dec 2026): earlier revisions also trained on findnitai/english-to-hinglish (and on Ornith translations of its Hinglish side), whose sources are not fully documented and partly machine-generated. This revision drops it and adds COMI-LINGUA MT train and Ornith-written Hinglish chat in its place; the recipe (three stages, steps and learning rates) is unchanged. It is slightly worse on Hinglish social-media text and better on chat and the other languages (see Where other models are better).
License
MIT, the same as the base model. The training data was used under its own licenses (CC BY 4.0, ODC-BY 1.0, MIT).
Citation
PHINC: Srivastava and Singh, PHINC: A Parallel Hinglish Social Media Code-Mixed Corpus for Machine Translation, W-NUT 2020. M2M100: Fan et al., Beyond English-Centric Multilingual Machine Translation, JMLR 2021.