Mineru Pdf Translate logo

Mineru Pdf Translate

Community
flycalm
mineru-pdf-translate

Translate local PDF papers through MinerU and an OpenAI-compatible model into final PDFs. Correct OCR using source PDF crops during translation, preserve figures, and validate formula and image rendering.

Overview

Publisherflycalm
Repositorymineru-pdf-translate
Skill namemineru-pdf-translate
Stars
99
Forks
3
Bundled files
4
LicenseMIT
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • 4 bundled files

    Scripts, templates, and references the model can read while it works. Files are read-only and never executed.

  • Open source

    Published by flycalm on GitHub. Read the source before you install it.

Installation

Install the Mineru Pdf Translate AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/flycalm/mineru-pdf-translate/tree/main/mineru-pdf-translate
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/flycalm/mineru-pdf-translate.git /tmp/mineru-pdf-translate
mkdir -p .claude/skills
cp -r /tmp/mineru-pdf-translate/mineru-pdf-translate .claude/skills/mineru-pdf-translate
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Mineru Pdf Translate in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Mineru Pdf Translate on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Mineru Pdf Translate is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

MinerU PDF Translate

Run scripts/pdf_translate.py on the folder containing the source PDFs. Translate the entire document, including appendices and captions. Deliver the final PDFs in translated/; keep intermediate files out of that folder. Do not produce a separate inspection report unless requested.

Translation and correction

The default --ocr-correction auto supplies the translation model with original PDF crops and MinerU's OCR strings for formulas and tables. Corrections are returned separately from the translated prose, so the model cannot accidentally remove or reorder protected units.

  • Correct transcription errors against the source, including empty-set symbols, norm bars, signs, accents, indices, equation numbering and table cell alignment. Preserve the author's mathematics, data and claims.
  • Correct obvious OCR errors in prose using context. A word mistakenly detected as inline math can return to ordinary translated text.
  • Use source images for units the model cannot read confidently, for invalid corrections, and for models that reject image input. Translate surrounding prose and captions normally. Internal labels in source images remain in the original language.
  • Preserve formula numbering. A MathJax syntax error in a corrected formula triggers a source-image fallback during rendering.
  • Source comparison needs MinerU layout.json and Python PyMuPDF. If unavailable, explain the limitation; use --ocr-correction off only when the user accepts translation without automatic source comparison.
  • Custom ocr_repairs.json remains available for exact, source-verified prose repairs. Do not add paper-specific symbols, file names or inferred formulas to the built-in rules.

The correction process is conservative but cannot guarantee semantic correctness. Inspect representative complex equations, tables and the appendix ending against the original before delivery. Internal validation runs without creating a separate report.

Configuration

Read configuration privately; never display credentials or signed storage URLs. Prefer explicit command options, then files in the PDF folder, then environment variables.

Supported files:

  • mineru密钥.txt: MinerU token.
  • 翻译大模型url以及key.txt: base URL and API key on two lines.
  • 大模型和mineru的key.txt: labelled model:, url:, key: and mineru: fields. A value may occupy the next line. Do not duplicate these keys into the skill folder.

Environment alternatives: MINERU_API_TOKEN, PDF_TRANSLATE_LLM_BASE_URL, PDF_TRANSLATE_LLM_API_KEY, PDF_TRANSLATE_MODEL. Choose a model accepting image input for automatic OCR correction. The script uses the model supplied in configuration; the legacy default applies only when no model is specified.

The renderer needs Node.js, Playwright and an installed Edge/Chrome/Chromium browser. It discovers the Codex bundled Node/Playwright runtime when available. Outside Codex, use an installed Node playwright package or set PDF_TRANSLATE_NODE_MODULES to its node_modules folder. Override the executables with PDF_TRANSLATE_NODE, PDF_TRANSLATE_BROWSER or --browser-path. The Python markdown package is installed automatically if missing; PyMuPDF is needed for source crops.

Commands

