← All models

translation · text · WASM · ~900 MB

NLLB-200 — translate 200 languages, no language left behind

Meta's No Language Left Behind covers 200 languages — direct, many-to-many, with no English pivot — and reaches deep into low-resource languages that other models skip: Zulu, Yoruba, Chhattisgarhi, Dzongkha, Tamasheq. Search a source and target, type, and watch it translate on-device. NLLB steers the output language with a single forced target-language token, which you can see below.

At a glance

ModelXenova/nllb-200-distilled-600M (ONNX build of facebook/nllb-200-distilled-600M)
Task / pipelinetranslation (sequence-to-sequence)
ArchitectureM2M100-class multilingual encoder–decoder, 600M params, distilled from the 54B NLLB-200 mixture-of-experts teacher
Languages200 (FLORES-200 codes like eng_Latn, zul_Latn), translated directly — target chosen via a forced BOS token
Quantizationq8 (8-bit) ONNX
BackendWebAssembly (runs anywhere; no WebGPU needed)
Download~900 MB (encoder ~419 MB + merged decoder ~475 MB), cached after first load
LicenseCC-BY-NC-4.0 (non-commercial — research/demo use)
Web APIsWebAssembly, Web Workers, <datalist> — all Baseline widely available

Run it

Search the source and target language (type any of 200 names), enter text, and translate. Greedy decoding streams the output live and records real timing. Try the low-resource presets — pairs a 100-language model can't reach.

Translation

See inside — FLORES-200 codes, forced BOS token & tokens

NLLB is a sequence-to-sequence translator: it encodes the source, then decodes the target one token at a time. What selects the output language is a single trick — the decoder is forced to begin with the target language's special token (forced_bos_token_id). Change the target and only that first token changes; the same input then decodes into a different language. Below are the exact FLORES-200 codes, the real numeric BOS token id NLLB used, and the token counts each side.

src → tgt
–
Forced BOS
–
Tokens in
–
Tokens out
–
Speed
–

Why it matters

Most translation stops at the ~100 highest-resource languages. NLLB-200 doubles that reach — and its whole point is the long tail: languages spoken by hundreds of millions of people that commercial APIs under-serve or omit. Running it on-device means that reach is private, offline, and free of per-call fees.

Use cases

Basics

Translate a phrase, then swap the target across 200 languages to feel the many-to-many model.

Practical

Low-resource pairs + a round-trip fidelity check to spot where a translation drifts.

Wild

Relay translation: chain A→B→C through the model and watch meaning travel across scripts.

Multi-model

Translate any of 200 languages into English, then have Kokoro read the result aloud.

How the API works

Translation is one pipeline call; the FLORES-200 language pair is set per call:

import { pipeline } from "@huggingface/transformers";

const translator = await pipeline(
  "translation",
  "Xenova/nllb-200-distilled-600M",
); // downloads + caches ~900 MB once

const out = await translator("Hello, how are you today?", {
  src_lang: "eng_Latn",   // FLORES-200 code: ISO 639-3 + ISO 15924 script
  tgt_lang: "zul_Latn",   // Zulu (Latin script)
});
// → [{ translation_text: "Sawubona, unjani namuhla?" }]

// Under the hood, tgt_lang selects a forced BOS token id that the decoder
// must emit first — that single token is what picks the output language.

The 200 FLORES-200 codes are three-letter ISO 639-3 language plus a four-letter script tag (zul_Latn, zho_Hans, kas_Deva) — so the same language in two scripts is two codes. This page streams tokens via a TextStreamer inside a Web Worker, so decoding never blocks the interface.

References