# mineru-docker-cpu **Repository Path**: MagX/mineru-docker-cpu ## Basic Information - **Project Name**: mineru-docker-cpu - **Description**: No description available - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: main - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2026-08-18 - **Last Updated**: 2026-08-18 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # MinerU API Server - CPU-Only Docker Deployment CPU-only deployment of [MinerU](https://github.com/opendatalab/MinerU) PDF/document parsing API server. MinerU's official Docker deployment requires GPU (based on vllm). This provides a CPU-only alternative using the `pipeline` backend. ## Quick Start ### Option A: Use pre-built image (recommended) ```bash # 1. Clone this repo (for docker-compose.yml) git clone https://github.com/potterwhite/mineru-docker-cpu.git cd mineru-docker-cpu # 2. Pull the pre-built image docker pull potterwhite/mineru-api-cpu:latest # 3. Download pipeline models (~2.4GB) docker compose run --rm mineru-api mineru-models-download -s modelscope -m pipeline # 4. Start the server docker compose up -d # 5. Verify curl http://localhost:8888/health ``` ### Option B: Build from source ```bash git clone https://github.com/potterwhite/mineru-docker-cpu.git cd mineru-docker-cpu docker compose build docker compose run --rm mineru-api mineru-models-download -s modelscope -m pipeline docker compose up -d curl http://localhost:8888/health ``` ## Usage ### Submit a document for parsing (async) ```bash # Step 1: Submit task TASK_ID=$(curl -s -X POST http://localhost:8888/tasks \ -F "files=@document.pdf" \ -F "backend=pipeline" | python3 -c "import sys,json; print(json.load(sys.stdin)['task_id'])") # Step 2: Poll status while true; do STATUS=$(curl -s http://localhost:8888/tasks/$TASK_ID | python3 -c "import sys,json; print(json.load(sys.stdin)['status'])") [[ "$STATUS" == "completed" || "$STATUS" == "failed" ]] && break sleep 10 done # Step 3: Get result python3 -c " import urllib.request, json data = json.loads(urllib.request.urlopen('http://localhost:8888/tasks/$TASK_ID/result', timeout=120).read()) for fname, content in data['results'].items(): print(content['md_content']) " ``` ### API Endpoints | Endpoint | Method | Description | |---|---|---| | `/health` | GET | Health check | | `/tasks` | POST | Submit async parsing task (fields: `files`, `backend`) | | `/tasks/{id}` | GET | Poll task status | | `/tasks/{id}/result` | GET | Get full result JSON with `md_content` | **Important**: Always pass `backend=pipeline` in POST requests. The default backend (`hybrid-auto-engine`) requires GPU. ## Configuration ### Models Models are downloaded to `./models/` and persist across container restarts. The `mineru.json` config is auto-generated by `mineru-models-download` and mounted into the container. - Pipeline models (CPU): ~2.4GB - VLM models (GPU): larger, not needed for CPU-only ### Resource Limits Default memory limit is 12GB. Adjust in `docker-compose.yml`: ```yaml deploy: resources: limits: memory: 12G ``` ### Concurrency Default max concurrent requests: 3. Adjust via `--max-concurrent-requests` flag in the `command` field. ## Supported Formats PDF, DOCX, PPTX, XLS, XLSX, images (PNG, JPG, WebP...) ## Performance | Cores | 10-page PDF | 100-page PDF | |---|---|---| | 4 | ~30-60s | ~5-10min | | 8 | ~15-30s | ~3-5min | | 16 | ~10-15s | ~2-3min | ## Troubleshooting ```bash # Check container status docker compose ps # View logs docker compose logs -f # Restart docker compose restart # Check if OOM killed docker inspect mineru-api | grep -i oom ``` ## License MinerU is licensed under the [MinerU Open Source License](https://github.com/opendatalab/MinerU) (based on Apache 2.0).