### Install MinerU with pip and uv Source: https://opendatalab.github.io/MinerU/quick_start Installs or upgrades pip and uv, then installs MinerU with all features using uv. This is the recommended method for most users. ```bash pip install --upgrade pip pip install uv uv pip install -U "mineru[all]" ``` -------------------------------- ### Install MinerU from Source Source: https://opendatalab.github.io/MinerU/zh/quick_start Clone the MinerU repository and install it from the source code using uv. This method allows for development or custom builds. ```bash git clone https://github.com/opendatalab/MinerU.git cd MinerU uv pip install -e .[all] -i https://mirrors.aliyun.com/pypi/simple ``` -------------------------------- ### Install MinerU from Source Code Source: https://opendatalab.github.io/MinerU/quick_start Clones the MinerU repository and installs it from source using uv. This method is useful for developers or those needing the latest changes. ```bash git clone https://github.com/opendatalab/MinerU.git cd MinerU uv pip install -e .[all] ``` -------------------------------- ### Start Mineru Gradio WebUI Source: https://opendatalab.github.io/MinerU/usage/quick_usage Starts the Gradio WebUI for Mineru. Access the interface at http://127.0.0.1:7860. Can start a local API or connect to an existing one. ```bash mineru-gradio --server-name 0.0.0.0 --server-port 7860 ``` -------------------------------- ### Start OpenAI-Compatible API Service Source: https://opendatalab.github.io/MinerU/zh/quick_start/docker_deployment Launch the OpenAI-compatible API service using Docker Compose. This profile starts the necessary services for the API. ```bash docker compose -f compose.yaml --profile openai-server up -d ``` -------------------------------- ### Start Web API Service Source: https://opendatalab.github.io/MinerU/zh/quick_start/docker_deployment Launch the main Web API service for Mineru using Docker Compose. ```bash docker compose -f compose.yaml --profile api up -d ``` -------------------------------- ### Install MinerU Core Functionality Source: https://opendatalab.github.io/MinerU/quick_start/extension_modules Install the core module for basic MinerU parsing features. This is a prerequisite for most other functionalities. ```bash uv pip install "mineru[core]" ``` -------------------------------- ### Start Mineru API Server Source: https://opendatalab.github.io/MinerU/usage/quick_usage Starts the Mineru API server on the specified host and port. Access the API documentation at http://127.0.0.1:8000/docs. ```bash mineru-api --host 0.0.0.0 --port 8000 ``` -------------------------------- ### Start Docker Container Source: https://opendatalab.github.io/MinerU/zh/usage/acceleration_cards/Biren Command to start a Docker container with specific configurations for MinerU on Biren acceleration cards. This command mounts host resources and sets environment variables for model source and device model. ```bash docker run -it --name mineru_docker \ --privileged \ --network=host \ --shm-size=100G \ -e MINERU_MODEL_SOURCE=local \ -e MINERU_DEVICE_MODEL=supa \ -e SHAPE_TRANSFORM_GRANK=true \ mineru:biren-vllm-latest \ /bin/bash ``` -------------------------------- ### Install MinerU with pip and uv Source: https://opendatalab.github.io/MinerU/zh/quick_start Install MinerU and its dependencies using pip and uv package managers. Ensure you are using the specified mirror for packages. ```bash pip install --upgrade pip -i https://mirrors.aliyun.com/pypi/simple pip install uv -i https://mirrors.aliyun.com/pypi/simple uv pip install -U "mineru[all]" -i https://mirrors.aliyun.com/pypi/simple ``` -------------------------------- ### Install MinerU S3 Extension Module Source: https://opendatalab.github.io/MinerU/quick_start/extension_modules Install the S3 extension module to enable reading from or writing to S3 buckets. ```bash uv pip install "mineru[s3]" ``` -------------------------------- ### Install MinerU Pipeline for Hybrid-HTTP Client Mode Source: https://opendatalab.github.io/MinerU/quick_start/extension_modules Install the mineru pipeline extension for a lightweight client to connect to OpenAI-compatible servers in hybrid mode. Runs faster on devices with GPU acceleration. ```bash uv pip install "mineru[pipeline]" mineru -p -o -b hybrid-http-client -u http://127.0.0.1:30000 ``` -------------------------------- ### View MinerU API Server Help Source: https://opendatalab.github.io/MinerU/usage/cli_tools Show help information for the `mineru-api` command, which starts the MinerU API server. Useful for configuring server host and port. ```bash mineru-api --help ``` -------------------------------- ### Install Lightweight Client for OpenAI-compatible Servers (VLM Mode) Source: https://opendatalab.github.io/MinerU/quick_start/extension_modules Install the basic mineru package for a lightweight client on edge devices to connect to OpenAI-compatible servers for VLM mode. Requires only CPU and network connectivity. ```bash uv pip install mineru mineru -p -o -b vlm-http-client -u http://127.0.0.1:30000 ``` -------------------------------- ### Platform Information Source: https://opendatalab.github.io/MinerU/zh/usage/acceleration_cards/Cambricon This block provides details about the testing platform used for the guide, including OS, CPU, MLU model, driver version, and Docker version. ```text os: Ubuntu 22.04.5 LTS cpu: Hygon Hygon C86 7490 mlu: MLU590-M9D driver: v6.2.11 docker: 28.3.0 ``` -------------------------------- ### Start Mineru Router for Orchestration Source: https://opendatalab.github.io/MinerU/usage/quick_usage Starts the Mineru router for multi-service and multi-GPU orchestration. It exposes the same API interface as the Mineru API server. ```bash mineru-router --host 0.0.0.0 --port 8002 --local-gpus auto ``` -------------------------------- ### Start Mineru OpenAI Compatible Server Source: https://opendatalab.github.io/MinerU/usage/quick_usage Starts an OpenAI compatible server for Mineru, typically used with vLLM or LMDeploy environments. It listens on port 30000. ```bash # Start openai compatible server (requires vllm or lmdeploy environment) mineru-openai-server --port 30000 ``` -------------------------------- ### API Request Examples Source: https://opendatalab.github.io/MinerU/zh/usage/quick_usage Examples of making requests to the MinerU API for asynchronous task submission, synchronous file parsing, and polling task status. ```APIDOC ## API Request Examples * Asynchronous task submission example: ```bash curl -X POST http://127.0.0.1:8000/tasks \ -F "files=@demo/pdfs/demo1.pdf" \ -F "return_md=true" ``` * Synchronous parsing example: ```bash curl -X POST http://127.0.0.1:8000/file_parse \ -F "files=@demo/pdfs/demo1.pdf" \ -F "return_md=true" \ -F "response_format_zip=true" \ -F "return_original_file=true" ``` * Polling task status and results: ```bash curl http://127.0.0.1:8000/tasks/ curl http://127.0.0.1:8000/tasks//result curl http://127.0.0.1:8000/health ``` ``` -------------------------------- ### Start Gradio WebUI Service Source: https://opendatalab.github.io/MinerU/zh/quick_start/docker_deployment Launch the Gradio WebUI service for Mineru using Docker Compose. Access the UI via a web browser. ```bash docker compose -f compose.yaml --profile gradio up -d ``` -------------------------------- ### Launch MinerU API Server Source: https://opendatalab.github.io/MinerU/zh/usage/quick_usage Start the MinerU API server on a specified host and port. Access API documentation at http://127.0.0.1:8000/docs. ```bash mineru-api --host 0.0.0.0 --port 8000 ``` -------------------------------- ### Platform Information Source: https://opendatalab.github.io/MinerU/zh/usage/acceleration_cards/Biren Details of the testing platform used for this guide, including OS, CPU, GPU, driver, and Docker versions. ```text os: Ubuntu 22.04.4 LTS cpu: Intel x86-64 gpu: Biren 106C driver: 1.10.0 docker: 28.0.4 ``` -------------------------------- ### Start OpenAI Compatible Server Source: https://opendatalab.github.io/MinerU/zh/usage/quick_usage Launch an OpenAI-compatible server for MinerU, which requires vllm or lmdeploy environment. This server can be accessed by HTTP clients. ```bash # Start the openai compatible server (requires vllm or lmdeploy environment) mineru-openai-server --port 30000 ``` -------------------------------- ### LLM Aided Configuration Example Source: https://opendatalab.github.io/MinerU/zh/usage/quick_usage Example configuration for LLM-aided title grading, showing how to set API keys, base URLs, and model parameters. Demonstrates removal of the 'enable_thinking' parameter. ```json "llm-aided-config": { "api_key": "your_api_key", "base_url": "https://dashscope.aliyuncs.com/compatible-mode/v1", "model": "qwen3-next-80b-a3b-instruct", "enable_thinking": false, "enable": false } ``` ```json "llm-aided-config": { "api_key": "your_api_key", "base_url": "https://dashscope.aliyuncs.com/compatible-mode/v1", "model": "qwen3-next-80b-a3b-instruct", "enable": false } ``` -------------------------------- ### Coordinate System Example Source: https://opendatalab.github.io/MinerU/zh/reference/output_files Example of the bbox coordinate format, representing the top-left and bottom-right points of a bounding box relative to the page dimensions. ```json { "type": "header", "bbox": [ 0.077, 0.095, 0.18, 0.181 ], "angle": 0, "score": null, "block_tags": null, "content": "ELSEVIER", "format": null, "content_tags": null }, { "type": "title", "bbox": [ 0.157, 0.228, 0.833, 0.253 ], "angle": 0, "score": null, "block_tags": null, "content": "The response of flow duration curves to afforestation", "format": null, "content_tags": null } ``` -------------------------------- ### Launch Gradio Web UI Source: https://opendatalab.github.io/MinerU/zh/usage/quick_usage Start the Gradio-based web UI for MinerU. Access the UI at http://127.0.0.1:7860. The UI can automatically start a local API if --api-url is not specified. ```bash mineru-gradio --server-name 0.0.0.0 --server-port 7860 ``` -------------------------------- ### Start Gradio WebUI Source: https://opendatalab.github.io/MinerU/zh/usage/quick_usage Launch the Gradio WebUI for a visual interface to MinerU. It can automatically launch a local API or connect to a specified API URL. ```APIDOC ## Start Gradio WebUI * Launch the Gradio WebUI visualization frontend: ```bash mineru-gradio --server-name 0.0.0.0 --server-port 7860 ``` **Tip:** * Access the Gradio WebUI in your browser at `http://127.0.0.1:7860`. * If `--api-url` is not provided, Gradio will automatically launch a reusable local `mineru-api`. If `--api-url` is provided, it will reuse an existing local or remote service. * `--enable-vlm-preload true` will cause Gradio to actively launch a local `mineru-api` during WebUI startup and wait for VLM preloading to complete. This is ignored if `--api-url` is provided. * The WebUI currently supports uploading `PDF`, images, `DOCX`, `PPTX`, `XLSX` files. ``` -------------------------------- ### Build Docker Image for lmdeploy with Cambricon Source: https://opendatalab.github.io/MinerU/zh/usage/acceleration_cards/Cambricon Use this command to download the Dockerfile and build a Docker image for lmdeploy on Cambricon acceleration cards. Ensure you have wget installed. ```bash wget https://gcore.jsdelivr.net/gh/opendatalab/MinerU@master/docker/china/mlu.Dockerfile docker build --network=host -t mineru:mlu-lmdeploy-latest -f mlu.Dockerfile . ``` -------------------------------- ### Install MinerU within RAGFlow Container Source: https://opendatalab.github.io/MinerU/zh/usage/plugin/RagFlow Execute these commands inside the RAGFlow container to create a virtual environment, activate it, and install MinerU with its core dependencies. This setup ensures MinerU is available for RAGFlow. ```bash mkdir uv_tools cd uv_tools uv venv .venv source .venv/bin/activate uv pip install -U "mineru[core]" -i https://mirrors.aliyun.com/pypi/simple ``` -------------------------------- ### Install lmdeploy without re-downloading PyTorch Source: https://opendatalab.github.io/MinerU/zh/faq If PyTorch with cu128 is already installed, use this command to install lmdeploy without re-downloading PyTorch to save time and bandwidth. ```powershell pip install $wheel --no-dependencies ``` -------------------------------- ### Install MinerU with lmdeploy for VLM Inference Acceleration Source: https://opendatalab.github.io/MinerU/quick_start/extension_modules Install the lmdeploy module to accelerate VLM model inference on compatible GPUs. Avoid installing both vLLM and lmdeploy simultaneously. ```bash uv pip install "mineru[core,lmdeploy]" ``` -------------------------------- ### Discarded Content Examples Source: https://opendatalab.github.io/MinerU/zh/reference/output_files Examples of discarded content types, including header and page footnote. ```json [{ "type": "header", "text": "Journal of Hydrology 310 (2005) 253-265", "bbox": [ 363, 164, 623, 177 ], "page_idx": 0 }, { "type": "page_footnote", "text": "* Corresponding author. Address: Forest Science Centre, Department of Sustainability and Environment, P.O. Box 137, Heidelberg, Vic. 3084, Australia. Tel.: +61 3 9450 8719; fax: +61 3 9450 8644.", "bbox": [ 71, 815, 915, 841 ], "page_idx": 0 }] ``` -------------------------------- ### View MinerU Gradio Interface Help Source: https://opendatalab.github.io/MinerU/usage/cli_tools Display help for the `mineru-gradio` command, which launches the Gradio web interface. This helps in configuring options like example files, HTTP client, and server settings. ```bash mineru-gradio --help ``` -------------------------------- ### List Type Content Example Source: https://opendatalab.github.io/MinerU/zh/reference/output_files Example of a 'list' type content with 'text' sub-type, containing a list of items. ```json { "type": "list", "sub_type": "text", "list_items": [ "H.1 Introduction", "H.2 Example: Divide by Zero without Exception Handling", "H.3 Example: Divide by Zero with Exception Handling", "H.4 Summary" ], "bbox": [ 174, 155, 818, 333 ], "page_idx": 0 } ``` -------------------------------- ### Download and Load Docker Image (vllm) Source: https://opendatalab.github.io/MinerU/zh/usage/acceleration_cards/Biren Instructions for downloading the MinerU vllm Docker image and loading it into your Docker environment. Contact MonaLiu@birentech.com for link access. ```bash wget http://birentech.com/xxx/MinerU/mineru-vllm.tar 链接获取请联系壁仞内部人员(邮箱:MonaLiu@birentech.com) docker load -i mineru-vllm.tar ``` -------------------------------- ### Code Type Content Example Source: https://opendatalab.github.io/MinerU/zh/reference/output_files Example of a 'code' type content with 'algorithm' sub-type, including code caption and body. ```json { "type": "code", "sub_type": "algorithm", "code_caption": [ "Algorithm 1 Modules for MCTSteg" ], "code_body": "1: function GETCOORDINATE(d) \n2: $x \gets d / l$ , $y \gets d$ mod $l$ \n3: return $(x, y)$ \n4: end function \n5: function BESTCHILD(v) \n6: $C \gets$ child set of $v$ \n7: $v' \gets \arg \max_{c \in C} \mathrm{UCTScore}(c)$ \n8: $v'.n \gets v'.n + 1$ \n9: return $v'$ \n10: end function \n11: function BACK PROPAGATE(v) \n12: Calculate $R$ using Equation 11 \n13: while $v$ is not a root node do \n14: $v.r \gets v.r + R$ , $v \gets v.p$ \n15: end while \n16: end function \n17: function RANDOMSEARCH(v) \n18: while $v$ is not a leaf node do \n19: Randomly select an untried action $a \in A(v)$ \n20: Create a new node $v'$ \n21: $(x, y) \gets \mathrm{GETCOORDINATE}(v'.d)$ \n22: $v'.p \gets v$ , $v'.d \gets v.d + 1$ , $v'.\Gamma \gets v.\Gamma$ \n23: $v'.\gamma_{x,y} \gets a$ \n24: if $a = -1$ then \n25: $v.lc \gets v'$ \n26: else if $a = 0$ then \n27: $v.mc \gets v'$ \n28: else \n29: $v.rc \gets v'$ \n30: end if \n31: $v \gets v'$ \n32: end while \n33: return $v$ \n34: end function \n35: function SEARCH(v) \n36: while $v$ is fully expanded do \n37: $v \gets$ BESTCHILD(v) \n38: end while \n39: if $v$ is not a leaf node then \n40: $v \gets$ RANDOMSEARCH(v) \n41: end if \n42: return $v$ \n43: end function", "bbox": [ 510, 87, 881, 740 ], "page_idx": 0 } ``` -------------------------------- ### Download and Load MinerU VLLM Docker Image Source: https://opendatalab.github.io/MinerU/zh/usage/acceleration_cards/Tecorigin Download the MinerU VLLM Docker image and load it into your Docker environment. This is the first step for setting up the vLLM environment. ```bash wget http://wb.tecorigin.com:8082/repository/teco-customer-repo/Course/MinerU/mineru-vllm.tar docker load -i mineru-vllm.tar ``` -------------------------------- ### 下载模型到本地(帮助信息) Source: https://opendatalab.github.io/MinerU/zh/usage/model_source 运行mineru-models-download --help命令以获取模型下载工具的帮助信息。这有助于了解可用的下载选项和参数。 ```bash mineru-models-download --help ``` -------------------------------- ### Restart RAGFlow Services Source: https://opendatalab.github.io/MinerU/zh/usage/plugin/RagFlow After installing MinerU inside the container, exit the container and restart the RAGFlow CPU service to ensure it loads the newly installed MinerU plugin. ```bash docker compose restart ragflow-cpu ``` -------------------------------- ### Install libgl1-mesa-glx on Ubuntu 22.04 WSL2 Source: https://opendatalab.github.io/MinerU/zh/faq Resolve the 'ImportError: libGL.so.1: cannot open shared object file' error in Ubuntu 22.04 WSL2 by installing the missing libgl library. ```bash sudo apt-get install libgl1-mesa-glx ``` -------------------------------- ### Start Docker Container for Ascend NPU Source: https://opendatalab.github.io/MinerU/zh/usage/acceleration_cards/Ascend Launches a Docker container with necessary device mappings and environment variables for Ascend NPU acceleration. Use the appropriate image tag (e.g., `mineru:npu-vllm-latest` or `mineru:npu-lmdeploy-latest`). The `MINERU_LMDEPLOY_DEVICE=ascend` environment variable is crucial for Ascend NPU environments. ```bash docker run -u root --name mineru_docker --privileged=true \ --ipc=host \ --network=host \ --device=/dev/davinci0 \ --device=/dev/davinci1 \ --device=/dev/davinci2 \ --device=/dev/davinci3 \ --device=/dev/davinci4 \ --device=/dev/davinci5 \ --device=/dev/davinci6 \ --device=/dev/davinci7 \ --device=/dev/davinci_manager \ --device=/dev/devmm_svm \ --device=/dev/hisi_hdc \ -v /var/log/npu/:/usr/slog \ -v /usr/local/dcmi:/usr/local/dcmi \ -v /usr/local/bin/npu-smi:/usr/local/bin/npu-smi \ -v /usr/local/Ascend/driver:/usr/local/Ascend/driver \ -e VLLM_WORKER_MULTIPROC_METHOD=spawn \ -e MINERU_MODEL_SOURCE=local \ -e MINERU_LMDEPLOY_DEVICE=ascend \ -it mineru:npu-vllm-latest \ /bin/bash ``` -------------------------------- ### Intermediate Processing Results (middle.json) Example Source: https://opendatalab.github.io/MinerU/zh/reference/output_files Example structure of the middle.json file, highlighting differences from pipeline backend, such as sub_type for lists and code blocks, and additional block types. ```json [ [ { "type": "header", "bbox": [ 0.077, 0.095, 0.18, 0.181 ], "angle": 0, "score": null, "block_tags": null, "content": "ELSEVIER", "format": null, "content_tags": null }, { "type": "title", "bbox": [ 0.157, 0.228, 0.833, 0.253 ], "angle": 0, "score": null, "block_tags": null, "content": "The response of flow duration curves to afforestation", "format": null, "content_tags": null } ] ] ``` -------------------------------- ### Build Docker Image for vLLM with Cambricon Source: https://opendatalab.github.io/MinerU/zh/usage/acceleration_cards/Cambricon This process involves downloading the Dockerfile, modifying it to use the vLLM base image by commenting out lmdeploy lines and uncommenting vLLM lines, and then building the Docker image. Ensure wget is installed. ```bash wget https://gcore.jsdelivr.net/gh/opendatalab/MinerU@master/docker/china/mlu.Dockerfile # 将基础镜像从 lmdeploy 切换为 vllm sed -i -e '3,4s/^/# /' -e '6,7s/^# //' mlu.Dockerfile docker build --network=host -t mineru:mlu-vllm-latest -f mlu.Dockerfile . ``` -------------------------------- ### Model Inference Results (model.json) Example Source: https://opendatalab.github.io/MinerU/zh/reference/output_files Example structure of the model.json file, which contains raw output results from the VLM model, including page structure and content blocks. ```json [ [ { "type": "title", "content": { "title_content": [ { "type": "text", "content": "1 Introduction" } ], "level": 1 }, "bbox": [ 83, 121, 917, 156 ] }, { "type": "page_footnote", "content": { "page_footnote_content": [ { "type": "text", "content": "* Corresponding author" } ] }, "bbox": [ 71, 815, 915, 841 ] } ] ] ``` -------------------------------- ### Build MinerU Docker Image for Corex Source: https://opendatalab.github.io/MinerU/zh/usage/acceleration_cards/IluvatarCorex Download the Dockerfile for Corex and build the MinerU Docker image. Ensure you are using the `--network=host` option for proper network configuration. ```bash wget https://gcore.jsdelivr.net/gh/opendatalab/MinerU@master/docker/china/corex.Dockerfile docker build --network=host -t mineru:corex-vllm-latest -f corex.Dockerfile . ``` -------------------------------- ### Install lmdeploy for Blackwell GPUs on Windows Source: https://opendatalab.github.io/MinerU/zh/faq Use this command to install lmdeploy with CUDA 12.8 support for Blackwell architecture GPUs on Windows. Ensure Python version is correctly set. ```powershell $env:LMDEPLOY_VERSION = "0.11.1" $env:PYTHON_VERSION = "312" $wheel = "https://github.com/InternLM/lmdeploy/releases/download/v$($env:LMDEPLOY_VERSION)/lmdeploy-$($env:LMDEPLOY_VERSION)+cu128-cp$($env:PYTHON_VERSION)-cp$($env:PYTHON_VERSION)-win_amd64.whl" pip install $wheel --extra-index-url https://download.pytorch.org/whl/cu128 ``` -------------------------------- ### View MinerU CLI Help Source: https://opendatalab.github.io/MinerU/usage/cli_tools Display help information for the main `mineru` command-line tool to understand its options and usage. ```bash mineru --help ``` -------------------------------- ### Start MinerU API Server Source: https://opendatalab.github.io/MinerU/zh/usage/quick_usage You can start the MinerU API server using FastAPI. This provides endpoints for health checks, task submission, file parsing, and task status queries. ```APIDOC ## Start MinerU API Server * Start via FastAPI: ```bash mineru-api --host 0.0.0.0 --port 8000 ``` **Tip:** * Access the API documentation in your browser at `http://127.0.0.1:8000/docs`. * Health check endpoint: `GET /health` returns service information like `protocol_version`, `processing_window_size`, `max_concurrent_requests`. * Asynchronous task submission endpoint: `POST /tasks`. * Synchronous parsing endpoint: `POST /file_parse`. * Task query endpoints: `GET /tasks/{task_id}`, `GET /tasks/{task_id}/result`. * The API output directory is fixed on the server side, defaulting to `./output`. * Currently supports uploading `PDF`, images, `DOCX`, `PPTX`, `XLSX` files. * `POST /tasks` returns `task_id` immediately; `POST /file_parse` submits to the same task manager internally and returns the final result synchronously after the task completes. * The `queued_ahead` field may be returned in task submission and status query results when tasks are in the queue, indicating the number of tasks ahead. * Tasks are implemented with single-process, in-process state. Task status is not guaranteed to be queryable after service restart, `--reload` hot reload, or multi-process deployment. * By default, task status and output directories are retained for 24 hours after completion or failure, then automatically cleaned up. Accessing task status or results after cleanup will return `404`. * Retention duration and cleanup interval can be adjusted via environment variables `MINERU_API_TASK_RETENTION_SECONDS` and `MINERU_API_TASK_CLEANUP_INTERVAL_SECONDS`. * `--enable-vlm-preload true` can be used to preheat local VLM models during service startup, avoiding initialization during the first VLM or hybrid request. ``` -------------------------------- ### Build Docker Image for Mineru Source: https://opendatalab.github.io/MinerU/zh/quick_start/docker_deployment Download the Dockerfile and build the Mineru Docker image. This command assumes you are in the directory where the Dockerfile was downloaded. ```bash wget https://gcore.jsdelivr.net/gh/opendatalab/MinerU@master/docker/china/Dockerfile docker build -t mineru:latest -f Dockerfile . ``` -------------------------------- ### Install MinerU with vLLM for VLM Inference Acceleration Source: https://opendatalab.github.io/MinerU/quick_start/extension_modules Install the vLLM module to accelerate VLM model inference on compatible GPUs. Ensure your GPU driver supports the required CUDA runtime. ```bash uv pip install "mineru[core,vllm]" ``` -------------------------------- ### View MinerU API CLI Help Source: https://opendatalab.github.io/MinerU/zh/usage/cli_tools To view the help information for the MinerU API CLI tool, use the `--help` parameter. This shows options for configuring the API server. ```bash mineru-api --help Usage: mineru-api [OPTIONS] Options: --host TEXT 服务器主机地址(默认:127.0.0.1) --port INTEGER 服务器端口(默认:8000) --reload 启用自动重载(开发模式) --enable-vlm-preload BOOLEAN 在 mineru-api 启动阶段预加载本地 VLM 模型 --help 显示此帮助信息并退出 ``` -------------------------------- ### Build Docker Image for Enflame GCU Source: https://opendatalab.github.io/MinerU/zh/usage/acceleration_cards/Enflame Use this command to download the Dockerfile and build a Docker image specifically for Enflame GCU acceleration cards. The `--network=host` flag is recommended for better performance. ```bash wget https://gcore.jsdelivr.net/gh/opendatalab/MinerU@master/docker/china/gcu.Dockerfile docker build --network=host -t mineru:gcu-vllm-latest -f gcu.Dockerfile . ``` -------------------------------- ### Build Docker Image for Kunlunxin (vllm) Source: https://opendatalab.github.io/MinerU/zh/usage/acceleration_cards/Kunlunxin Builds a Docker image with vllm support for Kunlunxin GPUs using a provided Dockerfile. Ensure you download the Dockerfile first. ```bash wget https://gcore.jsdelivr.net/gh/opendatalab/MinerU@master/docker/china/kxpu.Dockerfile docker build --network=host -t mineru:kxpu-vllm-latest -f kxpu.Dockerfile . ``` -------------------------------- ### Install Noto Fonts on Debian/Ubuntu for PDF Rendering Source: https://opendatalab.github.io/MinerU/zh/faq Install Noto CJK fonts on Debian or Ubuntu systems to fix missing text issues when rendering PDFs to images, especially in newer MinerU versions using pypdfium2. ```bash sudo apt update sudo apt install fonts-noto-core sudo apt install fonts-noto-cjk fc-cache -fv ```