collect_env.py 1.07 KB
Newer Older
1
# SPDX-License-Identifier: Apache-2.0
2
# SPDX-FileCopyrightText: Copyright contributors to the vLLM project
3
4
5
6
7
8
9
10
11

import argparse

from vllm.collect_env import main as collect_env_main
from vllm.entrypoints.cli.types import CLISubcommand
from vllm.utils import FlexibleArgumentParser


class CollectEnvSubcommand(CLISubcommand):
Reid's avatar
Reid committed
12
    """The `collect-env` subcommand for the vLLM CLI. """
13
14
15
16
17
18
19
20
21
22
23
24
25

    def __init__(self):
        self.name = "collect-env"
        super().__init__()

    @staticmethod
    def cmd(args: argparse.Namespace) -> None:
        """Collect information about the environment."""
        collect_env_main()

    def subparser_init(
            self,
            subparsers: argparse._SubParsersAction) -> FlexibleArgumentParser:
Reid's avatar
Reid committed
26
        collect_env_parser = subparsers.add_parser(
27
28
29
30
            "collect-env",
            help="Start collecting environment information.",
            description="Start collecting environment information.",
            usage="vllm collect-env")
Reid's avatar
Reid committed
31
        return collect_env_parser
32
33
34
35


def cmd_init() -> list[CLISubcommand]:
    return [CollectEnvSubcommand()]