Parses vLLM args based on CLI inputs. Currently uses argparse because vLLM doesn't expose Python models for all of the config options we want to support.
(cli_args: Dict[str, str])
| 112 | |
| 113 | |
| 114 | def parse_vllm_args(cli_args: Dict[str, str]): |
| 115 | """Parses vLLM args based on CLI inputs. |
| 116 | |
| 117 | Currently uses argparse because vLLM doesn't expose Python models for all of the |
| 118 | config options we want to support. |
| 119 | """ |
| 120 | arg_parser = FlexibleArgumentParser( |
| 121 | description="vLLM OpenAI-Compatible RESTful API server." |
| 122 | ) |
| 123 | |
| 124 | parser = make_arg_parser(arg_parser) |
| 125 | arg_strings = [] |
| 126 | for key, value in cli_args.items(): |
| 127 | arg_strings.extend([f"--{key}", str(value)]) |
| 128 | logger.info(arg_strings) |
| 129 | parsed_args = parser.parse_args(args=arg_strings) |
| 130 | return parsed_args |
| 131 | |
| 132 | |
| 133 | def build_app(cli_args: Dict[str, str]) -> serve.Application: |