Files
vllm-omni/vllm_omni/entrypoints/cli/logo.py
T

53 lines
1.8 KiB
Python

import os
import re
from vllm.logger import 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:
# Bypass current_formatter_type() which has fragile handler-count/name
# checks that fail in some runtime configurations. Instead, directly
# check the env vars that control colored output — matching vLLM's
# _use_color() logic. main.py sets VLLM_LOGGING_COLOR=1 before any
# vLLM import, so this env var is the authoritative source of truth.
use_color = "NO_COLOR" not in os.environ and os.environ.get("VLLM_LOGGING_COLOR") != "0"
logo = LOGO if use_color else _ANSI_RE.sub("", LOGO)
logger.info(logo)