### Install MinerU using pip Source: https://github.com/opendatalab/mineru/blob/master/docs/en/quick_start/index.md Installs or upgrades pip, installs uv, and then installs MinerU with all features using uv. ```bash pip install --upgrade pip pip install uv uv pip install -U "mineru[all]" ``` -------------------------------- ### Install MinerU from Source Source: https://github.com/opendatalab/mineru/blob/master/docs/en/quick_start/index.md Clones the MinerU repository and installs it in editable mode with all features using uv. ```bash git clone https://github.com/opendatalab/MinerU.git cd MinerU uv pip install -e .[all] ``` -------------------------------- ### Start OpenAI Compatible Server Source: https://github.com/opendatalab/mineru/blob/master/docs/en/usage/quick_usage.md Starts an OpenAI compatible server for MinerU, typically used with vLLM or LMDeploy. ```APIDOC ## Start OpenAI Compatible Server ```bash mineru-openai-server --port 30000 ``` ### Description Launches a server compatible with the OpenAI API, allowing clients designed for OpenAI to interact with MinerU. This requires a `vllm` or `lmdeploy` environment. ``` -------------------------------- ### Start OpenAI Compatible Server Source: https://github.com/opendatalab/mineru/blob/master/docs/en/usage/quick_usage.md Starts an OpenAI compatible server using MinerU, requiring vLLM or lmdeploy. This server can be connected to by http clients. ```bash # Start openai compatible server (requires vllm or lmdeploy environment) mineru-openai-server --port 30000 ``` -------------------------------- ### Install MinerU Core Functionality Source: https://github.com/opendatalab/mineru/blob/master/docs/en/quick_start/extension_modules.md Install the core module for basic MinerU parsing features. This is a prerequisite for most other functionalities. ```bash uv pip install "mineru[core]" ``` -------------------------------- ### Install Lightweight Client for OpenAI-compatible Servers (vlm-http-client) Source: https://github.com/opendatalab/mineru/blob/master/docs/en/quick_start/extension_modules.md Install the basic MinerU package for a lightweight client to connect to OpenAI-compatible servers in VLM mode. Suitable for edge devices with CPU and network connectivity. ```bash uv pip install mineru mineru -p -o -b vlm-http-client -u http://127.0.0.1:30000 ``` -------------------------------- ### Example 4: Full Conversation Flow Source: https://github.com/opendatalab/mineru/blob/master/docs/zh/usage/plugin/Cherry_Studio.md A complete example of a user request and the model's response using the MinerU-MCP tool. ```Plain 我有一份学术论文的 PDF,网址是 https://arxiv.org/pdf/2303.08774.pdf,能帮我转换成 Markdown 格式吗? ``` ```Plain 我可以帮您将这份学术论文转换为 Markdown 格式。我将使用 MinerU-MCP 工具来处理这个任务。 [模型调用 parse_documents 工具,处理过程中...] 论文已成功转换为 Markdown 格式。转换结果如下: # The Capacity of Diffusion Models to Memorize and Generate Training Data ## Abstract Recent diffusion models can generate high-quality images that are nearly indistinguishable from real ones... [显示论文内容...] ``` -------------------------------- ### Start Web API Service with Docker Compose Source: https://github.com/opendatalab/mineru/blob/master/docs/en/quick_start/docker_deployment.md Starts the MinerU Web API service using Docker Compose. The API documentation can be accessed via a browser. ```bash docker compose -f compose.yaml --profile api up -d ``` -------------------------------- ### Start MinerU API Server Source: https://github.com/opendatalab/mineru/blob/master/docs/en/usage/quick_usage.md Starts the MinerU API server using FastAPI. Access the interactive API documentation at http://127.0.0.1:8000/docs. ```APIDOC ## Start MinerU API Server ```bash mineru-api --host 0.0.0.0 --port 8000 ``` ### Description Starts the MinerU API server, providing endpoints for task submission, file parsing, and status checks. The API documentation is available at `/docs`. ### Endpoints - `GET /health`: Returns system health information. - `POST /tasks`: Submits tasks asynchronously. - `POST /file_parse`: Parses files synchronously. - `GET /tasks/{task_id}`: Queries the status of a specific task. - `GET /tasks/{task_id}/result`: Fetches the result of a specific task. ``` -------------------------------- ### Example 1: Parse Document via URL Source: https://github.com/opendatalab/mineru/blob/master/docs/zh/usage/plugin/Cherry_Studio.md User prompt and the corresponding tool call parameters for parsing a PDF from a URL. ```Plain 请使用 MinerU MCP 将以下 URL 的 PDF 文档转换为 Markdown 格式:https://example.com/sample.pdf ``` ```Plain {"file_sources": "https://example.com/sample.pdf"} ``` -------------------------------- ### Install Lightweight Client for OpenAI-compatible Servers (hybrid-http-client) Source: https://github.com/opendatalab/mineru/blob/master/docs/en/quick_start/extension_modules.md Install the MinerU pipeline extension package for a lightweight client to connect to OpenAI-compatible servers in hybrid mode. This package is suitable for devices with CPU and network connectivity and performs faster with GPU acceleration. ```bash uv pip install "mineru[pipeline]" mineru -p -o -b hybrid-http-client -u http://127.0.0.1:30000 ``` -------------------------------- ### Start MinerU Gradio WebUI Source: https://github.com/opendatalab/mineru/blob/master/docs/en/usage/quick_usage.md Launches the MinerU Gradio WebUI for a visual frontend. Access http://127.0.0.1:7860 in your browser. 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 Server Service with Docker Compose Source: https://github.com/opendatalab/mineru/blob/master/docs/en/quick_start/docker_deployment.md Starts the OpenAI-compatible server service using Docker Compose. This profile is suitable for connecting via the vlm-http-client backend. ```bash docker compose -f compose.yaml --profile openai-server up -d ``` -------------------------------- ### Example 2: Parse Local Document Source: https://github.com/opendatalab/mineru/blob/master/docs/zh/usage/plugin/Cherry_Studio.md User prompt and the corresponding tool call parameters for parsing a local PDF file. ```Plain 请使用 MinerU-MCP 将本地的 D://sample.pdf 文件转换为 Markdown 格式 ``` ```Plain {"file_sources": "D://sample.pdf"} ``` -------------------------------- ### Start MinerU API Server Source: https://github.com/opendatalab/mineru/blob/master/docs/en/usage/quick_usage.md Launches the MinerU FastAPI server. Access http://127.0.0.1:8000/docs for API documentation. Supports asynchronous task submission, synchronous parsing, and task querying. ```bash mineru-api --host 0.0.0.0 --port 8000 ``` -------------------------------- ### Start Gradio WebUI Source: https://github.com/opendatalab/mineru/blob/master/docs/en/usage/quick_usage.md Launches the Gradio WebUI for a visual interface to MinerU. ```APIDOC ## Start Gradio WebUI ```bash mineru-gradio --server-name 0.0.0.0 --server-port 7860 ``` ### Description Starts the Gradio WebUI, accessible at `http://127.0.0.1:7860`. This UI allows users to upload files and interact with MinerU visually. It can either start a local `mineru-api` instance or connect to an existing one via `--api-url`. ``` -------------------------------- ### Start MinerU Router Source: https://github.com/opendatalab/mineru/blob/master/docs/en/usage/quick_usage.md Launches the MinerU router for multi-service and multi-GPU orchestration. ```APIDOC ## Start MinerU Router ```bash mineru-router --host 0.0.0.0 --port 8002 --local-gpus auto ``` ### Description Starts the MinerU router, which acts as a unified entry point for multiple `mineru-api` services or local workers. It exposes the same API interface as `mineru-api` and supports aggregation of upstream services and automatic launching of local GPU workers. ``` -------------------------------- ### Install MinerU S3 Extension Module Source: https://github.com/opendatalab/mineru/blob/master/docs/en/quick_start/extension_modules.md Install the S3 extension module to enable reading from or writing to S3 storage. Ensure you have the necessary S3 credentials configured. ```bash uv pip install "mineru[s3]" ``` -------------------------------- ### Start MinerU Router Service with Docker Compose Source: https://github.com/opendatalab/mineru/blob/master/docs/en/quick_start/docker_deployment.md Starts the MinerU Router service using Docker Compose. This service provides a unified entry point and can operate in local GPU auto-detection mode or aggregate existing services. ```bash docker compose -f compose.yaml --profile router up -d ``` -------------------------------- ### Install CUDA-enabled PyTorch for Blackwell GPUs on Windows Source: https://github.com/opendatalab/mineru/blob/master/docs/en/faq/index.md Install the lmdeploy 0.11.1 + cu128 Windows wheel for Blackwell GPUs. Ensure PYTHON_VERSION is set to your Python version. This command installs the wheel and PyTorch with CUDA 12.8 support. ```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 ``` -------------------------------- ### Start Gradio WebUI Service with Docker Compose Source: https://github.com/opendatalab/mineru/blob/master/docs/en/quick_start/docker_deployment.md Starts the MinerU Gradio WebUI service using Docker Compose. This allows users to interact with MinerU through a web interface. ```bash docker compose -f compose.yaml --profile gradio up -d ``` -------------------------------- ### Install vLLM with ROCm Support Source: https://github.com/opendatalab/mineru/blob/master/docs/zh/usage/acceleration_cards/AMD.md Manual installation of vLLM and its dependencies for ROCm. This involves cloning repositories, updating submodules, and setting the PYTORCH_ROCM_ARCH environment variable. ```bash #手动安装aiter,vllm,amd-smi等,自行找一个位置clone,然后进入该目录吧 git clone --recursive https://github.com/ROCm/aiter.git cd aiter git submodule sync; git submodule update --init --recursive python setup.py develop cd .. git clone https://github.com/vllm-project/vllm.git cd vllm/ cp -r /opt/rocm/share/amd_smi ~/Pytorch/vllm/ pip install amd_smi/ pip install --upgrade numba \ scipy \ huggingface-hub[cli,hf_transfer] \ setuptools_scm pip install -r requirements/rocm.txt export PYTORCH_ROCM_ARCH="gfx1100" #根据自己的GPU架构 rocminfo | grep gfx python setup.py develop ``` -------------------------------- ### Install libGL library on Ubuntu 22.04 WSL2 Source: https://github.com/opendatalab/mineru/blob/master/docs/en/faq/index.md Resolves the 'ImportError: libGL.so.1' error on Ubuntu 22.04 WSL2 by installing the missing libgl1-mesa-glx package. ```bash sudo apt-get install libgl1-mesa-glx ``` -------------------------------- ### Install MinerU with vLLM for VLM Inference Acceleration Source: https://github.com/opendatalab/mineru/blob/master/docs/en/quick_start/extension_modules.md Install the vLLM module to accelerate VLM model inference on compatible GPUs. This module requires a Volta architecture GPU or later with at least 8GB VRAM. Note potential dependency conflicts if lmdeploy is also installed. ```bash uv pip install "mineru[core,vllm]" ``` -------------------------------- ### Install MinerU with lmdeploy for VLM Inference Acceleration Source: https://github.com/opendatalab/mineru/blob/master/docs/en/quick_start/extension_modules.md Install the lmdeploy module to accelerate VLM model inference on compatible GPUs. This module requires a Volta architecture GPU or later with at least 8GB VRAM. Note potential dependency conflicts if vLLM is also installed. ```bash uv pip install "mineru[core,lmdeploy]" ``` -------------------------------- ### Start MinerU Docker Container Source: https://github.com/opendatalab/mineru/blob/master/docs/en/quick_start/docker_deployment.md Starts a MinerU Docker container with specified port mappings and GPU access. This command launches an interactive bash session inside the container. ```bash docker run --gpus all \ --shm-size 32g \ -p 30000:30000 -p 7860:7860 -p 8000:8000 -p 8002:8002 \ --ipc=host \ -it mineru:latest \ /bin/bash ``` -------------------------------- ### View mineru-gradio Help Information Source: https://github.com/opendatalab/mineru/blob/master/docs/en/usage/cli_tools.md This command displays the help message for the mineru-gradio tool, outlining all available options for configuring the Gradio interface, including example file enablement, HTTP client linking, and server settings. ```bash mineru-gradio --help ``` -------------------------------- ### Common CUDA_VISIBLE_DEVICES configurations Source: https://github.com/opendatalab/mineru/blob/master/docs/en/usage/advanced_cli_parameters.md Examples of how to set the CUDA_VISIBLE_DEVICES environment variable to control GPU visibility. ```bash CUDA_VISIBLE_DEVICES=1 # Only device 1 will be seen CUDA_VISIBLE_DEVICES=0,1 # Devices 0 and 1 will be visible CUDA_VISIBLE_DEVICES="0,1" # Same as above, quotation marks are optional CUDA_VISIBLE_DEVICES=0,2,3 # Devices 0, 2, 3 will be visible; device 1 is masked CUDA_VISIBLE_DEVICES="" # No GPU will be visible ``` -------------------------------- ### Install CJK Fonts on Ubuntu/Debian for PDF Text Rendering Source: https://github.com/opendatalab/mineru/blob/master/docs/en/faq/index.md Installs Noto Core and CJK fonts on Ubuntu/Debian systems to resolve missing text information in PDF parsing results when using pypdfium2. Updates the font cache afterwards. ```bash sudo apt update sudo apt install fonts-noto-core sudo apt install fonts-noto-cjk fc-cache -fv ``` -------------------------------- ### Example 3: Parse Document with OCR Source: https://github.com/opendatalab/mineru/blob/master/docs/zh/usage/plugin/Cherry_Studio.md User prompt and the corresponding tool call parameters for parsing a scanned PDF with OCR enabled. ```Plain 请使用 MinerU-MCP 将以下 URL 的扫描版 PDF 文档转换为 Markdown 格式,并启用 OCR 功能: https://example.com/scanned.pdf ``` ```Plain {"file_sources": "https://example.com/scanned.pdf","enable_ocr": true} ``` -------------------------------- ### Install PyTorch with ROCm Support Source: https://github.com/opendatalab/mineru/blob/master/docs/zh/usage/acceleration_cards/AMD.md Installs PyTorch and torchvision with ROCm 7.0 support using a Tsinghua mirror. Ensure your GPU architecture (e.g., gfx1100) is correctly specified. ```bash uv venv --python python3.12 source .venv/bin/activate uv pip install --pre torch torchvision -i https://pypi.tuna.tsinghua.edu.cn/simple/ --extra-index-url https://download.pytorch.org/whl/nightly/rocm7.0 uv pip install pip # 避免覆盖我们本地的pytorch,改用pip而没有继续使用uv pip pip install -U "mineru[core]" -i https://pypi.mirrors.ustc.edu.cn/simple/ ``` -------------------------------- ### Start MinerU Router for Orchestration Source: https://github.com/opendatalab/mineru/blob/master/docs/en/usage/quick_usage.md Launches the MinerU router for multi-service or multi-GPU orchestration. Exposes the same API interface as mineru-api and can aggregate services or launch local workers. ```bash mineru-router --host 0.0.0.0 --port 8002 --local-gpus auto ``` -------------------------------- ### Build MinerU Docker Image Source: https://github.com/opendatalab/mineru/blob/master/docs/en/quick_start/docker_deployment.md Builds the MinerU Docker image using the provided Dockerfile. Ensure you have Docker installed and the Dockerfile is accessible. ```bash wget https://gcore.jsdelivr.net/gh/opendatalab/MinerU@master/docker/global/Dockerfile docker build -t mineru:latest -f Dockerfile . ``` -------------------------------- ### HTTP Client Usage Source: https://github.com/opendatalab/mineru/blob/master/docs/en/usage/quick_usage.md Example of using an HTTP client to connect to a MinerU service, such as the OpenAI compatible server. ```APIDOC ## HTTP Client Usage ### Description Connects to a MinerU service using an HTTP client. The example shows connecting to the `mineru-openai-server`. ### Command Example ```bash mineru -p -o -b hybrid-http-client -u http://127.0.0.1:30000 ``` ### Notes - `hybrid-http-client` requires local pipeline dependencies (`mineru[pipeline]`, `torch`). - `vlm-http-client` is a lightweight option that does not require local `torch`. ``` -------------------------------- ### Code Block Example Source: https://github.com/opendatalab/mineru/blob/master/docs/en/reference/output_files.md Represents a code block, potentially with an optional caption. Includes bounding box, type, index, and a list of code body and caption blocks. ```json { "type": "code", "bbox": [114,780,885,1231], "blocks": [ { "bbox": [114,780,885,1231], "lines": [ { "bbox": [114,780,885,1231], "spans": [ { "bbox": [114,780,885,1231], "type": "text", "content": "1 // Fig. H.1: DivideByZeroNoExceptionHandling.java \n2 // Integer division without exception handling. \n3 import java.util.Scanner; \n4 \n5 public class DivideByZeroNoExceptionHandling \n6 { \n7 // demonstrates throwing an exception when a divide-by-zero occurs \n8 public static int quotient( int numerator, int denominator ) \n9 { \n10 return numerator / denominator; // possible division by zero \n11 } // end method quotient \n12 \n13 public static void main(String[] args) \n14 { \n15 Scanner scanner = new Scanner(System.in); // scanner for input \n16 \n17 System.out.print(\"Please enter an integer numerator: \"); \n18 int numerator = scanner.nextInt(); \n19 System.out.print(\"Please enter an integer denominator: \"); \n20 int denominator = scanner.nextInt(); \n21" } ] } ], "index": 17, "angle": 0, "type": "code_body" }, { "bbox": [867,160,1280,189], "lines": [ { "bbox": [867,160,1280,189], "spans": [ { "bbox": [867,160,1280,189], "type": "text", "content": "Algorithm 1 Modules for MCTSteg" } ] } ], "index": 19, "angle": 0, "type": "code_caption" } ], "index": 17, "sub_type": "code" } ``` -------------------------------- ### List Block Example Source: https://github.com/opendatalab/mineru/blob/master/docs/en/reference/output_files.md Represents a list of text blocks, often used for section headings or enumerated items. Includes bounding box, type, angle, index, and a list of blocks with their own details. ```json { "bbox": [174,155,818,333], "type": "list", "angle": 0, "index": 11, "blocks": [ { "bbox": [174,157,311,175], "type": "text", "angle": 0, "lines": [ { "bbox": [174,157,311,175], "spans": [ { "bbox": [174,157,311,175], "type": "text", "content": "H.1 Introduction" } ] } ], "index": 3 }, { "bbox": [175,182,464,229], "type": "text", "angle": 0, "lines": [ { "bbox": [175,182,464,229], "spans": [ { "bbox": [175,182,464,229], "type": "text", "content": "H.2 Example: Divide by Zero without Exception Handling" } ] } ], "index": 4 } ], "sub_type": "text" } ``` -------------------------------- ### Install lmdeploy wheel without re-downloading PyTorch Source: https://github.com/opendatalab/mineru/blob/master/docs/en/faq/index.md If you have already installed the cu128 version of PyTorch, use this command to install the lmdeploy wheel without re-downloading PyTorch dependencies. Define the $wheel variable first. ```powershell pip install $wheel --no-dependencies ``` -------------------------------- ### View mineru-api Help Information Source: https://github.com/opendatalab/mineru/blob/master/docs/en/usage/cli_tools.md Use this command to view the available options and their descriptions for the mineru-api tool. This is useful for understanding how to configure and run the API server. ```bash mineru-api --help ``` -------------------------------- ### View mineru-router Help Information Source: https://github.com/opendatalab/mineru/blob/master/docs/en/usage/cli_tools.md Execute this command to see the help information for the mineru-router tool. It lists options for configuring the router, including host and port settings, upstream URLs, and local GPU worker specifications. ```bash mineru-router --help ``` -------------------------------- ### View MinerU CLI Help Source: https://github.com/opendatalab/mineru/blob/master/docs/en/usage/cli_tools.md To access comprehensive help information for the MinerU CLI, append the `--help` flag to the `mineru` command. This displays all available options and their descriptions. ```bash mineru --help Usage: mineru [OPTIONS] Options: -v, --version Show version and exit -p, --path PATH Input file path or directory (required) -o, --output PATH Output directory (required) --api-url TEXT MinerU FastAPI base URL; if omitted, `mineru` starts a temporary local `mineru-api` -m, --method [auto|txt|ocr] Parsing method: auto (default), txt, ocr (pipeline and hybrid* backend only) -b, --backend [pipeline|vlm-engine|hybrid-engine|vlm-http-client|hybrid-http-client] Parsing backend (default: hybrid-engine) --effort [medium|high] Hybrid parsing effort (default: medium) -l, --lang [ch|ch_server|korean|ta|te|ka|th|el|arabic|east_slavic|cyrillic|devanagari] Specify document language (improves OCR accuracy, pipeline backend only) -u, --url TEXT OpenAI-compatible backend URL passed through to the server when using http-client -s, --start INTEGER Starting page number for parsing (0-based) -e, --end INTEGER Ending page number for parsing (0-based) -f, --formula BOOLEAN Enable formula parsing (default: enabled) -t, --table BOOLEAN Enable table parsing (default: enabled) --image-analysis BOOLEAN Enable image/chart analysis for VLM and hybrid backends. Hybrid medium effort automatically disables image/chart analysis (default: enabled) --client-side-output-generation BOOLEAN Generate Markdown and content lists locally from server-returned middle JSON, images, and original files (default: disabled) --help Show help information ``` -------------------------------- ### Download Models with CLI Help Source: https://github.com/opendatalab/mineru/blob/master/docs/en/usage/model_source.md View help information for the mineru-models-download command. This command is used to download models to local storage. ```bash mineru-models-download --help ``` -------------------------------- ### Deploy MinerU using Docker Source: https://github.com/opendatalab/mineru/blob/master/README.md Provides instructions for deploying MinerU using Docker. This method is supported on Linux and Windows with WSL2. ```bash # Docker deployment instructions are provided via a link to external documentation. ``` -------------------------------- ### Sample JSON for Common Fields Source: https://github.com/opendatalab/mineru/blob/master/docs/en/reference/output_files.md Illustrates the structure of common fields in output files, including type, content, and bounding box. ```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] } ] ] ``` -------------------------------- ### Download Models Interactively Source: https://github.com/opendatalab/mineru/blob/master/docs/en/usage/model_source.md Use the interactive command line tool to select and download models. The download process will output the model path and update `mineru.json`. ```bash mineru-models-download ``` -------------------------------- ### Connect to OpenAI Server via HTTP Client Source: https://github.com/opendatalab/mineru/blob/master/docs/en/usage/quick_usage.md Connects to a running MinerU OpenAI compatible server using a hybrid http client. Requires local pipeline dependencies like mineru[pipeline] and torch. ```bash # Start openai compatible server (requires vllm or lmdeploy environment) mineru-openai-server --port 30000 ``` ```bash # In another terminal, connect to openai server via http client mineru -p -o -b hybrid-http-client -u http://127.0.0.1:30000 ``` -------------------------------- ### Configure MinerU-MCP Environment Variables Source: https://github.com/opendatalab/mineru/blob/master/docs/zh/usage/plugin/Cherry_Studio.md Required environment variables for the MinerU-MCP server configuration in Cherry Studio. ```Plain MINERU_API_BASE=https://mineru.net MINERU_API_KEY=您的API密钥 OUTPUT_DIR=./downloads USE_LOCAL_API=false LOCAL_MINERU_API_BASE=http://localhost:8888 ``` -------------------------------- ### Download Docker Compose File Source: https://github.com/opendatalab/mineru/blob/master/docs/en/quick_start/docker_deployment.md Downloads the compose.yaml file for deploying MinerU services using Docker Compose. This file defines configurations for multiple services. ```bash wget https://gcore.jsdelivr.net/gh/opendatalab/MinerU@master/docker/compose.yaml ``` -------------------------------- ### Launch mineru-router across multiple GPUs Source: https://github.com/opendatalab/mineru/blob/master/docs/en/usage/advanced_cli_parameters.md Use the router to manage services across a specified set of GPUs. ```bash CUDA_VISIBLE_DEVICES=0,1,2,3 mineru-router --host 127.0.0.1 --port 8002 ``` -------------------------------- ### Connect to OpenAI Server via HTTP Client Source: https://github.com/opendatalab/mineru/blob/master/docs/en/quick_start/docker_deployment.md Connects to the running OpenAI-compatible server using the mineru CLI. This client requires only CPU and network access. ```bash mineru -p -o -b vlm-http-client -u http://:30000 ``` -------------------------------- ### Run multiple openai-server instances on different GPUs Source: https://github.com/opendatalab/mineru/blob/master/docs/en/usage/advanced_cli_parameters.md Launch separate openai-server services on specific GPUs by setting the environment variable per terminal session. ```bash # In terminal 1 CUDA_VISIBLE_DEVICES=0 mineru-openai-server --engine vllm --port 30000 # In terminal 2 CUDA_VISIBLE_DEVICES=1 mineru-openai-server --engine vllm --port 30001 ``` -------------------------------- ### Sample Data for VLM Backend Output Source: https://github.com/opendatalab/mineru/blob/master/docs/en/reference/output_files.md Provides a sample JSON structure for the VLM backend's model inference results, including header and title blocks. ```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 } ] ] ``` -------------------------------- ### Parse Documents with GPU Acceleration Source: https://github.com/opendatalab/mineru/blob/master/docs/en/quick_start/index.md Parses documents from an input path to an output path using MinerU with GPU acceleration. ```bash mineru -p -o ``` -------------------------------- ### Run multiple fastapi services on different GPUs Source: https://github.com/opendatalab/mineru/blob/master/docs/en/usage/advanced_cli_parameters.md Launch separate mineru-api services on specific GPUs by setting the environment variable per terminal session. ```bash # In terminal 1 CUDA_VISIBLE_DEVICES=0 mineru-api --host 127.0.0.1 --port 8000 # In terminal 2 CUDA_VISIBLE_DEVICES=1 mineru-api --host 127.0.0.1 --port 8001 ``` -------------------------------- ### Parse Documents with CPU Only Source: https://github.com/opendatalab/mineru/blob/master/docs/en/quick_start/index.md Parses documents from an input path to an output path using MinerU in a pure CPU environment by specifying the 'pipeline' backend. ```bash mineru -p -o -b pipeline ``` -------------------------------- ### Configure GPU visibility for MinerU Source: https://github.com/opendatalab/mineru/blob/master/docs/en/usage/advanced_cli_parameters.md Use the CUDA_VISIBLE_DEVICES environment variable to specify which GPU devices are accessible to the MinerU command. ```bash CUDA_VISIBLE_DEVICES=1 mineru -p -o ``` -------------------------------- ### Sample Model Inference Results (Pipeline Backend) Source: https://github.com/opendatalab/mineru/blob/master/docs/en/reference/output_files.md This JSON sample shows the model inference results for the pipeline backend, including classification ID, label, confidence score, bounding box, and index for detected elements. ```json [ { "cls_id": 12, "label": "header", "score": 0.93, "bbox": [ 1217, 104, 1516, 134 ], "index": 2 }, { "cls_id": 6, "label": "doc_title", "score": 0.9751, "bbox": [ 275, 181, 1512, 292 ], "index": 3 }, { "cls_id": 22, "label": "text", "score": 0.9217, "bbox": [ 275, 330, 524, 370 ], "index": 4 } ] ```