Resolve <skill-dir> to this skill's directory. On Windows, use py if python resolves to a nonworking Store alias.

Translate and retain caches for inspection or rerendering:

powershell
python <skill-dir>\scripts\pdf_translate.py --workdir <pdf-folder> --keep-temp

Re-render cached translations without MinerU or model calls:

powershell
python <skill-dir>\scripts\pdf_translate.py --workdir <pdf-folder> --render-only --keep-temp

Other options:

  • --workers 3: maximum simultaneous translation requests. Lower this for a rate-limited endpoint.
  • --target-language "Japanese" --target-suffix ja: choose another target.
  • --force: discard document caches and rebuild. Do not use this merely to retry interrupted chunks or fix rendering.
  • --ocr-correction off: protect extracted formulas without source comparison; use only for an explicitly accepted legacy workflow.

Reliability and rendering

  • Failed or interrupted runs retain their caches. MinerU task IDs survive upload, polling and download failures; resume an existing task rather than paying for another parse. Successful translation chunks are written atomically and reused only for matching source, model, endpoint, language and correction mode.
  • Preserve source whitespace at chunk boundaries. Never concatenate stripped chunks in a way that joins headings to paragraphs or words together. Limit image evidence per request without changing source order.
  • Embed local images into the render HTML and use short temporary rendering paths to avoid Windows path-loading failures. Group multi-panel figures only when the layout identifies one figure and the image references are contiguous; do not swallow captions or intervening text.
  • Wait for fonts, images and MathJax startup to finish. Missing images, remaining placeholder tokens and unresolved formula errors fail rendering. Print without browser headers or footers. Replace a previous output only after a valid new PDF exists.
  • Disable MathJax's noundefined extension so unknown commands raise detectable errors rather than printing macro names (see MathJax v3 documentation).
  • MathJax v3 is loaded from the existing CDN; if unavailable, report the render failure and retain caches. Do not treat file existence alone as proof that equations rendered.
  • MinerU uploads directly to its own storage by default. Connection errors use bounded retries and can try its OSS acceleration hostname. PDF_TRANSLATE_UPLOAD_HOST overrides the alternate hostname. Optional PDF_TRANSLATE_DOWNLOAD_RESOLVE=host:443:ip uses curl's route override with normal TLS verification; do not change system DNS or disable certificate verification.
  • --keep-temp retains MinerU output, source crops and per-chunk translation caches in .pdf_translate_tmp/. No QA report is written. Failed-file diagnostics stay in the temporary folder.

If the user also requests Zotero import, use an available Zotero tool, deduplicate by reliable metadata, attach the original and final translation to the same parent item, and verify the stored attachments. PDF translation alone does not request a Zotero mutation.

Resources

  • scripts/pdf_translate.py: batch parsing, translation, resumable caching and rendering.
  • scripts/source_evidence.py: source-coordinate crops, formula/table pairing and correction validation.
  • scripts/render_pdf.cjs: browser completion waits and source fallback for invalid math.

Bundled files

The model reads these on demand while the skill is loaded. They are exposed as readable files and are never executed.

Frequently asked questions

What does the Mineru Pdf Translate AI skill do?

Translate local PDF papers through MinerU and an OpenAI-compatible model into final PDFs. Correct OCR using source PDF crops during translation, preserve figures, and validate formula and image rendering.

Why use Mineru Pdf Translate on TypingMind?

Because you install it once and use it with any model. Mineru Pdf Translate is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Mineru Pdf Translate in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/flycalm/mineru-pdf-translate/tree/main/mineru-pdf-translate. TypingMind reads its SKILL.md and bundles its files and installs it as a skill you can enable per chat.

Which AI models can use Mineru Pdf Translate?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Mineru Pdf Translate?

As many as you like. As long as a model supports skills, you can use Mineru Pdf Translate with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Mineru Pdf Translate AI skill free?

Yes. It is published on GitHub by flycalm under the MIT license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