Tongue
Identificação de idioma no dispositivo que, a partir de poucas palavras, escolhe entre 84 opções, em dezenas de microssegundos.

Demo
Reconheça o idioma com 3 palavras.
“kann ich das haben” é alemão. “안녕하세요” é coreano. Três palavras é o caso difícil, e três palavras é o que uma caixa de busca te dá.
Com três palavras, o Tongue marca 0,933 onde um detector de 293 MB marca 0,887. O Tongue tem 2 MB e trabalha em duas etapas: alguns sistemas de escrita pertencem a um só idioma, hangul é coreano e tailandês é tailandês, resolvido sem modelo. O resto vai para o modelo.
O Tongue dispensa tokenizador, arquivo de vocabulário e runtime de inferência, e é assim que o pacote inteiro cabe em 2 MB. Quando a entrada é curta demais para decidir, o Tongue informa um empate.
0,933 a partir de um modelo de 2 MB.
Com 2 MB, o Tongue marca 0,933 em entradas de três palavras do FLORES-200, contra 0,887 de um detector de 293 MB.
Medido nos pesos int8 publicados, em três benchmarks públicos, com os outros detectores executados nos mesmos exemplos e nos mesmos subconjuntos de idiomas. As tabelas completas e os modos de falha estão no model card.
Casos de uso
Reconheça o idioma com 3 palavras.
Rotear texto por idioma
Escolha o modelo de tradução, o analisador ou a fila de suporte certos já nas primeiras palavras digitadas, inteiramente no dispositivo.
Teclados e digitação
Detecte o idioma no meio da frase para trocar a autocorreção, as sugestões ou o layout, ao custo de dezenas de microssegundos por tecla.
Busca e pipelines de conteúdo
Marque strings curtas com um idioma antes de indexar ou moderar, sem ida e volta pela rede nem um serviço por requisição.
Peça mais texto em vez de chutar
“la casa” é italiano e espanhol na mesma medida. O Tongue informa o empate, então o seu produto espera mais uma palavra em vez de trocar o teclado por engano.
Inspiração
Ideias para construir com o Tongue. Copie um prompt para o seu agente de código e comece.
Route incoming messages to the right language agent.
Use Desert Ant's Tongue to identify the language of an incoming message from a few words, on-device, and route it to the right support queue, model, or translation path. Build it with the Desert Ant SDK. Tongue (Swift, Kotlin, JavaScript / TypeScript). Install and API: https://desertant.com/docs/tongue/. Install: SwiftPM desert-ant-core; Maven ai.desertant:tongue:3.1.0; npm i @desert-ant-labs/tongue. SDK source: https://github.com/Desert-Ant-Labs/desert-ant-core. Machine-readable catalog of every model and SDK: https://desertant.com/llms.txt.
Auto-switch the keyboard and spellcheck to the language being typed.
In a text field, run Desert Ant's Tongue on the first words to detect the language and switch keyboard, spellcheck, and autocorrect to match, in microseconds, on-device. Build it with the Desert Ant SDK. Tongue (Swift, Kotlin, JavaScript / TypeScript). Install and API: https://desertant.com/docs/tongue/. Install: SwiftPM desert-ant-core; Maven ai.desertant:tongue:3.1.0; npm i @desert-ant-labs/tongue. SDK source: https://github.com/Desert-Ant-Labs/desert-ant-core. Machine-readable catalog of every model and SDK: https://desertant.com/llms.txt.
Tag user posts by language for search and moderation.
Use Desert Ant's Tongue to label each user post with its language on-device, so search, ranking, and moderation can branch by language without a server call. Build it with the Desert Ant SDK. Tongue (Swift, Kotlin, JavaScript / TypeScript). Install and API: https://desertant.com/docs/tongue/. Install: SwiftPM desert-ant-core; Maven ai.desertant:tongue:3.1.0; npm i @desert-ant-labs/tongue. SDK source: https://github.com/Desert-Ant-Labs/desert-ant-core. Machine-readable catalog of every model and SDK: https://desertant.com/llms.txt.
Detect the language, then redact PII in that language.
Run Desert Ant's Tongue to detect a message's language, then Redact to strip PII with the right language coverage, both on-device. Build it with the Desert Ant SDK. Tongue (Swift, Kotlin, JavaScript / TypeScript). Install and API: https://desertant.com/docs/tongue/. Redact (Swift, Kotlin, JavaScript / TypeScript). Install and API: https://desertant.com/docs/redact/. SDK source: https://github.com/Desert-Ant-Labs/desert-ant-core. Machine-readable catalog of every model and SDK: https://desertant.com/llms.txt.
Detect the language of a search query and pick the right index.
Run Desert Ant's Tongue on a search query on-device to route it to the right language index or analyzer, in microseconds. Build it with the Desert Ant SDK. Tongue (Swift, Kotlin, JavaScript / TypeScript). Install and API: https://desertant.com/docs/tongue/. Install: SwiftPM desert-ant-core; Maven ai.desertant:tongue:3.1.0; npm i @desert-ant-labs/tongue. SDK source: https://github.com/Desert-Ant-Labs/desert-ant-core. Machine-readable catalog of every model and SDK: https://desertant.com/llms.txt.
Build an OpenClaw skill that tags and language-routes text.
Write an OpenClaw skill that runs Desert Ant's Tongue to detect a text's language and Gist to tag its topics, on-device, so an agent can route content without a server call. Build it with the Desert Ant SDK. Tongue (Swift, Kotlin, JavaScript / TypeScript). Install and API: https://desertant.com/docs/tongue/. Gist (Swift, Kotlin, JavaScript / TypeScript). Install and API: https://desertant.com/docs/gist/. SDK source: https://github.com/Desert-Ant-Labs/desert-ant-core. Machine-readable catalog of every model and SDK: https://desertant.com/llms.txt.
A chat bot that tags and language-routes messages, in Node.
Build a Slack or Discord bot that runs Desert Ant's Tongue and Gist in Node to detect each message's language and topic and route it, with no third-party classification service. Build it with the Desert Ant SDK. Tongue (Swift, Kotlin, JavaScript / TypeScript). Install and API: https://desertant.com/docs/tongue/. Gist (Swift, Kotlin, JavaScript / TypeScript). Install and API: https://desertant.com/docs/gist/. SDK source: https://github.com/Desert-Ant-Labs/desert-ant-core. Machine-readable catalog of every model and SDK: https://desertant.com/llms.txt.
Build an agent skill that tags and language-routes text for an agent.
Write a SKILL.md agent skill that runs Desert Ant's Tongue to detect a text's language and Gist to tag its topics, on-device, so the agent can route or filter content without a server call. Build it with the Desert Ant SDK. Tongue (Swift, Kotlin, JavaScript / TypeScript). Install and API: https://desertant.com/docs/tongue/. Gist (Swift, Kotlin, JavaScript / TypeScript). Install and API: https://desertant.com/docs/gist/. SDK source: https://github.com/Desert-Ant-Labs/desert-ant-core. Machine-readable catalog of every model and SDK: https://desertant.com/llms.txt.
O que o modelo faz
- 84 idiomas: 59 decodificados pelo modelo, 25 resolvidos só pela escrita.
- Pesos int8 de 2 MB, embutidos no pacote; nada é baixado.
- Dezenas de microssegundos por detecção, na thread principal.
- Respostas idênticas em Swift, Kotlin e JavaScript, garantidas por golden vectors compartilhados.
- Informa uma pontuação de confiabilidade e marca todos os empates.
Primeiros passos
Adicione identificação de idioma ao seu app iOS or macOS, Android or web em poucas linhas de código. Docs do Tongue.
// 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")
import Tongue
let tongue = try Tongue()
tongue.detect("kann ich das haben").language
// "de"
Add Tongue from Desert Ant Labs to this Swift project (iOS, macOS). What it does: identificação de idioma no dispositivo. 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.
// build.gradle.kts (Maven Central)
implementation("ai.desertant:tongue:3.1.0")
import ai.desertant.tongue.Tongue
val tongue = Tongue.bundled(context)
tongue.detect("kann ich das haben").language
// "de"
Add Tongue from Desert Ant Labs to this Kotlin project (Android).
What it does: identificação de idioma no dispositivo.
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.
npm i @desert-ant-labs/tongue
import { Tongue } from "@desert-ant-labs/tongue";
const tongue = await Tongue.load();
tongue.detect("kann ich das haben").language;
// "de"
Add Tongue from Desert Ant Labs to this JavaScript / TypeScript project (Web, Node.js). What it does: identificação de idioma no dispositivo. 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.
Especificações
- Idiomas
- 84, em 31 sistemas de escrita
- Tamanho no dispositivo
- Pesos int8 de 2 MB, dentro do pacote
- Velocidade
- Dezenas de microssegundos por detecção
- Modelo
- Roteador de sistemas de escrita mais n-gramas de caracteres com hash para uma cabeça linear int8
Uma ou duas palavras muitas vezes são indecidíveis, e nenhum tamanho de modelo resolve o problema. O Tongue informa um empate ou uma resposta provisória, então trate confiabilidade baixa como “desconhecido”, não como resposta.
O malaio e o indonésio compartilham vocabulário demais para serem separados em uma amostra curta. O mongol é coberto só na escrita tradicional, então o mongol em cirílico é lido como russo.
Nomes de marca, números e código não são idioma, e vão receber um chute.
FAQ
O que é o Tongue?
Identificação de idioma no dispositivo que, a partir de poucas palavras, escolhe entre 84 opções, em dezenas de microssegundos.
O Tongue roda no dispositivo?
Sim. O Tongue roda no dispositivo, sem chamada a servidor, então os dados ficam com o usuário.
Quais plataformas o Tongue suporta?
O Tongue é distribuído como um SDK nativo no dispositivo para Swift, Kotlin, JavaScript / TypeScript.
Quanto custa o Tongue?
Cada modelo é gratuito para até 100 mil dispositivos ativos mensais por SDK. Inferência ilimitada por usuário. Fale conosco para licenças personalizadas.
Qual a precisão e a velocidade do Tongue?
Com 2 MB, o Tongue marca 0,933 em entradas de três palavras do FLORES-200, contra 0,887 de um detector de 293 MB.