🚀 Hindi to Hinglish Pro (Neural Transliteration & Romanization)
A high-accuracy, context-aware neural transliteration model designed to convert native Devanagari Hindi text into natural conversational Hinglish (Romanized Hindi).
This model converts formal or spoken Hindi text (डॉक्टर ने मरीज को तुरंत अस्पताल ले जाने और टेस्ट कराने की सलाह दी) into everyday, natural Romanized text (Doctor ne marij ko turant aspatal le jane aur test karane ki salah di).
⚡ Primary Inference Engine: This model was explicitly trained and optimized for Akshar Engine — a dedicated, standalone C++17 runtime delivering sub-15ms real-time transliteration on any Windows PC with zero Python or CUDA dependencies.
🌟 Key Highlights
- Native Akshar Engine Runtime: Runs at blazing speeds (~10–15ms per sentence) using our dedicated C++ Vulkan engine. Zero Python environment or 15 GB CUDA installations required.
- Context-Aware Romanization: Unlike traditional rule-based tables that produce archaic Sanskrit spellings ("vidyālaya", "samācāra", "kṛpayā"), this model produces modern, natural conversational Hinglish ("school", "news", "please").
- English Word Preservation: Intelligently identifies technical, medical, financial, and popular English words and outputs them in standard English spelling ("computer", "doctor", "update", "match", "investment").
- Zero Out-of-Vocabulary Errors: Built on Google's byte-level ByT5 architecture, ensuring names, numbers, complex Hindi half-letters (ksh, tra, gya, shra), and modern internet slang are accurately transliterated without missing characters.
- Universal Multi-Runtime Packaging: Distributed across 4 dedicated formats—GGUF (Q8_0) for Akshar Engine, PyTorch SafeTensors, ONNX, and CTranslate2.
📦 Available Model Formats
| Format | File Location | File Size | Recommended For |
|---|---|---|---|
| GGUF (Q8_0) ⭐ | gguf/hindi-to-hinglish-pro.q8_0.gguf | 318 MB | ⚡ Akshar Engine (Primary/Recommended), llama.cpp, and native C++ apps |
| CTranslate2 (INT8) | ct2/ | 300 MB | High-throughput CUDA/CPU server backends |
| ONNX (INT8) | onnx/ | 460 MB | Cross-platform GPU (DirectML on AMD/Intel/NVIDIA) or CPU |
| PyTorch SafeTensors | model.safetensors | 1.19 GB | Python research, Hugging Face pipelines, and fine-tuning |
🏗️ Architecture & Specifications
Transformer Sequence-to-Sequence (Google ByT5-Small)
├── Primary Runtime: Akshar Engine (Standalone C++17 / Vulkan GPU)
├── Encoder: 12 Transformer Layers (d_model=1472, heads=6)
├── Decoder: 4 Transformer Layers (d_model=1472, heads=6)
├── Tokenizer: Byte-Level UTF-8 (No Subword / Zero OOV)
├── Quantizations: Q8_0 (GGUF), INT8 (ONNX & CTranslate2), BF16 (SafeTensors)
└── Formats: GGUF, CTranslate2, ONNX, PyTorch
🎯 Intended Use Cases
- Video Subtitles & Captions: Paired with speech-to-text models (Whisper, Parakeet, Conformer) to generate natural Romanized Hinglish subtitles for YouTube and social media.
- Chat & Voice Interfaces: Displaying Hindi assistant responses in English script for easier mobile reading.
- Search & Indexing: Converting Devanagari queries into Romanized phonetics for search matching and database lookups.
- Content Creation: Auto-generating social media captions, titles, and descriptions from spoken Hindi scripts.
📝 Sample Conversational Outputs
| Domain | 🇮🇳 Source Devanagari Hindi | ⚡ Generated Hinglish Output | Traditional Rule-Based (Flawed) |
|---|---|---|---|
| Tech & Software | सॉफ्टवेयर में नया अपडेट आ चुका है, कृपया सिस्टम रीस्टार्ट करें। | Software mein naya update aa chuka hai, kripya system restart karein. | sŏphṭavēyar mēṁ nayā apaḍēṭ... ❌ |
| Healthcare | डॉक्टर ने मरीज को तुरंत अस्पताल ले जाने की सलाह दी। | Doctor ne marij ko turant aspatal le jane ki salah di. | ḍŏkṭar nē marīza kō... ❌ |
| Finance | अगर आप शेयर मार्केट में इन्वेस्ट करना चाहते हैं, तो रिस्क मैनेजमेंट जरूरी है। | Agar aap share market mein invest karna chahte hain, toh risk management zaroori hai. | agar āp śēyar mārkēṭ... ❌ |
| Everyday Chat | अरे भाई, कल का मैच देखा क्या? क्या जबरदस्त कमबैक था! | Are bhai, kal ka match dekha kya? Kya zabardast comeback tha! | arē bhāī, kala kā maica... ❌ |
| Complex Conjuncts | विश्वविद्यालय के विद्यार्थियों ने वैज्ञानिक दृष्टिकोण पर चर्चा की। | Vishvavidyalay ke vidyarthiyon ne vaigyanik drishtikon par charcha ki. | viśvavidyālaya kē vidyārthiyōṁ... ❌ |
⚡ Real-World Benchmarks
Tested on consumer hardware (Intel Core i7 / NVIDIA RTX GPU / AVX2):
| Runtime / Engine | Model File | Latency (Sentence) | Throughput | Memory Footprint |
|---|---|---|---|---|
| Akshar Engine (Vulkan GPU) ⭐ | GGUF Q8_0 | ~10ms – 15ms | ~948 chars/sec | ~870 MB VRAM |
| CTranslate2 (CUDA) | CT2 INT8 | ~25ms – 35ms | ~476 chars/sec | ~380 MB VRAM |
| ONNX Runtime (DirectML) | ONNX INT8 | ~30ms – 40ms | ~455 chars/sec | ~770 MB VRAM |
| PyTorch (Transformers) | SafeTensors | ~120ms | ~147 chars/sec | ~2.4 GB VRAM |
💻 Quickstart & Integration
1. ⚡ The Recommended Way: Akshar Engine (Standalone C++ / Vulkan)
Akshar Engine is the dedicated native C++ inference engine designed specifically for this model. It provides sub-15ms real-time transliteration with zero Python setup and zero CUDA bloat.
Key Features:
- Zero Python / No Heavy Installs: Single lightweight 19 MB standalone Windows executable.
- Vulkan GPU Acceleration: Blazing fast inference on any modern GPU (NVIDIA, AMD Radeon, Intel Arc) with automatic CPU AVX2 fallback.
- Built-in 1-Click Model Download: The engine automatically downloads the official
hindi-to-hinglish-pro.q8_0.ggufweights on first run. - Standard IO Streaming (
stdin/stdout): Easily pipe sentences from Python, Node.js, Rust, Tauri, or Electron with no memory leaks or startup latency.
CLI Usage:
# Direct single sentence
echo "नमस्ते भारत, आज का दिन बहुत अच्छा है" | akshar_engine.exe -m hindi-to-hinglish-pro.q8_0.gguf
# Output:
# namaste bharat, aaj ka din bahut achha hai
Python Integration (via Akshar Engine Pipe):
Run this model in Python without installing 5GB PyTorch or CUDA:
import subprocess
def transliterate_hindi(text: str, engine_path: str = "akshar_engine.exe", model_path: str = "hindi-to-hinglish-pro.q8_0.gguf") -> str:
process = subprocess.Popen(
[engine_path, "-m", model_path],
stdin=subprocess.PIPE,
stdout=subprocess.PIPE,
stderr=subprocess.DEVNULL,
text=True,
encoding="utf-8"
)
stdout, _ = process.communicate(input=text + "\n")
return stdout.strip()
print(transliterate_hindi("डिजिटल दुनिया में मशीन लर्निंग और एआई बहुत तेजी से बढ़ रहे हैं।"))
# Output: digital duniya mein machine learning aur AI bahut tezi se badh rahe hain.
Native Rust / Tauri Integration:
use std::process::{Command, Stdio};
use std::io::Write;
pub fn transliterate(text: &str, model_path: &str) -> String {
let mut child = Command::new("akshar_engine.exe")
.args(["-m", model_path])
.stdin(Stdio::piped())
.stdout(Stdio::piped())
.spawn()
.expect("Failed to start Akshar Engine");
if let Some(mut stdin) = child.stdin.take() {
writeln!(stdin, "{}", text).unwrap();
}
let output = child.wait_with_output().expect("Failed to read output");
String::from_utf8_lossy(&output.stdout).trim().to_string()
}
Ecosystem & App Downloads:
- 🚀 Download Pre-Built Akshar Engine Executable (v1.0.0)
- 💻 Akshar Engine Source Code on GitHub
- 🎬 RenderCaption: 100% offline desktop app for automated transcription, subtitles, and live Hindi-to-Hinglish video captioning powered by Akshar Engine.
2. Using Python (transformers)
For Python researchers or Hugging Face pipelines:
from transformers import AutoTokenizer, AutoModelForSeq2SeqLM
repo_id = "Singla0009/Hindi-to-Hinglish-Pro"
tokenizer = AutoTokenizer.from_pretrained(repo_id)
model = AutoModelForSeq2SeqLM.from_pretrained(repo_id)
text = "आर्टिफिशियल इंटेलिजेंस हमारी ज़िंदगी को बहुत तेज़ी से बदल रहा है।"
inputs = tokenizer(text, return_tensors="pt")
outputs = model.generate(**inputs, max_length=128)
print(tokenizer.decode(outputs[0], skip_special_tokens=True))
# Output: Artificial intelligence hamari zindagi ko bahut tezi se badal raha hai.
3. Using High-Throughput CTranslate2 (ct2/)
For production CUDA batch servers:
pip install ctranslate2 huggingface_hub
import ctranslate2
from huggingface_hub import snapshot_download
model_path = snapshot_download("Singla0009/Hindi-to-Hinglish-Pro", allow_patterns=["ct2/*"])
translator = ctranslate2.Translator(f"{model_path}/ct2", device="cuda", compute_type="int8")
text = "कल हमारे कॉलेज में एक बड़ा प्रोग्राम आयोजित किया जाएगा"
tokens = list(text) # ByT5 byte tokens
results = translator.translate_batch([tokens], beam_size=1)
output = "".join(results[0].hypotheses[0])
print(output)
# Output: Kal hamare college mein ek bada program aayojit kiya jayega
4. Using ONNX Runtime & DirectML (onnx/)
For cross-platform GPU (AMD, Intel, NVIDIA) with DirectML:
import onnxruntime as ort
from huggingface_hub import snapshot_download
model_path = snapshot_download("Singla0009/Hindi-to-Hinglish-Pro", allow_patterns=["onnx/*"])
onnx_dir = f"{model_path}/onnx"
providers = ['DmlExecutionProvider', 'CPUExecutionProvider']
encoder_session = ort.InferenceSession(f"{onnx_dir}/encoder_model_quantized.onnx", providers=providers)
decoder_session = ort.InferenceSession(f"{onnx_dir}/decoder_model_merged_quantized.onnx", providers=providers)
print("ONNX DirectML Engine loaded successfully!")
📜 Dataset & Training
- Base Architecture: Google ByT5 (Byte-Level Sequence-to-Sequence).
- Dataset Size: 120,000+ curated sentence pairs covering multiple specialized domains:
- Technical & IT documentation
- Healthcare & Clinical consultations
- Finance, Banking, and Stock Market
- Social media posts, YouTube colloquial comments & conversational scripts
- Training Objective: Optimized for phonetically accurate conversational Romanization while preserving English technical vocabulary and spellings.
📄 License & Attribution
- License: MIT
- Author & Maintainer: Ansh Singla (Singla0009)