--- license: apache-2.0 language: - hi - en pipeline_tag: translation tags: - transliteration - hindi - devanagari - romanized-hindi - on-device - browser - javascript - tiny - indic - input-method - keyboard - offline - aksharalp datasets: - ai4bharat/Aksharantar - ai4bharat/IndicCorpV2 metrics: - accuracy - cer model-index: - name: AksharaLP-1M-v2 results: - task: type: translation name: Romanized Hindi → Devanagari transliteration (word level) dataset: type: ai4bharat/Aksharantar name: Aksharantar (Hindi test) split: test metrics: - type: accuracy name: Top-1 accuracy value: 70.04 - type: accuracy name: Top-3 accuracy value: 88.31 - type: accuracy name: Top-8 accuracy value: 93.63 - task: type: translation name: Romanized Hindi → Devanagari transliteration (sentence level) dataset: type: google/dakshina name: Dakshina (Hindi romanized sentences) split: test metrics: - type: accuracy name: Word accuracy value: 89.02 - type: exact_match name: Sentence exact match value: 25.70 - type: cer name: CER value: 4.07 ---

AksharaLP — Hindi transliteration in under 8 MB

Live demo Core download size Complete download size Parameters On-device License

# AksharaLP-1M-v2

The world’s 3rd most spoken language, typed on the world’s most used keyboard. In under 8 MB.

Hindi typed in English letters → Devanagari, fully offline.
Starts typing at 0.6 MB; the dictionary pack streams in after and is cached.

### Why it matters | 🌏 **#3** | 🗣️ **611M** | 📦 **< 8 MB** | |:---:|:---:|:---:| | most spoken language in the world | people speak Hindi (first or second language) | is all it takes to type it — no server, no GPU | Source: Ethnologue 200 (Ethnologue: Languages of the World, 29th edition, SIL Global), 2026 — https://www.ethnologue.com/insights/ethnologue200/ (accessed 2026-10-31). Counts first- and second-language speakers. On a Latin (QWERTY) keyboard, Hindi is often typed in English letters: *“kal meeting hai, kaise ho?”*. AksharaLP-1M-v2 turns that into proper Devanagari — accurately, in context, and entirely offline in the browser. It transliterates (changes the script); it does not translate. AksharaLP-1M-v2 is the 989K-parameter member of the **AksharaLP** family of tiny transliteration models. For *“kal meeting hai, kaise ho?”* AksharaLP writes **कल मीटिंग है, कैसे हो?**, the way a Hindi speaker would. It ships in two tiers: a **0.57 MB core** (character Transformer with 989K parameters, reranker and runtime) that works on its own, and a **7.35 MB dictionary pack** (3M-word lexicon and sentence language model) that the runtime fetches on first use and caches. The complete package is **under 8 MB** to download (7.92 MB gzipped). The complete package is **2.8× smaller** than the model weights of IndicXlit, the most widely used open Indic transliteration model, and **24× smaller** than IndicXlit with its rescoring dictionary — while **beating IndicXlit’s model on top-1 accuracy** (70.04% vs 59.16% on Aksharantar) and on par with the full package (69.33%; paired gap +0.71 points, 95% CI -0.04 to 1.40).

Live typing demo
Recorded from the live demo: inference runs in a Web Worker in the browser tab.

## Versions **v2 (this repo) is the recommended release.** [v1](https://huggingface.co/sourojitdotcom/AksharaLP-1M) remains available ([v1 demo](https://huggingface.co/spaces/sourojitdotcom/AksharaLP-demo)). | | v1 | **v2 (this repo)** | |---|---|---| | Dictionary pack | 1.5M words | **3M words** | | Complete download (gzipped) | **4.53 MB** | 7.92 MB | | Aksharantar top-1 / top-3 / top-8 % | **70.37** / 87.66 / 92.79 | 70.04 / **88.31** / **93.63** | | Core-only top-1 % | 53.36 | **56.01** | | Dakshina word acc / sentence EM % | 87.55 / 21.66 | **89.02** / **25.70** | | Chat-spelling sentences, word acc % (480 held-out) | 80.16 | **91.54** | | Browser latency / word (p50) | 219.7 ms | **206.0 ms** | v1 numbers from the v1 model card. Aksharantar top-1 differs by 0.33 points with overlapping 95% CIs. Choose v1 only if the smaller download matters more than chat-spelling accuracy. ## Best in class for its size

