[Frontend] improve vllm run-batch --help display (#19187)

Signed-off-by: reidliu41 <reid201711@gmail.com>
Co-authored-by: reidliu41 <reid201711@gmail.com>
This commit is contained in:
Reid
2025-06-05 11:16:25 +00:00
committed by GitHub
co-authored by reidliu41
parent 188a4590d8
commit 1aeb925f34
4 changed files with 23 additions and 9 deletions
+11 -3
View File
@@ -14,8 +14,9 @@ from vllm.logger import init_logger
logger = init_logger(__name__)
VLLM_SERVE_PARSER_EPILOG = (
"Tip: Use `vllm serve --help=<keyword>` to explore arguments from help.\n"
VLLM_SUBCMD_PARSER_EPILOG = (
"Tip: Use `vllm [serve|run-batch] --help=<keyword>` "
"to explore arguments from help.\n"
" - To view a argument group: --help=ModelConfig\n"
" - To view a single argument: --help=max-num-seqs\n"
" - To search by keyword: --help=max\n"
@@ -173,8 +174,15 @@ def _validate_truncation_size(
return truncate_prompt_tokens
def show_filtered_argument_or_group_from_help(parser):
def show_filtered_argument_or_group_from_help(parser, subcommand_name):
import sys
# Only handle --help=<keyword> for the current subcommand.
# Since subparser_init() runs for all subcommands during CLI setup,
# we skip processing if the subcommand name is not in sys.argv.
if subcommand_name not in sys.argv:
return
for arg in sys.argv:
if arg.startswith('--help='):
search_keyword = arg.split('=', 1)[1]