Skip to content

DocTranslater

High-quality PDF translation with layout preservation, multi-provider LLM routing, and local OpenAI-compatible backends.

This documentation site tracks the miguelenes/doctranslate fork. Upstream lineage: funstory-ai/DocTranslate (AGPL-3.0).


Quick start

git clone https://github.com/miguelenes/doctranslate.git
cd doctranslate
uv sync --locked --group dev --extra full
uv run doctranslate --help

Translate with OpenAI-compatible API:

export OPENAI_API_KEY=sk-...
uv run doctranslate translate input.pdf --provider openai \
  --source-lang en --target-lang zh -o ./out

Local (Ollama): see Local translation.


Explore the docs

Topic Description
Stable library API Python embedding, TranslationRequest, JSON CLI
HTTP API Optional container service (serve, OpenAPI)
Configuration CLI flags, TOML [doctranslate], env vars, cache
Docker Container images, volumes, warm vs slim builds
Serverless containers Cloud Run, Fargate, App Runner, Modal, Runpod deployment patterns
Troubleshooting Common install and runtime failures
Benchmarks How to measure performance (no CI SLAs)
Multi-provider routing Router profiles, failover, metrics
Local translation Ollama, vLLM, OpenAI-compatible servers
Supported languages Language codes and coverage
Implementation details PDF → IL → PDF pipeline stages

Highlights

  • Router — OpenAI, Anthropic, OpenRouter, Ollama, and OpenAI-compatible gateways with strategies (failover, round_robin, least_loaded, cost_aware).
  • Local mode — Same router core with a synthetic single-host profile for desktop and LAN servers.
  • IL pipeline — Structured intermediate representation for parsing, layout, translation, typesetting, and PDF creation.

Contributing

See Contributing and the Code of Conduct. Issues and PRs for this fork: github.com/miguelenes/doctranslate.


License

DocTranslater is licensed under AGPL-3.0. See the repository LICENSE file.