@@ -13,34 +13,56 @@ def print_initializing_banner(version: str = "0.4.25"):
13
13
Print the initializing banner with clear visual indication
14
14
that the server is starting up and not ready for requests
15
15
"""
16
- startup_banner = f"""
17
- { Fore . CYAN } ════════════════════════════════════════════════════════════════════════ { Style . RESET_ALL }
16
+ # Calculate banner width
17
+ banner_width = 80
18
18
19
- { Fore . GREEN } LocalLab Server v { version } { Style . RESET_ALL }
20
- { Fore . CYAN } Your lightweight AI inference server for running LLMs locally { Style .RESET_ALL }
19
+ # Create horizontal lines with modern styling
20
+ h_line = f" { Fore . CYAN } { '═' * banner_width } { Style .RESET_ALL } "
21
21
22
- { Fore .BLUE }
22
+ # Create the LocalLab ASCII art with improved spacing and color
23
+ locallab_ascii = f"""{ Fore .BLUE }
23
24
██╗ ██████╗ ██████╗ █████╗ ██╗ ██╗ █████╗ ██████╗
24
25
██║ ██╔═══██╗██╔════╝██╔══██╗██║ ██║ ██╔══██╗██╔══██╗
25
26
██║ ██║ ██║██║ ███████║██║ ██║ ███████║██████╔╝
26
27
██║ ██║ ██║██║ ██╔══██║██║ ██║ ██╔══██║██╔══██╗
27
28
███████╗╚██████╔╝╚██████╗██║ ██║███████╗███████╗██║ ██║██████╔╝
28
- ╚══════╝ ╚═════╝ ╚═════╝╚═╝ ╚═╝╚══════╝╚══════╝╚═╝ ╚═╝╚═════╝
29
- { Style .RESET_ALL }
29
+ ╚══════╝ ╚═════╝ ╚═════╝╚═╝ ╚═╝╚══════╝╚══════╝╚═╝ ╚═╝╚═════╝ { Style .RESET_ALL } """
30
+
31
+ # Create status box with modern styling
32
+ status_box_top = f"{ Fore .YELLOW } ┏{ '━' * (banner_width - 2 )} ┓{ Style .RESET_ALL } "
33
+ status_title = f"{ Fore .YELLOW } ┃{ ' ' * ((banner_width - 20 ) // 2 )} ⚠️ INITIALIZING ⚠️{ ' ' * ((banner_width - 20 ) // 2 + (banner_width - 20 ) % 2 )} ┃{ Style .RESET_ALL } "
34
+ status_empty = f"{ Fore .YELLOW } ┃{ ' ' * (banner_width - 2 )} ┃{ Style .RESET_ALL } "
35
+ status_bullet1 = f"{ Fore .YELLOW } ┃ • { Fore .WHITE } Server is starting up - please wait{ ' ' * (banner_width - 41 )} ┃{ Style .RESET_ALL } "
36
+ status_bullet2 = f"{ Fore .YELLOW } ┃ • { Fore .WHITE } Do not make API requests yet{ ' ' * (banner_width - 36 )} ┃{ Style .RESET_ALL } "
37
+ status_bullet3 = f"{ Fore .YELLOW } ┃ • { Fore .WHITE } Wait for the \" RUNNING\" banner to appear{ ' ' * (banner_width - 48 )} ┃{ Style .RESET_ALL } "
38
+ status_box_bottom = f"{ Fore .YELLOW } ┗{ '━' * (banner_width - 2 )} ┛{ Style .RESET_ALL } "
39
+
40
+ # Create status indicator with modern styling
41
+ status_indicator = f"⏳ Status: { Fore .YELLOW } INITIALIZING{ Style .RESET_ALL } "
42
+ loading_indicator = f"🔄 Loading components and checking environment..."
43
+
44
+ # Assemble the complete banner
45
+ startup_banner = f"""
46
+ { h_line }
47
+
48
+ { Fore .GREEN } LocalLab Server v{ version } { Style .RESET_ALL }
49
+ { Fore .CYAN } Your lightweight AI inference server for running LLMs locally{ Style .RESET_ALL }
30
50
31
- { Fore .YELLOW } ▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
32
- ⚠️ INITIALIZING ⚠️
51
+ { locallab_ascii }
33
52
34
- • Server is starting up - please wait
35
- • Do not make API requests yet
36
- • Wait for the "RUNNING" banner to appear
37
- ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
38
- { Style .RESET_ALL }
53
+ { status_box_top }
54
+ { status_title }
55
+ { status_empty }
56
+ { status_bullet1 }
57
+ { status_bullet2 }
58
+ { status_bullet3 }
59
+ { status_empty }
60
+ { status_box_bottom }
39
61
40
- { Fore . CYAN } ════════════════════════════════════════════════════════════════════════ { Style . RESET_ALL }
62
+ { h_line }
41
63
42
- ⏳ Status: { Fore . YELLOW } INITIALIZING { Style . RESET_ALL }
43
- 🔄 Loading components and checking environment...
64
+ { status_indicator }
65
+ { loading_indicator }
44
66
45
67
"""
46
68
print (startup_banner , flush = True )
@@ -52,33 +74,60 @@ def print_running_banner(version: str):
52
74
that the server is now ready to accept API requests
53
75
"""
54
76
try :
55
- running_banner = f"""
56
- { Fore . CYAN } ════════════════════════════════════════════════════════════════════════ { Style . RESET_ALL }
77
+ # Calculate banner width
78
+ banner_width = 80
57
79
58
- { Fore . GREEN } LocalLab Server v { version } { Style . RESET_ALL } - { Fore . YELLOW } READY FOR REQUESTS { Style . RESET_ALL }
59
- { Fore . CYAN } Your AI model is now running and ready to process requests { Style .RESET_ALL }
80
+ # Create horizontal lines with modern styling
81
+ h_line = f" { Fore . CYAN } { '═' * banner_width } { Style .RESET_ALL } "
60
82
61
- { Fore .GREEN }
83
+ # Create the LocalLab ASCII art with improved spacing and color
84
+ locallab_ascii = f"""{ Fore .GREEN }
62
85
██╗ ██████╗ ██████╗ █████╗ ██╗ ██╗ █████╗ ██████╗
63
86
██║ ██╔═══██╗██╔════╝██╔══██╗██║ ██║ ██╔══██╗██╔══██╗
64
87
██║ ██║ ██║██║ ███████║██║ ██║ ███████║██████╔╝
65
88
██║ ██║ ██║██║ ██╔══██║██║ ██║ ██╔══██║██╔══██╗
66
89
███████╗╚██████╔╝╚██████╗██║ ██║███████╗███████╗██║ ██║██████╔╝
67
- ╚══════╝ ╚═════╝ ╚═════╝╚═╝ ╚═╝╚══════╝╚══════╝╚═╝ ╚═╝╚═════╝
68
- { Style .RESET_ALL }
69
- { Fore .GREEN } ▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
70
- ✅ RUNNING ✅
71
-
72
- • Server is ready - you can now make API requests
73
- • Prefer to use the client packages for easier interaction
74
- • Model loading will continue in the background
75
- • API documentation is available below
76
- ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
77
- { Style .RESET_ALL }
90
+ ╚══════╝ ╚═════╝ ╚═════╝╚═╝ ╚═╝╚══════╝╚══════╝╚═╝ ╚═╝╚═════╝ { Style .RESET_ALL } """
91
+
92
+ # Create status box with modern styling
93
+ status_box_top = f"{ Fore .GREEN } ┏{ '━' * (banner_width - 2 )} ┓{ Style .RESET_ALL } "
94
+ status_title = f"{ Fore .GREEN } ┃{ ' ' * ((banner_width - 16 ) // 2 )} ✅ RUNNING ✅{ ' ' * ((banner_width - 16 ) // 2 + (banner_width - 16 ) % 2 )} ┃{ Style .RESET_ALL } "
95
+ status_empty = f"{ Fore .GREEN } ┃{ ' ' * (banner_width - 2 )} ┃{ Style .RESET_ALL } "
96
+ status_bullet1 = f"{ Fore .GREEN } ┃ • { Fore .WHITE } Server is ready - you can now make API requests{ ' ' * (banner_width - 53 )} ┃{ Style .RESET_ALL } "
97
+ status_bullet2 = f"{ Fore .GREEN } ┃ • { Fore .WHITE } Prefer to use the client packages for easier interaction{ ' ' * (banner_width - 65 )} ┃{ Style .RESET_ALL } "
98
+ status_bullet3 = f"{ Fore .GREEN } ┃ • { Fore .WHITE } Model loading will continue in the background{ ' ' * (banner_width - 52 )} ┃{ Style .RESET_ALL } "
99
+ status_bullet4 = f"{ Fore .GREEN } ┃ • { Fore .WHITE } API documentation is available below{ ' ' * (banner_width - 45 )} ┃{ Style .RESET_ALL } "
100
+ status_box_bottom = f"{ Fore .GREEN } ┗{ '━' * (banner_width - 2 )} ┛{ Style .RESET_ALL } "
101
+
102
+ # Create status indicator with modern styling
103
+ status_indicator = f"🚀 Status: { Fore .GREEN } RUNNING{ Style .RESET_ALL } "
104
+ ready_indicator = f"✨ Your AI model is now running and ready to process requests"
105
+
106
+ # Assemble the complete banner
107
+ running_banner = f"""
108
+ { h_line }
78
109
79
- { Fore .CYAN } ════════════════════════════════════════════════════════════════════════ { Style .RESET_ALL }
80
- """
110
+ { Fore .GREEN } LocalLab Server v { version } { Style . RESET_ALL } - { Fore . YELLOW } READY FOR REQUESTS { Style .RESET_ALL }
111
+ { Fore . CYAN } Your AI model is now running and ready to process requests { Style . RESET_ALL }
81
112
113
+ { locallab_ascii }
114
+
115
+ { status_box_top }
116
+ { status_title }
117
+ { status_empty }
118
+ { status_bullet1 }
119
+ { status_bullet2 }
120
+ { status_bullet3 }
121
+ { status_bullet4 }
122
+ { status_empty }
123
+ { status_box_bottom }
124
+
125
+ { h_line }
126
+
127
+ { status_indicator }
128
+ { ready_indicator }
129
+
130
+ """
82
131
# Make sure we flush the output to ensure it appears
83
132
print (running_banner , flush = True )
84
133
0 commit comments