Skip to content

created: 2026-04-24 updated: 2026-04-24 tags: [source, github, machine-translation, python, flask] type: source url: https://github.com/LibreTranslate/LibreTranslate author: "Libretranslate Org" (230 contributors) published: ~2020-ongoing


LibreTranslate GitHub Repository

Summary

LibreTranslate is a free, open-source, self-hosted Machine Translation API that doesn't rely on proprietary services. Powered by Argos Translate, it's offline-capable and easy to set up.

Key Takeaways

Project Stats

  • Stars: 14,152 | Forks: 1,445 | Contributors: 230
  • Primary language: Python (74.4%), HTML (10.9%), Dockerfile (5.7%)
  • License: AGPL-3.0
  • Topics: api, machine-translation, translation, self-hosted
  • Created: 2020-12-19
  • Latest release: v1.9.5 (2026-03-03)
  • Releases: 52

Architecture

Flask-based client-server architecture:

Component Technology Purpose
API Server Flask HTTP request handling, routing, middleware
Translation Engine Argos Translate Neural machine translation between language pairs
Language Detection lexilang + langdetect Dual-library detection for better accuracy
File Translation argostranslatefiles Format-aware file translation
Web UI Vue.js Intuitive translation interface
Rate Limiting In-memory or Redis API abuse prevention
Authentication API key (SQLite or remote) Access control
Metrics Prometheus Request counts, durations, status codes

Request Processing Flow

  1. HTTP request arrives at Flask server
  2. API key validation and rate limiting
  3. Language detection (if "auto" specified)
  4. Translation via Argos Translate engine
  5. Response formatting and return

Key Design Decisions

  • No proprietary dependencies — Unlike Google/Azure APIs, entirely self-hosted
  • Offline-capable — Language models downloaded at build or first run
  • Stateless design — Supports horizontal scaling with shared rate limiting
  • Modular configuration — CLI args or environment variables for all settings

Language Detection

  • Short text (<20 chars): primarily uses lexilang
  • Longer text: uses langdetect
  • Results ranked by confidence scores

Deployment Options

  • Python — Hatch-based virtual environment with pre-commit hooks
  • Docker — Single container, optional with_models=true build arg for offline
  • Kubernetes — Multi-node with shared storage for rate limiting
  • Multi-node — Primary/secondary node designation, stateless scaling

Storage

  • Language models: disk in user's home directory (~/.local/share)
  • API keys: SQLite database or remote server
  • Rate limiting: in-memory or Redis
  • Temporary files: system temp directory

API Bindings

Available for Python, JavaScript, Go, Rust, Java, PHP, and more.

Extension Points

  • New translation models via Locomotive or Argos Train
  • Custom language bindings
  • Various deployment configurations