Translating an Entire Book: How I Built an LLM-Powered Pipeline
Anthropic
OpenAI
Google/DeepMind
A developer created BookTrans, an open-source pipeline that translates entire books using paid LLM subscriptions, supporting Claude Code, Antigravity CLI, and Codex. The pipeline ensures translation quality through a multi-stage process: reconnaissance, sequential translation, and blind editing, with automated integrity checks and security measures against prompt injection.
The author was motivated by the lack of Russian translations for two science fiction books, 'Usurpation' by Sue Burke and 'Singularity's Ring' by Paul Melko. Building on the idea of helping others, they spent a couple of weeks developing BookTrans, an open-source pipeline that translates books using paid LLM subscriptions. The pipeline supports Claude Code, Antigravity CLI, and Codex, and uses two models per agent: the strongest for intellectual work and the next strongest for technical tasks. Before translation, it performs cheap checks like language detection and encoding, and uses a cheap model to map tags and styles to content types. The translation process has three main stages: reconnaissance (model scans the book to create a glossary and world reference), sequential translation (chapters are translated in order with context from previous chapters), and blind editing (an editor model reviews the translation without seeing the original, focusing on natural Russian). The pipeline also handles poems, recognizes citations, and uses footnotes for errors and obscure terms. It splits chapters into fragments of 2000-3000 words, and each paragraph gets a stable number to check for missing or invented paragraphs. Automated checks verify paragraph integrity, glossary terms, numbers, and structure. Security is a priority: the book text is treated as untrusted data, and the pipeline stops if it finds prompt injection attempts. Agents are run with disabled tools, sandboxes, and limited file system access. Web search is disabled to prevent data leakage. The author also compared Russian and English prompts and found no significant quality difference, so they wrote prompts in Russian.
- Abbreviations
- LLM = Large Language Model — большая языковая модель
- CLI = Command-Line Interface — интерфейс командной строки
- AGY = Antigravity CLI — Antigravity CLI
- MCP = Model Context Protocol — протокол контекста модели
- VPS = Virtual Private Server — виртуальный частный сервер
Source: Habr — хаб ИИ —
original
