llmtranslate

llmtranslate

llmtranslate is a lightweight Python library that leverages LangChain’s ChatModels (like OpenAI’s GPT‑4o and others) to perform language detection and full-text translation. It offers both synchronous and asynchronous interfaces, enabling developers to easily integrate multilingual translation functionality into Python applications or workflows. Installable via pip, it supports a wide range of languages and provides chunking and concurrency controls for handling large or multilingual texts.

Key Features

  • Detects input language with ISO‑639 codes and language name
  • Translates text to a specified target language
  • Supports multilingual inputs in a single document
  • Provides both synchronous (Translator) and asynchronous (AsyncTranslator) APIs
  • Controls chunk size (max_translation_chunk_length, max_translation_chunk_length_multilang)
  • Manages concurrency (max_concurrent_llm_calls, optional time-based limits)
  • Integrates seamlessly with LangChain ChatModels (OpenAI, Anthropic, Mistral, etc.)
  • Requires minimal setup: install LangChain model packages and llmtranslate
  • MIT‑licensed with stable releases (e.g., 0.7.20)