talira

Argos Translate

Open-source offline translation library written in Python

open sourceMIT OR CC0-1.0self-hostablefree

Argos Translate is an open source Python library for machine translation that runs offline: it translates with OpenNMT models through CTranslate2, on the CPU by default or a CUDA GPU. You install language model packages (.argosmodel zip files, from the argospm package index or by BitTorrent) for each translation direction, covering Arabic, Chinese, English, French, German, Japanese, Russian, Spanish and dozens more, and when no direct model is installed it pivots through an intermediate language, such as Spanish to English to French. It works as a Python library, through the argos-translate and argospm commands, or with a separate desktop GUI, and companion libraries translate HTML and whole files. LibreTranslate, the self-hosted translation API and web app, is built on it. It's licensed MIT or CC0 and made by P.J. Finlay's Argos Open Technologies, which also sells custom model training.

Problems it solves

  • translate text in my Python script without calling Google or DeepL
  • machine translation that works with no internet connection on a laptop in the field
  • an offline translation library I can bundle in a desktop app
  • translate between two languages that have no direct model by going through English
  • batch translate a CSV of product descriptions locally for free
  • run neural machine translation on our own GPU from Python
  • translate from the command line in a shell pipeline
  • translate documents on an air-gapped machine where cloud APIs are banned
  • a permissively licensed translation engine I can embed in commercial software
  • train or get a custom translation model for a language pair we need
  • download pretrained translation models for dozens of languages with one command
  • translate HTML pages while keeping the tags intact, offline

Features

  • offline neural machine translation with OpenNMT models via CTranslate2
  • Python API: install packages and translate text
  • argos-translate and argospm command-line tools
  • language model packages (.argosmodel) from the argospm index, BitTorrent or Google Drive
  • automatic pivoting through intermediate languages when no direct model is installed
  • models for Arabic, Chinese, Dutch, English, French, German, Hindi, Japanese, Korean, Persian, Polish, Portuguese, Russian, Spanish, Turkish, Ukrainian, Urdu and more
  • CUDA GPU acceleration with ARGOS_DEVICE_TYPE
  • desktop GUI (argostranslategui, separate repository)
  • HTML translation (translate-html) and file translation (argos-translate-files) companion libraries
  • training scripts for new models (argos-train)

Limitations

  • No direct translation between languages without an installed model pair: it pivots through an intermediate language, at some loss of quality1

Capabilities

Has a command line toolplan not known

Alternatives

The same job

These do what Argos Translate does.

  1. DeepL Translator Translate at the speed of modern business
  2. Google Cloud Translation Google's machine translation API: neural, LLM and adaptive translation
  3. DeepL API Machine translation API for text, documents and live speech
  4. LibreTranslate Free and Open Source Machine Translation API, entirely self-hosted

Compare Argos Translate with the top 3