--- license: apache-2.0 new_version: sourojitdotcom/AksharaLP-1M-v2 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 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.37 - type: accuracy name: Top-3 accuracy value: 87.66 - type: accuracy name: Top-8 accuracy value: 92.79 - 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: 87.55 - type: exact_match name: Sentence exact match value: 21.66 - type: cer name: CER value: 4.81 ---

AksharaLP — Hindi transliteration in 4.53 MB

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

# AksharaLP-1M > [!IMPORTANT] > **This is v1 (1.0.0). [AksharaLP-1M-v2](https://huggingface.co/sourojitdotcom/AksharaLP-1M-v2) is the recommended version** ([v2 live demo](https://huggingface.co/spaces/sourojitdotcom/AksharaLP-v2-demo)). > Same 989K-parameter core architecture; v2 ships a 3M-word dictionary pack (v1: 1.5M) and a reranker refitted for chat-style spellings (*h*, *nhi*, *bht*). > > | | v1 (this repo) | v2 | > |---|---|---| > | 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** | > > Numbers from the two model cards; the chat-spelling comparison is from the v2 card. Top-1 on Aksharantar differs by 0.33 points with overlapping 95% CIs ([69.50, 71.26] vs [69.16, 70.90]). > Keep using v1 only if the smaller 4.53 MB download matters more than chat-spelling accuracy. v1 stays available for reproducibility.

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

Hindi typed in English letters → Devanagari, fully offline.

### Why it matters | 🌏 **#3** | 🗣️ **611M** | 📦 **4.5 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 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 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 **3.97 MB dictionary pack** (1.5M-word lexicon and sentence language model) that the runtime fetches on first use and caches. The complete package is **4.53 MB** to download. The complete package is **5× smaller** than the model weights of IndicXlit, the most widely used open Indic transliteration model, and **47× smaller** than IndicXlit with its rescoring dictionary — while scoring **higher top-1 than both** on Aksharantar (70.37% vs 59.16% for the model and 69.33% for the full package; the gap to the full package is within overlapping 95% CIs).

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

## Highlights | | | |---|---| | 🪶 **Extremely small** | 0.57 MB core + 3.97 MB dictionary pack = 4.53 MB gzipped (8.69 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.37% top-1 / 87.66% top-3 on the Aksharantar Hindi test set (9,991 words); 87.55% 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** | 219.7 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: 219.7 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 `