TranslateBooksWithLLMs Hits 1,900 Stars Solving What No Book Translator Could
TranslateBooksWithLLMs is a free, open-source tool that translates full EPUB books, subtitles, and documents using any LLM — locally or via cloud API — while preserving formatting and resuming interrupted jobs.
Takeaways
- What it is: TranslateBooksWithLLMs is a free, open-source tool to translate full books (EPUB, DOCX, SRT, TXT) using any LLM, locally or via cloud API.
- Key features: Preserves EPUB formatting, resumes interrupted jobs via checkpoints, and has no file size limits.
- Glossary system: Injects mandatory term translations into the LLM prompt per-chunk to keep character names and proper nouns consistent across hundreds of pages.
- Provider support: Works with Ollama (free/local), OpenAI, Gemini, Mistral, DeepSeek, OpenRouter (200+ models), and any OpenAI-compatible server like LM Studio or vLLM.
- Benchmarks: Quality tested across 23 languages; top models (claude-haiku-4.5, gemini-3.1-flash-lite) score ~8/10; best free local model is gemma4:31b.
- Cost: Free with Ollama; cloud APIs cost roughly $1-2 per full-length book using flash-tier models.
TranslateBooksWithLLMs (TBL) is an open-source Python tool that does exactly what it says: feed it an EPUB, DOCX, SRT, or TXT file, point it at an LLM, and get back a fully translated document with all formatting intact. It has crossed 1,900 GitHub stars and 250 forks, driven largely by users who want something better than copy-pasting chapters into a chat window.
The problem no one had cleanly solved
Translating a book with an LLM sounds simple until you try it. LLMs have context window limits, so the text has to be split into manageable chunks, and EPUBs contain HTML/XML markup that needs careful handling to preserve structure and readability. On top of that, a model translating chunk-by-chunk has no memory between segments, so character names drift, proper nouns get re-transliterated differently in chapter 5 vs. chapter 20, and a crash halfway through means starting over. TBL is built around solving all three of these at once.
How it actually works
It simplifies the process by handling EPUB unpacking, text chunking, and interaction with LLM APIs. The chunking is token-based (default: 450 tokens per chunk), so the model always gets a well-sized window. Critically, it resumes where you left off and has no file size limits , a checkpoint system saves progress after every chunk, so a network dropout or machine restart doesn't cost you hours of work.
The glossary system is where TBL gets genuinely clever. LLMs translate one chunk at a time with no memory between them, which causes character names to drift across a long novel. TBL's glossary injects a mandatory translation block directly into the LLM's system prompt, but only for chunks where a term actually appears , so it costs no extra tokens elsewhere. The result is consistent naming across hundreds of pages.