Desert Ant Labs

Tongue

Language identificationAvailable

On-device language detection for text across 84 languages. Identify the language in tens of microseconds, from just a few words.

Demo

Detect language based on 3 words.

"kann ich das haben" is German. "안녕하세요" is Korean. Three words is the hard case, and three words is what a search box gives you.

From three words, Tongue scores 0.933 where a 293MB detector scores 0.887. Tongue is 2MB, and works in two stages: some scripts belong to one language only, so Hangul is Korean and Thai is Thai, settled with no model involved. The rest go to the model.

Tongue needs no tokenizer, vocabulary file, or inference runtime, which is how the whole package fits in 2MB. When the input is too short to call, Tongue reports a tie.

0.933 from a 2MB model.

At 2MB, Tongue scores 0.933 on three-word FLORES-200 input, against 0.887 for a 293MB detector.

0.933
FLORES-200, 3 words
vs 0.887 for a 293MB detector
0.992
Tweets
eld benchmark, 9,066 rows
84
Languages
2MB
int8 weights
no tokenizer, no runtime

Measured on the shipped int8 weights across three public benchmarks, with the other detectors run on identical rows and language subsets. Full tables and failure modes are on the model card.

Use cases

Detect language based on 3 words.

Route text by language

Pick the right translation model, analyzer, or support queue from the first few words a user types, entirely on device.

Keyboards and input

Detect the language mid-sentence to switch autocorrect, suggestions, or layouts, at a cost of tens of microseconds per keystroke.

Search and content pipelines

Tag short strings with a language before indexing or moderation, without a network round-trip or a per-request service.

Ask for more text instead of guessing

"la casa" is Italian and Spanish in equal measure. Tongue reports the tie, so your product waits for another word rather than switching the keyboard by mistake.

Inspiration

Ideas to build with Tongue. Copy a prompt into your coding agent and go.

Tongue

Route incoming messages to the right language agent.

Tongue

Auto-switch the keyboard and spellcheck to the language being typed.

Tongue

Tag user posts by language for search and moderation.

TongueRedact

Detect the language, then redact PII in that language.

Tongue

Detect the language of a search query and pick the right index.

TongueGist

Build an OpenClaw skill that tags and language-routes text.

TongueGist

A chat bot that tags and language-routes messages, in Node.

TongueGist

Build an agent skill that tags and language-routes text for an agent.

What the model does

  • 84 languages: 59 decoded by the model, 25 settled by script alone.
  • 2MB int8 weights, bundled in the package; nothing is downloaded.
  • Tens of microseconds per detection, on the main thread.
  • Identical answers on Swift, Kotlin, and JavaScript, held to shared golden vectors.
  • Reports a reliability score and marks every tie.

Getting started

Add language identification to your iOS or macOS, Android or web app in a few lines of code. Tongue docs.

iOS, macOS
Install
// Swift Package Manager
.package(url: "https://github.com/Desert-Ant-Labs/desert-ant-core", from: "3.1.0")
// target dependency
.product(name: "Tongue", package: "desert-ant-core")
Example - Swift
import Tongue

let tongue = try Tongue()
tongue.detect("kann ich das haben").language
// "de"
Build with a prompt
Add Tongue from Desert Ant Labs to this Swift project (iOS, macOS).

What it does: On-device Language Identification.

SDK:

Swift (iOS, macOS)
Repo: https://github.com/Desert-Ant-Labs/desert-ant-core#readme
// Swift Package Manager
.package(url: "https://github.com/Desert-Ant-Labs/desert-ant-core", from: "3.1.0")
// target dependency
.product(name: "Tongue", package: "desert-ant-core")

Reference:
- Model page: https://desertant.com/models/tongue/
- Full catalog and other models: https://desertant.com/llms.txt

Add the SDK, then follow its README for the exact API and current version. Do not invent API names or method signatures; confirm them against the README.
Android
Install
// build.gradle.kts (Maven Central)
implementation("ai.desertant:tongue:3.1.0")
Example - Kotlin
import ai.desertant.tongue.Tongue

val tongue = Tongue.bundled(context)
tongue.detect("kann ich das haben").language
// "de"
Build with a prompt
Add Tongue from Desert Ant Labs to this Kotlin project (Android).

What it does: On-device Language Identification.

SDK:

Kotlin (Android)
Repo: https://github.com/Desert-Ant-Labs/desert-ant-core#readme
// build.gradle.kts (Maven Central)
implementation("ai.desertant:tongue:3.1.0")

Reference:
- Model page: https://desertant.com/models/tongue/
- Full catalog and other models: https://desertant.com/llms.txt

Add the SDK, then follow its README for the exact API and current version. Do not invent API names or method signatures; confirm them against the README.
Web, Node.js
Install
npm i @desert-ant-labs/tongue
Example - TypeScript
import { Tongue } from "@desert-ant-labs/tongue";

const tongue = await Tongue.load();
tongue.detect("kann ich das haben").language;
// "de"
Build with a prompt
Add Tongue from Desert Ant Labs to this JavaScript / TypeScript project (Web, Node.js).

What it does: On-device Language Identification.

SDK:

JavaScript / TypeScript (Web, Node.js)
Repo: https://github.com/Desert-Ant-Labs/desert-ant-core#readme
npm i @desert-ant-labs/tongue

Reference:
- Model page: https://desertant.com/models/tongue/
- Full catalog and other models: https://desertant.com/llms.txt

Add the SDK, then follow its README for the exact API and current version. Do not invent API names or method signatures; confirm them against the README.

Specs

Languages
84, across 31 scripts
On-device size
2MB int8 weights, inside the package
Speed
Tens of microseconds per detection
Model
Script router plus hashed character n-grams into an int8 linear head

One or two words is often undecidable, and no model size fixes the problem. Tongue reports a tie or a tentative answer, so treat low reliability as "unknown", not as an answer.

Malay and Indonesian share too much vocabulary to separate on a short sample. Mongolian is covered in the traditional script only, so Cyrillic Mongolian is read as Russian.

Brand names, numbers, and code are not language, and will get a guess.

FAQ

What is Tongue?

On-device language detection for text across 84 languages. Identify the language in tens of microseconds, from just a few words.

Does Tongue run on device?

Yes. Tongue runs on the device, with no server call, so the data stays with the user.

Which platforms does Tongue support?

Tongue ships as a native on-device SDK for Swift, Kotlin, JavaScript / TypeScript.

How much does Tongue cost?

Every model is free up to 100k monthly active devices per SDK. Unlimited inference per user. Contact us for custom licenses.

How accurate or fast is Tongue?

At 2MB, Tongue scores 0.933 on three-word FLORES-200 input, against 0.887 for a 293MB detector.

Resources