A high-throughput and memory-efficient inference and serving engine for LLMs
Mirrored from https://github.com/tduncan-lum/Nvidia-Optimization-Stack---VLLM.git
Synced Nov 14, 05:30 UTC
[Bugfix] Fix --config arg expansion called from api_server.py (#23944)
Signed-off-by: Jean-Francois Dube <dubejf+gh@gmail.com> Co-authored-by: Jean-Francois Dube <dubejf+gh@gmail.com> Co-authored-by: Cyrus Leung <tlleungac@connect.ust.hk>
dubejf committed
Aug 30, 2025 at 00:36 UTC
5b31cb1781e594aae29d878b1acde3e2f900bc41
2 files changed
+27
-2
tests/entrypoints/openai/test_cli_args.py
+22
@@ -27,6 +27,28 @@ def serve_parser():
27
return make_arg_parser(parser)
28
29
30
+### Test config parsing
31
+def test_config_arg_parsing(serve_parser, cli_config_file):
32
+ args = serve_parser.parse_args([])
33
+ assert args.port == 8000
34
+ args = serve_parser.parse_args(['--config', cli_config_file])
35
+ assert args.port == 12312
36
+ args = serve_parser.parse_args([
37
+ '--config',
38
+ cli_config_file,
39
+ '--port',
40
+ '9000',
41
+ ])
42
+ assert args.port == 9000
43
+ args = serve_parser.parse_args([
44
+ '--port',
45
+ '9000',
46
+ '--config',
47
+ cli_config_file,
48
+ ])
49
+ assert args.port == 9000
50
+
51
+
52
### Tests for LoRA module parsing
53
def test_valid_key_value_format(serve_parser):
54
# Test old format: name=path
vllm/utils/__init__.py
+5
-2
@@ -1976,13 +1976,16 @@ class FlexibleArgumentParser(ArgumentParser):
1976
1977
config_args = self.load_config_file(file_path)
1978
1979
- # 0th index is for {serve,chat,complete}
1979
+ # 0th index might be the sub command {serve,chat,complete,...}
1980
# optionally followed by model_tag (only for serve)
1981
# followed by config args
1982
# followed by rest of cli args.
1983
# maintaining this order will enforce the precedence
1984
# of cli > config > defaults
1985
- if args[0] == "serve":
1985
+ if args[0].startswith('-'):
1986
+ # No sub command (e.g., api_server entry point)
1987
+ args = config_args + args[0:index] + args[index + 2:]
1988
+ elif args[0] == "serve":
1989
model_in_cli = len(args) > 1 and not args[1].startswith('-')
1990
model_in_config = any(arg == '--model' for arg in config_args)
1991