2.8×

beats a model 2.8× its size
+10.9 pts top-1 vs IndicXlit model only (46.0 MB) · paired 95% CI 9.9–11.8

88.3%

top-3 accuracy — higher than IndicXlit full package (85.4%)
+2.9 pts [95% CI 2.3–3.5] at 24× smaller

11.4 pts

more accurate on casual chat Hindi than v1
whole sentences right 62.9% → 82.5% · 480 held-out chat sentences

89.0%

word accuracy on full Hindi sentences
Dakshina, 4,976 test sentences · v1 87.5% (+1.5 pts, 95% CI 1.3–1.6)

24×

smaller than IndicXlit full package
16.3 MB vs 404 MB on disk (fp32 weights + 358 MB rescoring dictionary)

0 calls

network calls — fully offline
206 ms per word (p50) in the browser · nothing you type leaves the device
All measured results (14 more claims that passed their rules) | Result | What | Details | |---|---|---| | **88.3%** | top-3 accuracy — higher than IndicXlit model only (80.0%) | +8.4 pts [95% CI 7.7–9.1] at 2.8× smaller | | **93.6%** | top-8 accuracy — higher than IndicXlit model only (88.3%) | +5.3 pts [95% CI 4.8–5.9] at 2.8× smaller | | **93.6%** | top-8 accuracy — higher than IndicXlit full package (88.3%) | +5.3 pts [95% CI 4.8–5.9] at 24× smaller | | **2.65 pts** | core-only top-1 gain over v1 | 53.36% → 56.01% without the dictionary pack | | **2.8×** | smaller than IndicXlit model only | 16.3 MB vs 46.0 MB on disk (fp32 weights) | | **70.0%** | top-1 — higher than IndicXlit model only (59.2%) | at 2.8× smaller · Aksharantar Hindi test | | **70.0%** | top-1 — on par with IndicXlit full package (69.3%, overlapping 95% CIs) | at 24× smaller · Aksharantar Hindi test | | **0.65 pts** | top-3 gain over v1 | 87.66% → 88.31% · Aksharantar Hindi test | | **0.84 pts** | top-8 gain over v1 | 92.79% → 93.63% · Aksharantar Hindi test | | **4.3 pts/MB** | highest top-1 accuracy per MB among compared models | next: IndicXlit model only at 1.28 pts/MB | | **88.3%** | right word in the first 3 suggestions — vs 59.2% top-1 for IndicXlit model only | Aksharantar Hindi test | | **88.3%** | right word in the first 3 suggestions — vs 69.3% top-1 for IndicXlit full package | Aksharantar Hindi test | | **< 8 MB** | complete download | core + 3M-word dictionary pack · 989K parameters · 7.92 MB gzipped | | **0.57 MB** | to start typing | the core works on its own (56.0% top-1 without the pack); the dictionary pack streams in after and is cached |
**Accuracy per MB** (top-1 on Aksharantar Hindi test ÷ on-disk size; systems measured by us with the same harness): | # | System | On disk | Top-1 % | Top-1 pts per MB | |---|---|---|---|---| | 1 | **AksharaLP-1M-v2** | 16.3 MB | 70.04 | **4.30** | | 2 | IndicXlit model only | 46.0 MB | 59.16 | 1.28 | | 3 | IndicXlit full package | 404 MB | 69.33 | 0.17 | > 🏆 No compared model is both smaller and more accurate: AksharaLP-1M-v2 sits on the size–accuracy frontier. Every tile and every row above is generated by the release build from measured results and shown only if its rule holds (rules and outcomes are logged in the build report). ## Real-world comparison: casual Hindi

