collect_env.py 1.04 KB
Newer Older
1
# SPDX-License-Identifier: Apache-2.0
2
# SPDX-FileCopyrightText: Copyright contributors to the vLLM project
3

4
5
from __future__ import annotations

6
import argparse
7
import typing
8
9
10

from vllm.collect_env import main as collect_env_main
from vllm.entrypoints.cli.types import CLISubcommand
11
12
13

if typing.TYPE_CHECKING:
    from vllm.utils import FlexibleArgumentParser
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()]