v0.1.5 — Early Beta

Translate scientific
documents with AI

Lesia is an open-source Python library and CLI that automates the translation of LaTeX, Markdown, Typst, MyST, and Jupyter documents — preserving structure, formatting, and syntax while you stay in control.

Get started View on GitHub
# Install the CLI
$ uv tool install lesia
# Initialize a new project
$ lesia init my-project
$ cd my-project
βœ“ Project "my-project" initialized
# Set source/target languages and translate
$ mkdir src tgt
$ lesia set-source src french
$ lesia set-target tgt english
$ lesia translate src/main.tex english
βœ“ Translation complete β†’ docs/en/main.tex
Features

Everything you need for
document translation

Built for researchers, scientists, and technical writers who need accurate, structure-preserving translations at scale.

πŸ—‚οΈ

Project Management

Initialize and manage translation projects with a .translate_dir config file. Track source and target directories per language.

⚑

Smart Translation Cache

Persistent on-disk cache with checksum-based deduplication. Never pay for the same translation twice β€” only changed chunks are re-translated.

πŸ”’

Format Preservation

XML-tagging system protects LaTeX commands, Typst syntax, Markdown fences, and code blocks from being altered during translation.

✏️

Manual Corrections

Cache-aware correction system lets you override specific translations. Your corrections survive subsequent retranslations.

πŸ“–

Custom Vocabulary

Define domain-specific glossaries to ensure consistent translation of technical terms across your entire project.

πŸ”„

File Syncing

Automatically sync non-translatable assets (images, bibliography, fonts) between language directories. Only text changes where it should.

πŸ€–

Multiple LLM Backends

Switch between Google Gemini, OpenAI, Anthropic, xAI, and others. Use a secondary reasoning model for complex passages.

πŸ‡«πŸ‡·

French University Support

Free access to open-source models via MyDocker (UniversitΓ© Paris-Saclay) and iLaaS β€” no API key required for Paris-Saclay members.

πŸ§ͺ

Python Library API

Embed Lesia into your own scripts and pipelines. Full async support for concurrent translation of multiple files.

Supported Formats

Works with your documents

From academic papers to data science notebooks, Lesia handles the most popular scientific markup languages.

LaTeX
Markdown
Jupyter Notebooks
MyST
Typst
How it works

Translation in 5 steps

Lesia breaks the complex translation problem into a reliable, repeatable pipeline.

1

Chunk Documents

Documents are split into translatable chunks while preserving document hierarchy.

2

XML Tag Syntax

Commands, code blocks, and special syntax are wrapped in XML tags to protect them from modification.

3

LLM Translation

Each chunk is sent to your configured LLM service with carefully crafted prompts.

4

Cache Storage

Translations are stored with checksums. Identical chunks across files share the same cached result.

5

Reconstruct

Translated chunks are reassembled into complete, valid target documents ready to compile.

LLM Providers

Your choice of AI model

Lesia supports major commercial providers as well as self-hosted and institutional deployments.

β™Š
Google Gemini
Default
πŸ€–
OpenAI
Supported
πŸ”¬
Anthropic
Supported
βœ–οΈ
xAI (Grok)
Supported
πŸ›οΈ
Aristote
Supported
πŸ‡«πŸ‡·
iLaaS
Supported
🐳
MyDocker
Paris-Saclay
Installation

Get up and running

Install as a standalone CLI tool or embed the library in your own Python project.

bash
# Requires uv (https://docs.astral.sh/uv/)
uv tool install lesia

# Verify installation
lesia --help
bash
# pip
pip install lesia

# uv
uv add lesia
bash
git clone https://github.com/DobbiKov/lesia
cd lesia
uv sync

# Run tests
uv run pytest
python
import asyncio
from trans_lib.project_manager import init_project
from trans_lib.enums import Language

# Initialize project
project = init_project("my_project", "/path/to/root")

# Configure source
project.set_source_directory("docs_fr", Language.FRENCH)
project.add_target_language(Language.ENGLISH)
project.set_file_translatability("docs_fr/main.tex", True)

# Sync static assets and translate
project.sync_untranslatable_files()
asyncio.run(project.translate_single_file(
    "docs_fr/main.tex", Language.ENGLISH, None
))
Languages

Supported languages

Translate between any combination of the supported natural languages.

πŸ‡¬πŸ‡§ English
πŸ‡«πŸ‡· French
πŸ‡©πŸ‡ͺ German
πŸ‡ͺπŸ‡Έ Spanish
πŸ‡ΊπŸ‡¦ Ukrainian
πŸ‡¦πŸ‡² Armenian

Cite Lesia

Using Lesia in your research? Please cite it as follows.

@software{korotenko-sci-trans-git,
    author = {Yehor Korotenko},
    title = {sci-trans-git},
    year = {2025},
    publisher = {GitHub},
    version = {0.2.0-alpha},
    url = {https://github.com/DobbiKov/sci-trans-git},
    doi = {10.5281/zenodo.15775111}
}