Advanced Command Line Parameters
Pass-through of inference engine parameters
Parameter Passing Instructions
Tip
- Router accepts only its documented worker options and no longer forwards arbitrary vllm/lmdeploy parameters. Configure those parameters on independently deployed upstream services.
- Command-line options support both
--foo valueand--foo=valueforms - If you want to learn more about
vllmparameter usage, please refer to the vllm official documentation - If you want to learn more about
lmdeployparameter usage, please refer to the lmdeploy official documentation
GPU Device Selection and Configuration
CUDA_VISIBLE_DEVICES Basic Usage
Tip
- In any situation, you can specify visible GPU devices by adding the
CUDA_VISIBLE_DEVICESenvironment variable at the beginning of the command line. For example:CUDA_VISIBLE_DEVICES=1 mineru-kit parse <input_path> -o <output_path> - This method applies to the model-serving and parsing commands documented below; it does not apply to
mineru-router.
Common Device Configuration Examples
Tip
Here are some common CUDA_VISIBLE_DEVICES setting examples:
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
Practical Application Scenarios
Tip
Here are some possible usage scenarios:
-
If you have multiple GPUs and need to start two
openai-serverservices on GPU 0 and GPU 1, each listening on a different port, you can use the following commands:# In terminal 1 CUDA_VISIBLE_DEVICES=0 mineru-kit vlm-server --engine vllm --port 30000 # In terminal 2 CUDA_VISIBLE_DEVICES=1 mineru-kit vlm-server --engine vllm --port 30001 -
If you have multiple GPUs and need to start two
fastapiservices on GPU 0 and GPU 1, each listening on a different port, you can use the following commands:# In terminal 1 CUDA_VISIBLE_DEVICES=0 mineru-kit api-server --host 127.0.0.1 --port 8000 # In terminal 2 CUDA_VISIBLE_DEVICES=1 mineru-kit api-server --host 127.0.0.1 --port 8001 -
If you have multiple GPUs and want to use
routerto launch and managefastapiservices across four GPUs, you can use the following command:mineru-kit router --host 127.0.0.1 --port 8002 --local-gpus 0,1,2,3