|
@@ -1,19 +1,38 @@
|
|
|
services:
|
|
services:
|
|
|
- mineru-vllm-server:
|
|
|
|
|
|
|
+ mineru-openai-server:
|
|
|
image: mineru:latest
|
|
image: mineru:latest
|
|
|
- container_name: mineru-vllm-server
|
|
|
|
|
|
|
+ container_name: mineru-openai-server
|
|
|
restart: always
|
|
restart: always
|
|
|
- profiles: ["vllm-server"]
|
|
|
|
|
|
|
+ profiles: ["openai-server"]
|
|
|
ports:
|
|
ports:
|
|
|
- 30000:30000
|
|
- 30000:30000
|
|
|
environment:
|
|
environment:
|
|
|
MINERU_MODEL_SOURCE: local
|
|
MINERU_MODEL_SOURCE: local
|
|
|
- entrypoint: mineru-vllm-server
|
|
|
|
|
|
|
+ entrypoint: mineru-openai-server
|
|
|
command:
|
|
command:
|
|
|
|
|
+ # ==================== Engine Selection ====================
|
|
|
|
|
+ # WARNING: Only ONE engine can be enabled at a time!
|
|
|
|
|
+ # Choose 'vllm' OR 'lmdeploy' (uncomment one line below)
|
|
|
|
|
+ --engine vllm
|
|
|
|
|
+ # --engine lmdeploy
|
|
|
|
|
+
|
|
|
|
|
+ # ==================== vLLM Engine Parameters ====================
|
|
|
|
|
+ # Uncomment if using --engine vllm
|
|
|
--host 0.0.0.0
|
|
--host 0.0.0.0
|
|
|
--port 30000
|
|
--port 30000
|
|
|
- # --data-parallel-size 2 # If using multiple GPUs, increase throughput using vllm's multi-GPU parallel mode
|
|
|
|
|
- # --gpu-memory-utilization 0.5 # If running on a single GPU and encountering VRAM shortage, reduce the KV cache size by this parameter, if VRAM issues persist, try lowering it further to `0.4` or below.
|
|
|
|
|
|
|
+ # Multi-GPU configuration (increase throughput)
|
|
|
|
|
+ # --data-parallel-size 2
|
|
|
|
|
+ # Single GPU memory optimization (reduce if VRAM insufficient)
|
|
|
|
|
+ # --gpu-memory-utilization 0.5 # Try 0.4 or lower if issues persist
|
|
|
|
|
+
|
|
|
|
|
+ # ==================== LMDeploy Engine Parameters ====================
|
|
|
|
|
+ # Uncomment if using --engine lmdeploy
|
|
|
|
|
+ # --server-name 0.0.0.0
|
|
|
|
|
+ # --server-port 30000
|
|
|
|
|
+ # Multi-GPU configuration (increase throughput)
|
|
|
|
|
+ # --dp 2
|
|
|
|
|
+ # Single GPU memory optimization (reduce if VRAM insufficient)
|
|
|
|
|
+ # --cache-max-entry-count 0.5 # Try 0.4 or lower if issues persist
|
|
|
ulimits:
|
|
ulimits:
|
|
|
memlock: -1
|
|
memlock: -1
|
|
|
stack: 67108864
|
|
stack: 67108864
|
|
@@ -25,38 +44,9 @@ services:
|
|
|
reservations:
|
|
reservations:
|
|
|
devices:
|
|
devices:
|
|
|
- driver: nvidia
|
|
- driver: nvidia
|
|
|
- device_ids: ["0"]
|
|
|
|
|
|
|
+ device_ids: ["0"] # Modify for multiple GPUs: ["0", "1"]
|
|
|
capabilities: [gpu]
|
|
capabilities: [gpu]
|
|
|
|
|
|
|
|
- mineru-lmdeploy-server:
|
|
|
|
|
- image: mineru:latest
|
|
|
|
|
- container_name: mineru-lmdeploy-server
|
|
|
|
|
- restart: always
|
|
|
|
|
- profiles: [ "lmdeploy-server" ]
|
|
|
|
|
- ports:
|
|
|
|
|
- - 30000:30000
|
|
|
|
|
- environment:
|
|
|
|
|
- MINERU_MODEL_SOURCE: local
|
|
|
|
|
- entrypoint: mineru-lmdeploy-server
|
|
|
|
|
- command:
|
|
|
|
|
- --host 0.0.0.0
|
|
|
|
|
- --port 30000
|
|
|
|
|
- # --dp 2 # If using multiple GPUs, increase throughput using lmdeploy's multi-GPU parallel mode
|
|
|
|
|
- # --cache-max-entry-count 0.5 # If running on a single GPU and encountering VRAM shortage, reduce the KV cache size by this parameter, if VRAM issues persist, try lowering it further to `0.4` or below.
|
|
|
|
|
- ulimits:
|
|
|
|
|
- memlock: -1
|
|
|
|
|
- stack: 67108864
|
|
|
|
|
- ipc: host
|
|
|
|
|
- healthcheck:
|
|
|
|
|
- test: [ "CMD-SHELL", "curl -f http://localhost:30000/health || exit 1" ]
|
|
|
|
|
- deploy:
|
|
|
|
|
- resources:
|
|
|
|
|
- reservations:
|
|
|
|
|
- devices:
|
|
|
|
|
- - driver: nvidia
|
|
|
|
|
- device_ids: [ "0" ]
|
|
|
|
|
- capabilities: [ gpu ]
|
|
|
|
|
-
|
|
|
|
|
mineru-api:
|
|
mineru-api:
|
|
|
image: mineru:latest
|
|
image: mineru:latest
|
|
|
container_name: mineru-api
|
|
container_name: mineru-api
|
|
@@ -68,11 +58,21 @@ services:
|
|
|
MINERU_MODEL_SOURCE: local
|
|
MINERU_MODEL_SOURCE: local
|
|
|
entrypoint: mineru-api
|
|
entrypoint: mineru-api
|
|
|
command:
|
|
command:
|
|
|
|
|
+ # ==================== Server Configuration ====================
|
|
|
--host 0.0.0.0
|
|
--host 0.0.0.0
|
|
|
--port 8000
|
|
--port 8000
|
|
|
- # parameters for vllm-engine
|
|
|
|
|
- # --data-parallel-size 2 # If using multiple GPUs, increase throughput using vllm's multi-GPU parallel mode
|
|
|
|
|
- # --gpu-memory-utilization 0.5 # If running on a single GPU and encountering VRAM shortage, reduce the KV cache size by this parameter, if VRAM issues persist, try lowering it further to `0.4` or below.
|
|
|
|
|
|
|
+
|
|
|
|
|
+ # ==================== vLLM Engine Parameters ====================
|
|
|
|
|
+ # Multi-GPU configuration
|
|
|
|
|
+ # --data-parallel-size 2
|
|
|
|
|
+ # Single GPU memory optimization
|
|
|
|
|
+ # --gpu-memory-utilization 0.5 # Try 0.4 or lower if VRAM insufficient
|
|
|
|
|
+
|
|
|
|
|
+ # ==================== LMDeploy Engine Parameters ====================
|
|
|
|
|
+ # Multi-GPU configuration
|
|
|
|
|
+ # --dp 2
|
|
|
|
|
+ # Single GPU memory optimization
|
|
|
|
|
+ # --cache-max-entry-count 0.5 # Try 0.4 or lower if VRAM insufficient
|
|
|
ulimits:
|
|
ulimits:
|
|
|
memlock: -1
|
|
memlock: -1
|
|
|
stack: 67108864
|
|
stack: 67108864
|
|
@@ -82,8 +82,8 @@ services:
|
|
|
reservations:
|
|
reservations:
|
|
|
devices:
|
|
devices:
|
|
|
- driver: nvidia
|
|
- driver: nvidia
|
|
|
- device_ids: [ "0" ]
|
|
|
|
|
- capabilities: [ gpu ]
|
|
|
|
|
|
|
+ device_ids: ["0"] # Modify for multiple GPUs: ["0", "1"]
|
|
|
|
|
+ capabilities: [gpu]
|
|
|
|
|
|
|
|
mineru-gradio:
|
|
mineru-gradio:
|
|
|
image: mineru:latest
|
|
image: mineru:latest
|
|
@@ -96,14 +96,30 @@ services:
|
|
|
MINERU_MODEL_SOURCE: local
|
|
MINERU_MODEL_SOURCE: local
|
|
|
entrypoint: mineru-gradio
|
|
entrypoint: mineru-gradio
|
|
|
command:
|
|
command:
|
|
|
|
|
+ # ==================== Gradio Server Configuration ====================
|
|
|
--server-name 0.0.0.0
|
|
--server-name 0.0.0.0
|
|
|
--server-port 7860
|
|
--server-port 7860
|
|
|
- --enable-vllm-engine true # Enable the vllm engine for Gradio
|
|
|
|
|
- # --enable-api false # If you want to disable the API, set this to false
|
|
|
|
|
- # --max-convert-pages 20 # If you want to limit the number of pages for conversion, set this to a specific number
|
|
|
|
|
- # parameters for vllm-engine
|
|
|
|
|
- # --data-parallel-size 2 # If using multiple GPUs, increase throughput using vllm's multi-GPU parallel mode
|
|
|
|
|
- # --gpu-memory-utilization 0.5 # If running on a single GPU and encountering VRAM shortage, reduce the KV cache size by this parameter, if VRAM issues persist, try lowering it further to `0.4` or below.
|
|
|
|
|
|
|
+
|
|
|
|
|
+ # ==================== Gradio Feature Settings ====================
|
|
|
|
|
+ # --enable-api false # Disable API endpoint
|
|
|
|
|
+ # --max-convert-pages 20 # Limit conversion page count
|
|
|
|
|
+
|
|
|
|
|
+ # ==================== Engine Selection ====================
|
|
|
|
|
+ # WARNING: Only ONE engine can be enabled at a time!
|
|
|
|
|
+
|
|
|
|
|
+ # Option 1: vLLM Engine (recommended for most users)
|
|
|
|
|
+ --enable-vllm-engine true
|
|
|
|
|
+ # Multi-GPU configuration
|
|
|
|
|
+ # --data-parallel-size 2
|
|
|
|
|
+ # Single GPU memory optimization
|
|
|
|
|
+ # --gpu-memory-utilization 0.5 # Try 0.4 or lower if VRAM insufficient
|
|
|
|
|
+
|
|
|
|
|
+ # Option 2: LMDeploy Engine
|
|
|
|
|
+ # --enable-lmdeploy-engine true
|
|
|
|
|
+ # Multi-GPU configuration
|
|
|
|
|
+ # --dp 2
|
|
|
|
|
+ # Single GPU memory optimization
|
|
|
|
|
+ # --cache-max-entry-count 0.5 # Try 0.4 or lower if VRAM insufficient
|
|
|
ulimits:
|
|
ulimits:
|
|
|
memlock: -1
|
|
memlock: -1
|
|
|
stack: 67108864
|
|
stack: 67108864
|
|
@@ -113,5 +129,5 @@ services:
|
|
|
reservations:
|
|
reservations:
|
|
|
devices:
|
|
devices:
|
|
|
- driver: nvidia
|
|
- driver: nvidia
|
|
|
- device_ids: [ "0" ]
|
|
|
|
|
- capabilities: [ gpu ]
|
|
|
|
|
|
|
+ device_ids: ["0"] # Modify for multiple GPUs: ["0", "1"]
|
|
|
|
|
+ capabilities: [gpu]
|