Detect the language and script of any text, even a two-word chat message or Hinglish, in under a tenth of a millisecond. It runs on the device (Android, iOS, desktop or the web) and sends nothing to a server.
Free up to 10k monthly active devices · No API key · On Maven Central · Android, iOS, desktop, web
hin_LatnHindi (romanised)This is the actual Beacon library, compiled to WebAssembly and running in your browser. Type a few words in any language or script. Your text never leaves this page.
Most language detectors are built for long, tidy text. Beacon is built for short messages, mixed scripts and Indian languages typed in Latin letters.
Tells Hinglish, Tanglish, Banglish and 9 more romanised South Asian languages apart, at 93% accuracy. Other detectors score close to 0% here.
Pure Kotlin inference. There is no ML Kit, TFLite or native code, and no Google Play services requirement. It adds about 8.5 MB to your APK.
The model ships inside the library on every platform. It makes no network calls, needs no permissions and sends no telemetry, so user text never leaves the phone.
About 0.08 ms per text on an Android emulator. That is fast enough to re-detect on every keystroke.
Real output from the sample app on an Android emulator. These are not mockups.
"Kal milte hain bhai" → hin_Latn, with Urdu (romanised) a close second
"Enna panra da" → tam_Latn, 98%
"நான் வீட்டுக்கு போறேன்" → tam_Taml, 94%
The Kotlin Multiplatform sample app, built from the published artifacts, gives the same result on Android, iOS, desktop and the web.

Kal milte hain bhai → hin_Latn 50%

Kal milte hain bhai → hin_Latn 50%

Kal milte hain bhai → hin_Latn 50%

