Detect the language of any text, entirely offline.

Linguae trains a character-level CNN from scratch with Candle and ships a standalone Rust binary. Your text never leaves your machine — no cloud APIs, no pretrained weights, no network calls.

235k+
training examples
200+
languages
0
network calls
Detect a language
$ linguae "Bonjour tout le monde"
fra
$ linguae --format json "Это тест"
{
  "language": "rus",
  "confidence": 0.98
}

Built for privacy and simplicity

A single static binary that does one thing well — identify languages — without phoning home.

Runs fully offline

Inference happens in-process inside the Rust binary. No sockets, no telemetry, no accounts — safe for air-gapped machines.

Trained from scratch

A character-level CNN trained with Candle on Tatoeba, WiLI-2018, and a curated word dataset. No pretrained weights to trust or audit.

Fast and small

Character-level encoding keeps the model compact. Detection of a sentence completes in milliseconds on CPU.

Flexible input

Pass text as an argument, a file with --file, or pipe it through stdin — it composes with standard Unix tools.

Confidence and JSON

--confidence prints per-language scores and --format json emits structured output for scripts.

Batch processing

Detect languages across whole files or streams line by line — built for corpus-scale workloads.

See it in action

Real output from the CLI — no mockups.

French
$ linguae "Bonjour tout le monde, comment allez-vous ?"
fra
JSON output
$ linguae --format json "Это тестовый пример текста"
{
  "language": "rus",
  "confidence": 0.98
}
Batch from file
$ linguae --file texts.txt
fra
eng
rus
deu

How it works

From raw text to a language code in three steps.

01

Normalize

Text is lowercased, stripped of diacritics variation, and mapped onto a fixed character vocabulary.

"Bonjour" → char indices
02

Encode

Characters become indices fed into a CharCNN — small kernels capture local n-gram patterns, global pooling summarizes the text.

CharCNN · Candle
03

Classify

The model emits a probability per language; the CLI prints the top ISO 639-3 code, or scores with --confidence.

fra 0.98 → "fra"

Install and run

Requires Rust 1.85+. No Python runtime needed for the CLI.

Build from source
$ git clone https://github.com/hieudoanm/linguae
$ cd linguae
$ cargo build --release -p linguae
$ ./target/release/linguae "Bonjour tout le monde"
fra

See the README for dataset and server details.