Same input, typed casually: a phone keyboard screenshot next to AksharaLP v2's output

**Same input, typed casually** (measured 2026-11-01). | | Output for *“Boht ache h Bhai”* | |---|---| | A popular phone keyboard (author's screenshot) | **बोहट अ थे भाई** | | AksharaLP-1M-v2 (released runtime, offline, under 8 MB) | **बोहत अच्छे है भाई** | | Standard Hindi spelling (reference) | बहुत अच्छे है भाई | Words in standard spelling: the keyboard 1 of 4 (भाई); AksharaLP-1M-v2 3 of 4 (अच्छे, है, भाई). AksharaLP-1M-v2 writes बोहत (standard: बहुत). Screenshot supplied by the author, cropped to the input and output lines (keyboard name not shown; text unaltered). AksharaLP-1M-v2's output is from the released runtime on this exact input, measured 2026-11-01. This is one sentence, shown as a showcase only: it is not part of any test or tuning set and does not change the accuracy numbers above. ## Highlights | | | |---|---| | 🪶 **Extremely small** | Under 8 MB complete: 0.57 MB core + 7.35 MB dictionary pack = 7.92 MB gzipped (16.3 MB on disk); 989K parameters, 4-bit weights. Fits in a keyboard app, a browser extension or a web page. | | 🎯 **Accurate** | With the dictionary pack: 70.04% top-1 / 88.31% top-3 on the Aksharantar Hindi test set (9,991 words); 89.02% word accuracy on Dakshina sentences. Core-only numbers are in [Variants](#variants-core-only-vs-core--dictionary). | | 🧠 **Context-aware** | A compact bigram language model picks the right word from its neighbours: the same *main* becomes मैं or में. | | 📥 **Starts fast, degrades gracefully** | The core is enough to start typing; the dictionary pack streams in after and is cached. If the pack cannot be fetched, the runtime keeps working with the core alone. | | 🔒 **Private & offline** | Pure JavaScript, zero dependencies, no server. Nothing you type leaves the device; works offline after first load. | | ⚡ **Fast** | 206.0 ms per word (p50) in the browser on an 8-vCPU Intel Xeon cloud VM (headless Chrome 156, Linux). | ## What it brings on-device Everything below happens on the user’s own phone or laptop: the model is a set of static files plus a dependency-free JavaScript runtime. Each example output was produced by the released runtime when this card was built.
### ✈️ Fully offline No network after the first load, so it keeps working in airplane mode, in a lift, or on a train. `flight mein hoon, land karke call karta hoon`
→ **फ्लाइट में हूं, लैंड करके कॉल करता हूं**
### 🔒 Private by design Text never leaves the device: no API call, no logging server. Suited to banking, health and personal chat. `mera account balance kitna hai`
→ **मेरा अकाउंट बैलेंस कितना है**
`doctor ne din mein do baar dawai lene ko kaha`
→ **डॉक्टर ने दिन में दो बार दवाई लेने को कहा**
### 🌐 Runs wherever JavaScript runs A browser tab, an Android or iOS WebView, an installable PWA, or Node.js. CPU only: no GPU, no server, no inference bill. `namaste, aapka swagat hai`
→ **नमस्ते, आपका स्वागत है**
### ⚡ Real-time, as you type The sentence is re-decoded on every keystroke in a Web Worker, and earlier words are corrected as context arrives: `main` → मैं
`main theek` → मैं ठीक
`main theek hoon` → **मैं ठीक हूं** Browser latency: 206.0 ms per word (p50) on an 8-vCPU Intel Xeon cloud VM (headless Chrome 156, Linux).
### ⌨️ Keyboard & input-box integration Wire it to any `` or `