-
-
Notifications
You must be signed in to change notification settings - Fork 4.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Frontend]-config-cli-args #7737
Changes from 4 commits
0d304d7
f36dc39
2bca2fa
ab570d1
7bfc6cb
1779536
ff93954
a9492c4
05164e0
7014a4e
63413aa
4d6f930
0d41c4c
8d84671
c5af059
f6529e3
6e1fe11
175a0d5
7c06e17
98208b3
3d72a70
10054a4
b87593b
56a7054
2c7df07
7b77458
a5b1a3a
d189970
ae178fb
0c1b302
743aee5
295f675
960b047
b6f130d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
# The CLI entrypoint to vLLM. | ||
import argparse | ||
import asyncio | ||
import configparser | ||
import os | ||
import signal | ||
import sys | ||
|
@@ -25,6 +26,13 @@ def signal_handler(sig, frame): | |
|
||
|
||
def serve(args: argparse.Namespace) -> None: | ||
if args.config: | ||
config_parser = configparser.ConfigParser() | ||
config_parser.read(args.config) | ||
|
||
for key, value in config_parser.items(): | ||
setattr(args, key, value) | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. if we have There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. i like that exclusivity as well. let me patch it. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. wait, after a second though, it is not clear to me if we should make it mutually exclusive There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. for example. if I have a config that has lots of options, I might want to simply reuse it and override some values from the commandline, e.g. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. i see what you mean, i had the same picture in mind as well. @youkaichao howa bout this? lets not make it exclusive to allow flexibility, BUT also raise an exception in case an option is specified in both cli and config files. this will prevent users from unknowingly launching their server with stale configs/args... There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. or print an INFO level logging, telling users explicitly that some arg value from commandline takes precedence ? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. deal 🤝.. let me go home and patch this. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. done. made cli the override |
||
# The default value of `--model` | ||
if args.model != EngineArgs.model: | ||
raise ValueError( | ||
|
@@ -125,6 +133,15 @@ def main(): | |
serve_parser.add_argument("model_tag", | ||
type=str, | ||
help="The model tag to serve") | ||
serve_parser.add_argument( | ||
"--config", | ||
type=str, | ||
required=False, | ||
default='', | ||
help="Read CLI options from a config file." | ||
"Must be a YAML with the following options:" | ||
"https://docs.vllm.ai/en/latest/serving/openai_compatible_server.html#command-line-arguments-for-the-server" | ||
) | ||
serve_parser = make_arg_parser(serve_parser) | ||
serve_parser.set_defaults(dispatch_function=serve) | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
--model SOME_MODEL
can be in theconfig.yaml
as well?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done. edited the doc.