offline_translate model bundles

int8 ONNX translation models packaged for the offline_translate Flutter package: neural machine translation that runs entirely on a phone, with no network access of any kind once a model is installed.

Each direction lives in its own directory:

<pair>/manifest.json   metadata, architecture constants, SHA-256 per file
<pair>/encoder.onnx    graph
<pair>/encoder.data    int8 encoder weights (memory-mapped at runtime)
<pair>/decoder.onnx    graph, with a greedy `next_token` output built in
<pair>/decoder.data    int8 decoder weights
<pair>/embedding.data  the tied embedding, shared by both graphs (tiny-ssru)
<pair>/source.spm      upstream SentencePiece model, unmodified
<pair>/vocab.json      upstream shared vocabulary, unmodified (marian only)

Use them with:

final translator = await OfflineTranslator.initialize(
  languages: {Language.en, Language.fr},
  defaultLanguage: Language.fr,
  modelSource: HttpModelSource.official(),
);
await translator.installModel(from: Language.en, to: Language.fr);

final result = translator.translate('Hello, how are you?');
print(result.translatedText); // Bonjour, comment allez-vous ?

Every file is verified against the SHA-256 in its manifest before the model is moved into place, so the transport does not have to be trusted beyond TLS.

Directions

Direction Size Family Vocab Upstream License
en-fr 32.3 MB tiny-ssru 32000 mozilla/firefox-translations-models enfr MPL-2.0

Licensing

These are modified weights: converted to ONNX, dynamically quantised to int8, and extended with a greedy arg-max output node. The conversion pipeline is tool/build_tiny_model.py (and tool/build_model.py for the marian family) in the package repository — that, plus the upstream checkpoint, is the source form.

  • MPL-2.0en-fr. File-level copyleft: applications that merely use these files are unaffected and keep their own licence. Anyone redistributing them must keep them under MPL-2.0 and make the source form available.

Upstream projects:

Mozilla. Firefox Translations models. https://github.com/mozilla/firefox-translations-models — MPL-2.0.

Jörg Tiedemann and Santhosh Thottingal. OPUS-MT — Building open translation services for the World. EAMT 2020, Lisbon, Portugal.

Downloads last month

-

Downloads are not tracked for this model. How to track
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support