diff --git a/vllm_omni/entrypoints/cli/logo.py b/vllm_omni/entrypoints/cli/logo.py new file mode 100644 index 000000000..addfe3593 --- /dev/null +++ b/vllm_omni/entrypoints/cli/logo.py @@ -0,0 +1,45 @@ +import re + +from vllm.logger import current_formatter_type, init_logger + +logger = init_logger(__name__) + +ORANGE = "\033[38;5;208m" +BLUE = "\033[34m" +WHITE = "\033[97m" +PURPLE = "\033[35m" +RESET = "\033[0m" + +# Official vLLM Logo Base +VLLM_L1 = f" {WHITE}█ █ █▄ ▄█{RESET}" +VLLM_L2 = f" {ORANGE}▄▄{RESET} {BLUE}▄█{RESET} {WHITE}█ █ █ ▀▄▀ █{RESET}" +VLLM_L3 = f" {ORANGE}█{RESET}{BLUE}▄█▀{RESET} {WHITE}█ █ █ █{RESET}" +VLLM_L4 = f" {BLUE}▀▀{RESET} {WHITE}▀▀▀▀▀ ▀▀▀▀▀ ▀ ▀{RESET}" + +GAP_L1 = " " +GAP_L2 = f"{WHITE} ▄▄▄ {RESET}" +GAP_L3 = f"{WHITE} {RESET}" +GAP_L4 = " " + +O_L1 = f"{BLUE} ▄▀▀{ORANGE}▀▀▄ {RESET}" +O_L2 = f"{BLUE} █ {ORANGE}█ {RESET}" +O_L3 = f"{BLUE} █ {ORANGE}█ {RESET}" +O_L4 = f"{PURPLE} ▀▀▀▀ {RESET}" +MNI_L1 = f"{WHITE}█▄ ▄█ █▄ █ ▀█▀ {RESET}" +MNI_L2 = f"{WHITE}█ ▀▄▀ █ █ ▀▄ █ █ {RESET}" +MNI_L3 = f"{WHITE}█ █ █ ▀▄█ █ {RESET}" +MNI_L4 = f"{WHITE}▀ ▀ ▀ ▀ ▀▀▀ {RESET}" + +LOGO = f"""{VLLM_L1}{GAP_L1}{O_L1}{MNI_L1} +{VLLM_L2}{GAP_L2}{O_L2}{MNI_L2} +{VLLM_L3}{GAP_L3}{O_L3}{MNI_L3} +{VLLM_L4}{GAP_L4}{O_L4}{MNI_L4} +""" + + +_ANSI_RE = re.compile(r"\033\[[0-9;]*m") + + +def log_logo() -> None: + logo = LOGO if current_formatter_type(logger) == "color" else _ANSI_RE.sub("", LOGO) + logger.info(logo) diff --git a/vllm_omni/entrypoints/cli/serve.py b/vllm_omni/entrypoints/cli/serve.py index a59cc5673..e28637f6a 100644 --- a/vllm_omni/entrypoints/cli/serve.py +++ b/vllm_omni/entrypoints/cli/serve.py @@ -6,6 +6,7 @@ diffusion models (e.g., Qwen-Image) through the same CLI interface. """ import argparse +import os import uvloop from vllm.entrypoints.cli.types import CLISubcommand @@ -14,6 +15,7 @@ from vllm.entrypoints.utils import VLLM_SUBCMD_PARSER_EPILOG from vllm.logger import init_logger from vllm.utils.argparse_utils import FlexibleArgumentParser +from vllm_omni.entrypoints.cli.logo import log_logo from vllm_omni.entrypoints.openai.api_server import omni_run_server logger = init_logger(__name__) @@ -45,6 +47,10 @@ class OmniServeCommand(CLISubcommand): @staticmethod def cmd(args: argparse.Namespace) -> None: + if not os.environ.get("VLLM_DISABLE_LOG_LOGO"): + os.environ["VLLM_DISABLE_LOG_LOGO"] = "1" + log_logo() + # If model is specified in CLI (as positional arg), it takes precedence if hasattr(args, "model_tag") and args.model_tag is not None: args.model = args.model_tag