".buildkite/vscode:/vscode.git/clone" did not exist on "3eab7fefd27cec378e88fa486ca0dd57fac29e08"
collect_env.py 1.08 KB
Newer Older
1
# SPDX-License-Identifier: Apache-2.0
2
# SPDX-FileCopyrightText: Copyright contributors to the vLLM project
3
4

import argparse
5
import typing
6
7
8

from vllm.collect_env import main as collect_env_main
from vllm.entrypoints.cli.types import CLISubcommand
9
10

if typing.TYPE_CHECKING:
11
    from vllm.utils.argparse_utils import FlexibleArgumentParser
12
13
else:
    FlexibleArgumentParser = argparse.ArgumentParser
14
15
16


class CollectEnvSubcommand(CLISubcommand):
17
18
    """The `collect-env` subcommand for the vLLM CLI."""

19
    name = "collect-env"
20
21
22
23
24
25
26

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

    def subparser_init(
27
28
        self, subparsers: argparse._SubParsersAction
    ) -> FlexibleArgumentParser:
29
        return subparsers.add_parser(
30
31
32
            "collect-env",
            help="Start collecting environment information.",
            description="Start collecting environment information.",
33
34
            usage="vllm collect-env",
        )
35
36
37
38


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