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):
Reid's avatar
Reid committed
17
    """The `collect-env` subcommand for the vLLM CLI. """
18
    name = "collect-env"
19
20
21
22
23
24
25
26
27

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

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


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