Transforms complex documents like PDFs and Office docs into LLM-ready markdown/JSON for your Agentic workflows.
Python ai4sciencedocument-analysisdocxextract-datalayout-analysisocrparserpdfpdf-converterpdf-extractor-llmpdf-extractor-pretrainpdf-extractor-ragpdf-parserpptxpythonxlsx
feat: add --enable-vlm-preload option to CLI for VLM model preloading during startup
myhlolice3575ec8bb5
diff --git a/docs/en/usage/cli_tools.md b/docs/en/usage/cli_tools.mdindex 351657ac..e0b6c04c 100644--- a/docs/en/usage/cli_tools.md+++ b/docs/en/usage/cli_tools.md@@ -34,6 +34,8 @@ Options:--host TEXT Server host (default: 127.0.0.1)--port INTEGER Server port (default: 8000)--reload Enable auto-reload (development mode)+ --enable-vlm-preload BOOLEAN+ Preload the local VLM model during mineru-api startup.--help Show this message and exit.``````bash@@ -55,6 +57,8 @@ Options:--server-port INTEGER Set the server port for the Gradio app.--api-url TEXT MinerU FastAPI base URL. If omitted, gradiostarts a reusable local mineru-api service.+ --enable-vlm-preload BOOLEAN Preload the local VLM model when gradio+ starts a local mineru-api service.--latex-delimiters-type [a|b|all]Set the type of LaTeX delimiters to use inMarkdown rendering: 'a' for type '$', 'b' for@@ -73,6 +77,9 @@ Options:--local-gpus TEXT Local GPU workers to launch: auto, none, or CSV suchas 0,1,2--worker-host TEXT Host for router-managed workers (default: 127.0.0.1)+ --enable-vlm-preload BOOLEAN+ Preload the local VLM model in router-managed+ mineru-api workers.--help Show this message and exit.```@@ -134,6 +141,11 @@ Here are the environment variables and their descriptions:* Used to configure the root output directory for `mineru-api`.* Default is `./output` under the current working directory.+- `MINERU_LOCAL_API_STARTUP_TIMEOUT_SECONDS`:+ * Used to control how long CLI tools wait for a locally started `mineru-api` to become healthy.+ * Default is `300` seconds.+ * Applies to temporary local API startup in `mineru`, preload startup in `mineru-gradio`, and router-managed local workers.+- `MINERU_API_TASK_RETENTION_SECONDS`:* Used to set how long completed or failed tasks are retained, in seconds.* Default is `86400` seconds (24 hours).diff --git a/docs/en/usage/quick_usage.md b/docs/en/usage/quick_usage.mdindex ac8ba996..08f276fe 100644--- a/docs/en/usage/quick_usage.md+++ b/docs/en/usage/quick_usage.md@@ -48,6 +48,7 @@ If you need to adjust parsing options through custom parameters, you can also ch>Tasks are tracked only in-process for a single `mineru-api` instance. Task status is not preserved across service restarts, `--reload`, or multi-process deployments.>Completed or failed tasks are retained for 24 hours by default, then their task state and output directory are cleaned automatically. After cleanup, task status and result endpoints return `404`.>Use `MINERU_API_TASK_RETENTION_SECONDS` and `MINERU_API_TASK_CLEANUP_INTERVAL_SECONDS` to adjust retention and cleanup polling intervals.+ >Use `--enable-vlm-preload true` to warm up the local VLM model during service startup instead of waiting for the first VLM or hybrid request.>>Asynchronous task submission example:>```bash@@ -82,6 +83,7 @@ If you need to adjust parsing options through custom parameters, you can also ch>>- Access `http://127.0.0.1:7860` in your browser to use the Gradio WebUI.>- Without `--api-url`, Gradio starts a reusable local `mineru-api`; with `--api-url`, it reuses an existing local or remote service.+ >- `--enable-vlm-preload true` makes Gradio start its local `mineru-api` during WebUI startup and wait for VLM preload to finish. It is ignored when `--api-url` points to an existing service.>- The WebUI currently accepts `PDF`, image, and `DOCX` uploads.- Use `mineru-router` for multi-service / multi-GPU orchestration:@@ -92,6 +94,7 @@ If you need to adjust parsing options through custom parameters, you can also ch>>- `mineru-router` exposes the same `/health`, `/tasks`, `/file_parse`, `/tasks/{task_id}`, and `/tasks/{task_id}/result` interface set as `mineru-api`.>- Repeat `--upstream-url` to aggregate multiple existing `mineru-api` services, or use `--local-gpus` to launch local workers automatically.+ >- `--enable-vlm-preload true` only applies to router-managed local workers. It does not preload remote services passed through `--upstream-url`.>- It is intended for advanced multi-service, multi-GPU, and unified-entry deployments.- Using `http-client/server` method:diff --git a/docs/zh/usage/cli_tools.md b/docs/zh/usage/cli_tools.mdindex 2d478cbf..46b04617 100644--- a/docs/zh/usage/cli_tools.md+++ b/docs/zh/usage/cli_tools.md@@ -34,6 +34,8 @@ Options:--host TEXT 服务器主机地址(默认:127.0.0.1)--port INTEGER 服务器端口(默认:8000)--reload 启用自动重载(开发模式)+ --enable-vlm-preload BOOLEAN+ 在 mineru-api 启动阶段预加载本地 VLM 模型--help 显示此帮助信息并退出``````bash@@ -50,6 +52,8 @@ Options:--server-port INTEGER 设置 Gradio 应用程序的服务器端口--api-url TEXT MinerU FastAPI 服务地址;不传时自动拉起可复用的本地mineru-api+ --enable-vlm-preload BOOLEAN 在 Gradio 拉起本地 mineru-api 时预加载本地+ VLM 模型--latex-delimiters-type [a|b|all]设置在 Markdown 渲染中使用的 LaTeX 分隔符类型('a' 表示 '$' 类型,'b' 表示 '()[]' 类型,@@ -67,6 +71,9 @@ Options:--upstream-url TEXT 现有 MinerU FastAPI 服务地址;可重复传入多个--local-gpus TEXT 本地 GPU worker 配置:auto、none 或 0,1,2 形式--worker-host TEXT 路由托管 worker 的监听地址(默认:127.0.0.1)+ --enable-vlm-preload BOOLEAN+ 在 router 托管的本地 mineru-api worker 中预加载本地+ VLM 模型--help 显示此帮助信息并退出```@@ -128,6 +135,11 @@ MinerU命令行工具的某些参数存在相同功能的环境变量配置,* 用于指定 `mineru-api` 输出目录根路径* 默认为当前工作目录下的 `./output`。+- `MINERU_LOCAL_API_STARTUP_TIMEOUT_SECONDS`:+ * 用于控制各命令行工具等待本地拉起的 `mineru-api` 进入健康状态的最长时间+ * 默认为 `300` 秒。+ * 适用于 `mineru` 的临时本地 API、`mineru-gradio` 的 preload 启动,以及 `mineru-router` 托管的本地 worker。+- `MINERU_API_TASK_RETENTION_SECONDS`:* 用于设置任务完成或失败后的保留时长(秒)* 默认为 `86400` 秒(24 小时)。diff --git a/docs/zh/usage/quick_usage.md b/docs/zh/usage/quick_usage.mdindex caf5a5b6..c9802956 100644--- a/docs/zh/usage/quick_usage.md+++ b/docs/zh/usage/quick_usage.md@@ -48,6 +48,7 @@ mineru -p <input_path> -o <output_path>>任务为单进程、进程内状态实现,服务重启、`--reload` 热重载或多进程部署后不保证仍可查询历史任务状态。>默认任务完成或失败后保留 24 小时,随后自动清理任务状态和输出目录;清理后访问任务状态或结果会返回 `404`。>可通过环境变量 `MINERU_API_TASK_RETENTION_SECONDS` 和 `MINERU_API_TASK_CLEANUP_INTERVAL_SECONDS` 调整保留时长与清理轮询间隔。+ >可通过 `--enable-vlm-preload true` 在服务启动阶段预热本地 VLM 模型,避免首次 VLM 或 hybrid 请求时再初始化。>>异步任务提交示例:>```bash@@ -82,6 +83,7 @@ mineru -p <input_path> -o <output_path>>>- 在浏览器中访问 `http://127.0.0.1:7860` 使用 Gradio WebUI。>- 未传 `--api-url` 时,Gradio 会自动拉起可复用的本地 `mineru-api`;传入 `--api-url` 时则会复用已有本地或远端服务。+ >- `--enable-vlm-preload true` 会让 Gradio 在 WebUI 启动阶段主动拉起本地 `mineru-api` 并等待 VLM 预加载完成;传入 `--api-url` 时会被忽略。>- WebUI 当前支持上传 `PDF`、图片与 `DOCX` 文件。- 通过 `mineru-router` 进行多服务 / 多 GPU 编排:@@ -92,6 +94,7 @@ mineru -p <input_path> -o <output_path>>>- `mineru-router` 对外暴露与 `mineru-api` 一致的 `/health`、`/tasks`、`/file_parse`、`/tasks/{task_id}`、`/tasks/{task_id}/result` 接口。>- 可重复使用 `--upstream-url` 聚合多个已有 `mineru-api` 服务,也可通过 `--local-gpus` 自动拉起本地 worker。+ >- `--enable-vlm-preload true` 仅作用于 router 托管的本地 worker,不会影响通过 `--upstream-url` 接入的远端服务。>- 适用于多服务、多 GPU 和统一入口部署场景。- 使用`http-client/server`方式调用: