v0.1.7 — 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.

🔒

Format Preservation

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

✏️

Postedits

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

🧑‍💻

Ease of use

Integrates easily into any workflow and allows to collaborate with anyone.

📖

Terminology preservation

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

🗂️

Project Management

Initialize and manage translation projects with a .lesia 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.

🔄

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 ILaaS; no API key required for Paris-Saclay members if running your translations from MyDocker.

🧪

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
🇫🇷
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
🌐 Add your own
Ecosystem

Projects that use lesia

Open-source projects and tools that actively use lesia in their workflow.

📚

Linear Algebra Lecture Notes

Linear Algebra Lecture Notes in English, French and Ukrainian.

📚

Topology Lecture Notes

Topology Lecture Notes in English, French and Ukrainian.

📚

Statistics Lecture Notes

Statistics Lecture Notes in English, French and Ukrainian.

Cite Lesia

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

@software{korotenko_lesia_2026,
    author = {Korotenko, Yehor},
    title = {lesia},
    month = {jun},
    year = {2026},
    publisher = {Zenodo},
    version = {v0.1.7},
    doi = {10.5281/zenodo.20610935},
    url = {https://doi.org/10.5281/zenodo.20610935}
}