Skip to content

Commit f180187

Browse files
scouzi1966claude
andcommitted
Add colorful Apple Intelligence splash screen
Features: - Beautiful ASCII art AFM logo with gradient colors - Apple Intelligence inspired color scheme (magenta → blue → cyan) - Bright cyan borders matching Apple's signature glow - Centered layout with proper alignment - Version display in bold blue - Enhanced visual appeal for server startup 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 2541c96 commit f180187

1 file changed

Lines changed: 65 additions & 9 deletions

File tree

Sources/MacLocalAPI/Server.swift

Lines changed: 65 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -77,19 +77,75 @@ class Server {
7777
}
7878

7979
func start() async throws {
80-
print("🚀 afm server starting on http://\(hostname):\(port)")
81-
print("📱 Using Apple Foundation Models (requires macOS 26+ with Apple Intelligence)")
82-
80+
// Print ASCII art splash screen
81+
let version = BuildInfo.version ?? "dev-build"
82+
83+
// ANSI color codes - Apple Intelligence inspired gradient
84+
let cyan = "\u{001B}[36m"
85+
let blue = "\u{001B}[34m"
86+
let magenta = "\u{001B}[35m"
87+
let brightCyan = "\u{001B}[96m"
88+
let brightBlue = "\u{001B}[94m"
89+
let brightMagenta = "\u{001B}[95m"
90+
let white = "\u{001B}[97m"
91+
let gray = "\u{001B}[90m"
92+
let reset = "\u{001B}[0m"
93+
let bold = "\u{001B}[1m"
94+
95+
// Center the version string properly (box content width is 68 chars)
96+
let boxContentWidth = 68
97+
let versionTextPadding = (boxContentWidth - version.count) / 2
98+
let versionLeftPad = String(repeating: " ", count: versionTextPadding)
99+
let versionRightPad = String(repeating: " ", count: boxContentWidth - version.count - versionTextPadding)
100+
101+
print("")
102+
print(" \(brightCyan)╔════════════════════════════════════════════════════════════════════╗\(reset)")
103+
print(" \(brightCyan)\(reset) \(brightCyan)\(reset)")
104+
print(" \(brightCyan)\(reset) \(brightMagenta)█████╗\(reset) \(brightBlue)███████╗\(reset)\(brightCyan)███╗ ███╗\(reset) \(brightCyan)\(reset)")
105+
print(" \(brightCyan)\(reset) \(brightMagenta)██╔══██╗\(reset)\(brightBlue)██╔════╝\(reset)\(brightCyan)████╗ ████║\(reset) \(brightCyan)\(reset)")
106+
print(" \(brightCyan)\(reset) \(brightMagenta)███████║\(reset)\(brightBlue)█████╗\(reset) \(brightCyan)██╔████╔██║\(reset) \(brightCyan)\(reset)")
107+
print(" \(brightCyan)\(reset) \(brightMagenta)██╔══██║\(reset)\(brightBlue)██╔══╝\(reset) \(brightCyan)██║╚██╔╝██║\(reset) \(brightCyan)\(reset)")
108+
print(" \(brightCyan)\(reset) \(brightMagenta)██║ ██║\(reset)\(brightBlue)██║\(reset) \(brightCyan)██║ ╚═╝ ██║\(reset) \(brightCyan)\(reset)")
109+
print(" \(brightCyan)\(reset) \(gray)╚═╝ ╚═╝╚═╝ ╚═╝ ╚═╝\(reset) \(brightCyan)\(reset)")
110+
print(" \(brightCyan)\(reset) \(brightCyan)\(reset)")
111+
print(" \(brightCyan)\(reset) \(white)Apple Foundation Models - OpenAI Compatible API\(reset) \(brightCyan)\(reset)")
112+
print(" \(brightCyan)\(reset)\(versionLeftPad)\(bold)\(brightBlue)\(version)\(reset)\(versionRightPad)\(brightCyan)\(reset)")
113+
print(" \(brightCyan)\(reset) \(brightCyan)\(reset)")
114+
print(" \(brightCyan)╚════════════════════════════════════════════════════════════════════╝\(reset)")
115+
print("")
116+
83117
// Initialize the Foundation Model Service once at startup
84118
if #available(macOS 26.0, *) {
85119
try await FoundationModelService.initialize(instructions: instructions, adapter: adapter, temperature: temperature, randomness: randomness, permissiveGuardrails: permissiveGuardrails)
86120
}
87-
88-
print("🔗 OpenAI API compatible endpoints:")
89-
print(" POST http://\(hostname):\(port)/v1/chat/completions")
90-
print(" GET http://\(hostname):\(port)/v1/models")
91-
print(" GET http://\(hostname):\(port)/health")
92-
print("Press Ctrl+C to stop the server")
121+
122+
print(" 🚀 Server: http://\(hostname):\(port)")
123+
print("")
124+
print(" 📡 Endpoints:")
125+
print(" • POST /v1/chat/completions - Chat completion (streaming supported)")
126+
print(" • GET /v1/models - List available models")
127+
print(" • GET /health - Health check")
128+
print("")
129+
print(" ⚙️ Configuration:")
130+
print(" • Streaming: \(streamingEnabled ? "✓ enabled" : "✗ disabled")")
131+
if let temp = temperature {
132+
print(" • Temperature: \(String(format: "%.1f", temp))")
133+
}
134+
if let rand = randomness {
135+
print(" • Randomness: \(rand)")
136+
}
137+
if permissiveGuardrails {
138+
print(" • Guardrails: ⚠️ permissive mode")
139+
}
140+
if let adapterPath = adapter {
141+
print(" • Adapter: \(adapterPath)")
142+
}
143+
print("")
144+
print(" ℹ️ Requires macOS 26+ with Apple Intelligence")
145+
print(" 💡 Press Ctrl+C to stop the server")
146+
print("")
147+
print(" ─────────────────────────────────────────────────────────────────────────")
148+
print("")
93149

94150
// Start the server
95151
try await app.server.start(address: .hostname(hostname, port: port))

0 commit comments

Comments
 (0)