Deploy PDFMathTranslate

Translate scientific PDFs with formulas and layout kept; web UI with login

Deploy PDFMathTranslate

Just deployed

/data

Deploy and Host PDFMathTranslate on Railway

PDFMathTranslate (pdf2zh) translates scientific PDFs while keeping the original layout: formulas, charts, tables, the table of contents and annotations stay in place. It writes a translated-only PDF and a side-by-side bilingual PDF. It works with free Bing translation out of the box, or with your own LLM or translation API key.

About Hosting PDFMathTranslate

This template runs the official PDFMathTranslate 1.9.11 image (pinned by digest) with its Gradio web UI, behind a login. The username is admin, and the password is generated at deploy time: open the service's Variables tab and copy WEB_PASSWORD. A Railway volume at /data keeps saved settings, API keys you enter in the UI, the translation cache and recent files, so a redeploy or restart loses nothing. The document-layout model and fonts are baked into the image, so nothing is downloaded at runtime. Translation runs on CPU, since Railway has no GPU. Give the service 1 GB of RAM (Hobby plan or higher): it starts and serves the UI in 0.5 GB, but layout detection during a translation needs more.

Common Use Cases

  • Read English research papers in Chinese, Japanese, German, French and more, with the math intact
  • Share bilingual PDFs of papers and technical documents with a team
  • Translate PDFs with your own OpenAI, DeepSeek, Gemini, Ollama or other LLM key for better quality

Dependencies for PDFMathTranslate Hosting

  • PDFMathTranslate 1.9.11 (official byaidu/pdf2zh image, built from our GitHub repo)
  • A Railway volume for settings, cache and files

Deployment Dependencies

Implementation Details

One service, pdfmathtranslate, serves the web UI on Railway's public domain. After deploy:

  1. Open the public URL and sign in as admin with the WEB_PASSWORD value from the Variables tab.
  2. Upload a PDF, pick the languages and press Translate. The Service list starts on Bing, which needs no key. Google is also listed, but its free endpoint often answers 429 to cloud servers such as Railway, and the translation then stalls; use Bing or an API key instead.
  3. To use an LLM, pick it in the Service list and enter its API key in the UI (it is saved on the volume), or set it as a service variable, for example OPENAI_API_KEY, OPENAI_BASE_URL and OPENAI_MODEL for any OpenAI-compatible API.

Variables: WEB_PASSWORD (generated login password), WEB_USERNAME (default admin), PDF2ZH_DEFAULT_SERVICE (service preselected in the UI, default Bing), PDF2ZH_KEEP_DAYS (days to keep uploaded and translated files, default 7). Change the password by editing WEB_PASSWORD and redeploying.

RAM: tested on Railway, a 3-page arXiv paper took 91 s and peaked at about 650 MB with a 1 GB limit. With a 0.5 GB limit (Free plan) the UI runs, but translations, even of one page, can be stopped for lack of memory; the service then exits non-zero and Railway restarts it within seconds. So use 1 GB to translate. Updates: when we bump the version in the template's GitHub repo, Railway shows an update notice in your project; read the repo's CHANGELOG.md, then apply it.

Why Deploy PDFMathTranslate on Railway?

Railway is a singular platform to deploy your infrastructure stack. Railway will host your infrastructure so you don't have to deal with configuration, while allowing you to vertically and horizontally scale it.

By deploying PDFMathTranslate on Railway, you are one step closer to supporting a complete full-stack application with minimal burden. Host your servers, databases, AI agents, and more on Railway.


Template Content

More templates in this category

View Template
Chat Chat
Chat Chat, your own unified chat and search to AI platform.

okisdev
117
View Template
Weaviate
Vector database with hybrid search and an API key-protected API

GitHub Locker
1
View Template
Möbius Personal AI OS
Self-hosted AI agent that builds and runs apps for you, with memory.

Tracklayer
1