Kal milte hain bhai → hin_Latn 50%
One line in your Gradle file, from Maven Central. Works in commonMain for Android, iOS, macOS, JVM desktop, JavaScript and WebAssembly. No API key, no account.
// build.gradle.kts: commonMain, or any platform source set
dependencies {
implementation("io.github.rajumark:beacon:2.0.0")
}
// Gradle picks the right artifact per platform:
// beacon-android · beacon-jvm · beacon-iosarm64 · beacon-iossimulatorarm64
// beacon-macosarm64 · beacon-js · beacon-wasm-js
Add Beacon from rajumark to this Kotlin Multiplatform or Android project.
What it does: on-device language detection for 211 languages and scripts, including romanised Indian languages (Hinglish, Tanglish). ~8.5 MB, no dependencies, no network.
Install (Maven Central, no extra repository):
build.gradle.kts (commonMain or any source set): implementation("io.github.rajumark:beacon:2.0.0")
Platforms: Android, iOS, macOS, JVM desktop, JavaScript, WebAssembly
Usage:
val beacon = Beacon() // off the main thread, keep one instance
val r = beacon.detect("Kal milte hain bhai")
r.label // "hin_Latn"
Repo: https://github.com/rajumark/beacon#readme
Add the dependency, then follow the README for the exact API and current version.
Load once and reuse the instance. detect() is thread-safe.
val beacon = Beacon()
val r = beacon.detect("Kal milte hain bhai")
r.label // "hin_Latn"
r.name // "Hindi (romanised)"
r.isReliable // true
beacon.close()
try (Beacon beacon = new Beacon()) {
DetectedLanguage r =
beacon.detect("Kal milte hain bhai");
String label = r.getLabel();
}
Anywhere your app needs to know which language it is looking at before it does something with the text.
Switch the suggestion dictionary or layout to the language the user is actually typing.
"Enna panra da" → tam_LatnPick the source language automatically, even for romanised text that looks like English.
"Nos vemos mañana" → spa_LatnChoose the right TTS voice before reading a message aloud.
"ఎలా ఉన్నారు?" → tel_TeluSend a ticket to an agent who speaks the customer's language, before anyone reads it.
"Aap kaise ho" → hin_LatnFilter feeds, comments or search results by language on the device.
"Je suis en retard" → fra_LatnSend Hindi and Hinglish to different models, or turn on smart replies only for languages you support.
"मैं घर जा रहा हूँ" → hin_DevaReal problems Beacon solves today. Pick one and ship it.
Smart keyboard · Switch the dictionary the moment a user flips from English to Hinglish mid-sentence.
Auto-translate chat · Translate only the messages that aren't in the reader's language and leave the rest alone.
Read-aloud app · Pick the right text-to-speech voice for each message before speaking it.
Support ticket router · Assign each ticket to an agent who speaks the customer's language, before anyone reads it.
Chatbot that answers in kind · Reply in the same language and script the user typed in, Tanglish included.
Multilingual search · Send "sasta phone chahiye" to the Hindi analyzer, not the English one.
Regional news feed · Show each user only the articles and comments in languages they actually read.
Moderation pre-check · Route each message to the moderation model trained for its language.
Spell checker · Load the right spell-check dictionary per sentence in bilingual text.
Font & direction picker · Choose the right font and RTL/LTR layout for Urdu, Arabic or Tamil before rendering.
Smart reply gating · Show reply chips only when the message is in a language your reply model supports.
Language-learning app · Check the learner answered in Spanish, not English, before grading the answer.
Review sorter · Group app-store or product reviews by language for regional support teams.
Private language analytics · Learn which languages your users type in without sending a single message to a server.
Notes auto-tagging · Tag notes by language so bilingual users can filter Hindi notes from English ones.
Subtitle checker · Verify a subtitle track is really in the language its label claims.
Form validation · Warn when a "Name in Hindi" field is filled with English letters.
Notification language · Send push notifications in the language each user chats in, not just the phone locale.
Civic complaint app · Route citizen complaints in any of the 22 Indian languages to the right state office.
Dataset cleaner · Filter user-generated text by language on the device before it is uploaded or labelled.
Beacon compared with the best of fastText, OpenLID, MediaPipe, CLD2, langid.py, Lingua and ML Kit on each test.
| Test | Beacon | Best other detector |
|---|---|---|
| FLORES-200, 64 shared languages | 98.5% | OpenLID-201 98.9% (158 MB) |
| Short text, ≤ 5 words | 93.8% | Lingua 89.0% |
| Chat messages (188 hand-written) | 88.3% | MediaPipe 71.3% |
| Romanised Indic (human + real chat) | 93.0% | MediaPipe 7.5%, others ~0% |
Known limits: single words are hard (65%). Close pairs stay close: Bosnian/Croatian/Serbian, Indonesian/Malay, and romanised Hindi vs romanised Urdu, which are the same spoken language.
| Member | Description |
|---|---|
Beacon() | Loads the bundled model. Implements AutoCloseable. |
detect(text) | The most likely language, or DetectedLanguage.UNDETERMINED when the text has no letters. |
candidates(text, limit = 3) | The most likely languages, best first. |
supportedLabels | All 211 labels, such as hin_Latn or tam_Taml. |
DetectedLanguage(label, language, script, name, confidence) | One result, with ISO 639-3 language and ISO 15924 script codes and isReliable. |
No API key, no sign-up, no license file. Add Beacon to your project and ship. It stays free until your product passes 10,000 monthly active devices, and there's never a limit on how often each device runs it.
For indie developers, startups and growing apps, up to 10,000 monthly active devices.
For products above 10,000 monthly active devices on any platform.
A small, fast on-device model trained for your language, domain or task.
A monthly active device is a phone, tablet or other device that runs Beacon at least once in a calendar month.
The 10,000 limit applies separately to each product, each platform (Android, iOS, web…) and each Hoverfly model. Crossed it? You have 30 days to get a commercial license.
Questions about licensing? Email raju348636@gmail.com or call / WhatsApp +91 63533 21951. Full terms: Hoverfly Community License.
A Kotlin Multiplatform library (Android, iOS, macOS, JVM desktop, JavaScript, WebAssembly) that returns the language and script of a piece of text, from a list of 211 labels. That list includes all 22 scheduled Indian languages and 12 romanised South Asian languages.
Language plus script: Hindi (ISO 639-3 hin) written in Latin letters (ISO 15924 Latn). The same language in Devanagari is hin_Deva.
Yes. Inference runs entirely on the device in plain Kotlin. It makes no server calls, needs no network permission and sends no telemetry.
On an Android emulator it scored 88.3% vs 71.3% on chat, 93.2% vs 84.0% on short text, and 92.1% vs 6.9% on romanised Indic. It also needs no Google Play services.
Normalization, feature ids and predicted labels match the Python reference on all 958 test vectors, both on the JVM and on an Android device.
Nothing for products with up to 10,000 monthly active devices per platform, including commercial apps. There is no API key or account, and no limit on how often it runs. Above that, a commercial license is needed. See Pricing.
Nothing breaks: Beacon keeps working and never checks in with a server. You have 30 days to get a commercial license. Email raju348636@gmail.com or call / WhatsApp +91 63533 21951.
Yes. Hoverfly trains custom on-device models for your language, domain or task and ships them as a small library like this one. Get in touch on the same email or number.
Built by a developer, for developers.
Every model here started as a problem I hit in my own apps. I made them small, private and free to start, so you can spend your time on the part your users will love.
Eight small on-device models, one job each. Same install, same free tier, and the same promise: nothing leaves the device.