https://github.com/opendatalab/MinerU/
https://hf-mirror.com/opendatalab/MinerU2.0-2505-0.9B
1、基于lmsysorg/sglang:v0.4.7-cu124构建mineru:v2-sh
# Use the official sglang image
FROM lmsysorg/sglang:v0.4.7-cu124
# install mineru latest
RUN python3 -m pip install -U 'mineru[core]' -i <https://mirrors.aliyun.com/pypi/simple> --break-system-packages
# Download models and update the configuration file
RUN mineru-models-download -s modelscope -m all
# Set the entry point to activate the virtual environment and run the command line tool
ENTRYPOINT ["/bin/sh", "-c", "export MINERU_MODEL_SOURCE=local; exec \"$@\"", "--"]
2、启动服务
sudo docker run --gpus '"device=0"' \
--shm-size 32g \
-p 30000:30000 \
--ipc=host \
mineru:v2-sh \
mineru-sglang-server --host 0.0.0.0 --port 30000
3、启动日志
WARNING:sglang.srt.models.registry:Ignore import error when loading sglang.srt.models.torch_native_llama. tensor model parallel group is not initialized
[2025-06-26 02:03:00] server_args=ServerArgs(model_path='/root/.cache/modelscope/hub/models/OpenDataLab/MinerU2___0-2505-0___9B', tokenizer_path='/root/.cache/modelscope/hub/models/OpenDataLab/MinerU2___0-2505-0___9B', tokenizer_mode='auto', skip_tokenizer_init=False, load_format='auto', trust_remote_code=False, dtype='auto', kv_cache_dtype='auto', quantization=None, quantization_param_path=None, context_length=None, device='cuda', served_model_name='/root/.cache/modelscope/hub/models/OpenDataLab/MinerU2___0-2505-0___9B', chat_template='chatml', completion_template=None, is_embedding=False, enable_multimodal=None, revision=None, impl='auto', host='0.0.0.0', port=30000, mem_fraction_static=0.88, max_running_requests=None, max_total_tokens=None, chunked_prefill_size=8192, max_prefill_tokens=16384, schedule_policy='fcfs', schedule_conservativeness=1.0, cpu_offload_gb=0, page_size=1, tp_size=1, pp_size=1, max_micro_batch_size=None, stream_interval=1, stream_output=False, random_seed=989644197, constrained_json_whitespace_pattern=None, watchdog_timeout=300, dist_timeout=None, download_dir=None, base_gpu_id=0, gpu_id_step=1, log_level='info', log_level_http=None, log_requests=False, log_requests_level=0, show_time_cost=False, enable_metrics=False, bucket_time_to_first_token=None, bucket_e2e_request_latency=None, bucket_inter_token_latency=None, collect_tokens_histogram=False, decode_log_interval=40, enable_request_time_stats_logging=False, kv_events_config=None, api_key=None, file_storage_path='sglang_storage', enable_cache_report=False, reasoning_parser=None, dp_size=1, load_balance_method='round_robin', ep_size=1, dist_init_addr=None, nnodes=1, node_rank=0, json_model_override_args='{}', preferred_sampling_params=None, lora_paths=None, max_loras_per_batch=8, lora_backend='triton', attention_backend=None, ds_channel_config_path=None, ds_heavy_channel_num=32, ds_heavy_token_num=256, ds_heavy_channel_type='qk', ds_sparse_decode_threshold=4096, disable_radix_cache=False, disable_cuda_graph=False, disable_cuda_graph_padding=False, enable_nccl_nvls=False, enable_tokenizer_batch_encode=False, disable_outlines_disk_cache=False, disable_custom_all_reduce=False, enable_mscclpp=False, disable_overlap_schedule=False, enable_mixed_chunk=False, enable_dp_attention=False, enable_dp_lm_head=False, enable_two_batch_overlap=False, enable_ep_moe=False, enable_deepep_moe=False, deepep_mode='auto', ep_num_redundant_experts=0, ep_dispatch_algorithm='static', init_expert_location='trivial', enable_eplb=False, eplb_algorithm='auto', eplb_rebalance_num_iterations=1000, eplb_rebalance_layers_per_chunk=None, expert_distribution_recorder_mode=None, expert_distribution_recorder_buffer_size=1000, enable_expert_distribution_metrics=False, deepep_config=None, enable_torch_compile=False, torch_compile_max_bs=32, cuda_graph_max_bs=None, cuda_graph_bs=None, torchao_config='', enable_nan_detection=False, enable_p2p_check=False, triton_attention_reduce_in_fp32=False, triton_attention_num_kv_splits=8, num_continuous_decode_steps=1, delete_ckpt_after_loading=False, enable_memory_saver=False, allow_auto_truncate=False, enable_custom_logit_processor=True, tool_call_parser=None, enable_hierarchical_cache=False, hicache_ratio=2.0, hicache_size=0, hicache_write_policy='write_through_selective', flashinfer_mla_disable_ragged=False, warmups=None, moe_dense_tp_size=None, disable_shared_experts_fusion=False, disable_chunked_prefix_cache=False, disable_fast_image_processor=False, mm_attention_backend=None, debug_tensor_dump_output_folder=None, debug_tensor_dump_input_file=None, debug_tensor_dump_inject=False, disaggregation_mode='null', disaggregation_bootstrap_port=8998, disaggregation_transfer_backend='mooncake', disaggregation_ib_device=None, pdlb_url=None)
`use_fast` is set to `True` but the image processor class does not have a fast version. Falling back to the slow version.
[2025-06-26 02:03:01] Use chat template for the OpenAI-compatible API server: chatml
WARNING:sglang.srt.models.registry:Ignore import error when loading sglang.srt.models.torch_native_llama. tensor model parallel group is not initialized
`use_fast` is set to `True` but the image processor class does not have a fast version. Falling back to the slow version.
WARNING:sglang.srt.models.registry:Ignore import error when loading sglang.srt.models.torch_native_llama. tensor model parallel group is not initialized
[2025-06-26 02:03:07] Attention backend not set. Use flashinfer backend by default.
[2025-06-26 02:03:07] Automatically reduce --mem-fraction-static to 0.792 because this is a multimodal model.
[2025-06-26 02:03:07] Init torch distributed begin.
[2025-06-26 02:03:08] Init torch distributed ends. mem usage=0.00 GB
[2025-06-26 02:03:08] Load weight begin. avail mem=78.65 GB
Loading safetensors checkpoint shards: 0% Completed | 0/1 [00:00<?, ?it/s]
Loading safetensors checkpoint shards: 100% Completed | 1/1 [00:00<00:00, 2.17it/s]
Loading safetensors checkpoint shards: 100% Completed | 1/1 [00:00<00:00, 2.16it/s]
[2025-06-26 02:03:09] Load weight end. type=Mineru2QwenForCausalLM, dtype=torch.bfloat16, avail mem=76.83 GB, mem usage=1.82 GB.
[2025-06-26 02:03:09] KV Cache is allocated. #tokens: 5282908, K size: 30.23 GB, V size: 30.23 GB
[2025-06-26 02:03:09] Memory pool end. avail mem=15.80 GB
[2025-06-26 02:03:09] Capture cuda graph begin. This can take up to several minutes. avail mem=15.31 GB
[2025-06-26 02:03:09] Capture cuda graph bs [1, 2, 4, 8, 16, 24, 32, 40, 48, 56, 64, 72, 80, 88, 96, 104, 112, 120, 128, 136, 144, 152, 160]
Capturing batches (avail_mem=13.94 GB): 100%|██████████| 23/23 [00:22<00:00, 1.01it/s]
[2025-06-26 02:03:32] Capture cuda graph end. Time elapsed: 22.96 s. mem usage=1.38 GB. avail mem=13.93 GB.
[2025-06-26 02:03:32] max_total_num_tokens=5282908, chunked_prefill_size=8192, max_prefill_tokens=16384, max_running_requests=4096, context_len=32768, available_gpu_mem=13.93 GB
[2025-06-26 02:03:33] INFO: Started server process [1]
[2025-06-26 02:03:33] INFO: Waiting for application startup.
[2025-06-26 02:03:33] INFO: Application startup complete.
[2025-06-26 02:03:33] INFO: Uvicorn running on <http://0.0.0.0:30000> (Press CTRL+C to quit)
[2025-06-26 02:03:34] INFO: 127.0.0.1:38352 - "GET /get_model_info HTTP/1.1" 200 OK
[2025-06-26 02:03:34] Prefill batch. #new-seq: 1, #new-token: 6, #cached-token: 0, token usage: 0.00, #running-req: 0, #queue-req: 0
[2025-06-26 02:03:38] INFO: 127.0.0.1:38356 - "POST /generate HTTP/1.1" 200 OK
[2025-06-26 02:03:38] The server is fired up and ready to roll!
[2025-06-26 02:22:08] Prefill batch. #new-seq: 1, #new-token: 1, #cached-token: 0, token usage: 0.00, #running-req: 0, #queue-req: 0
[2025-06-26 02:22:09] INFO: 10.33.27.93:54441 - "GET /health_generate HTTP/1.1" 200 OK
[2025-06-26 02:22:10] INFO: 10.33.27.93:54444 - "GET /get_model_info HTTP/1.1" 200 OK
4、调用服务
mineru
doclayout_yolo
ultralytics
rapid_table
openai
https://github.com/opendatalab/MinerU/blob/master/demo/demo.py
客户端显示的日志

服务端的日志

{
"bucket_info": {
"bucket-name-1": [
"ak",
"sk",
"endpoint"
],
"bucket-name-2": [
"ak",
"sk",
"endpoint"
]
},
"latex-delimiter-config": {
"display": {
"left": "$$",
"right": "$$"
},
"inline": {
"left": "$",
"right": "$"
}
},
"llm-aided-config": {
"title_aided": {
"api_key": "your_api_key",
"base_url": "<https://dashscope.aliyuncs.com/compatible-mode/v1>",
"model": "qwen2.5-32b-instruct",
"enable": false
}
},
"models-dir": {
"pipeline": "/root/.cache/modelscope/hub/models/OpenDataLab/PDF-Extract-Kit-1___0",
"vlm": "/root/.cache/modelscope/hub/models/OpenDataLab/MinerU2___0-2505-0___9B"
},
"config_version": "1.3.0"
}
MinerU2.0-2505-0.9B(2.0G):https://huggingface.co/opendatalab/MinerU2.0-2505-0.9B,单模型涵盖所有文档解析任务