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[core]" -i https://mirrors.aliyun.com/pypi/simple
git clone https://github.com/opendatalab/MinerU.git
cd MinerU
uv pip install -e .[core] -i https://mirrors.aliyun.com/pypi/simple
[!NOTE] Linux和macOS系统安装后自动支持cuda/mps加速,Windows用户如需使用cuda加速, 请前往 Pytorch官网 选择合适的cuda版本安装pytorch。
如需使用 sglang 加速 VLM 模型推理,请选择合适的方式安装完整版本:
使用uv或pip安装
uv pip install -U "mineru[all]" -i https://mirrors.aliyun.com/pypi/simple
从源码安装:
uv pip install -e .[all] -i https://mirrors.aliyun.com/pypi/simple
[!TIP] sglang安装过程中如发生异常,请参考sglang官方文档尝试解决或直接使用docker方式安装。
使用 Dockerfile 构建镜像:
wget https://gcore.jsdelivr.net/gh/opendatalab/MinerU@master/docker/china/Dockerfile
docker build -t mineru-sglang:latest -f Dockerfile .
启动 Docker 容器:
docker run --gpus all \
--shm-size 32g \
-p 30000:30000 \
--ipc=host \
mineru-sglang:latest \
mineru-sglang-server --host 0.0.0.0 --port 30000
或使用 Docker Compose 启动:
wget https://gcore.jsdelivr.net/gh/opendatalab/MinerU@master/docker/compose.yaml
docker compose -f compose.yaml up -d
[!TIP] Dockerfile默认使用
lmsysorg/sglang:v0.4.8.post1-cu126作为基础镜像,支持Turing/Ampere/Ada Lovelace/Hopper平台, 如您使用较新的Blackwell平台,请将基础镜像修改为lmsysorg/sglang:v0.4.8.post1-cu128-b200。
uv pip install -U mineru -i https://mirrors.aliyun.com/pypi/simple
mineru -p <input_path> -o <output_path> -b vlm-sglang-client -u http://<host_ip>:<port>