@appkit/llamacpp-cli 1.12.0 → 1.13.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +294 -168
- package/dist/cli.js +35 -0
- package/dist/cli.js.map +1 -1
- package/dist/commands/launch/claude.d.ts +6 -0
- package/dist/commands/launch/claude.d.ts.map +1 -0
- package/dist/commands/launch/claude.js +277 -0
- package/dist/commands/launch/claude.js.map +1 -0
- package/dist/lib/integration-checker.d.ts +26 -0
- package/dist/lib/integration-checker.d.ts.map +1 -0
- package/dist/lib/integration-checker.js +77 -0
- package/dist/lib/integration-checker.js.map +1 -0
- package/dist/lib/router-manager.d.ts +4 -0
- package/dist/lib/router-manager.d.ts.map +1 -1
- package/dist/lib/router-manager.js +10 -0
- package/dist/lib/router-manager.js.map +1 -1
- package/dist/lib/router-server.d.ts +13 -0
- package/dist/lib/router-server.d.ts.map +1 -1
- package/dist/lib/router-server.js +267 -7
- package/dist/lib/router-server.js.map +1 -1
- package/dist/types/integration-config.d.ts +28 -0
- package/dist/types/integration-config.d.ts.map +1 -0
- package/dist/types/integration-config.js +3 -0
- package/dist/types/integration-config.js.map +1 -0
- package/package.json +10 -2
- package/web/dist/assets/index-Bin89Lwr.css +1 -0
- package/web/dist/assets/index-CVmonw3T.js +17 -0
- package/web/{index.html → dist/index.html} +2 -1
- package/.versionrc.json +0 -16
- package/CHANGELOG.md +0 -213
- package/docs/images/.gitkeep +0 -1
- package/docs/images/web-ui-servers.png +0 -0
- package/src/cli.ts +0 -523
- package/src/commands/admin/config.ts +0 -121
- package/src/commands/admin/logs.ts +0 -91
- package/src/commands/admin/restart.ts +0 -26
- package/src/commands/admin/start.ts +0 -27
- package/src/commands/admin/status.ts +0 -84
- package/src/commands/admin/stop.ts +0 -16
- package/src/commands/config-global.ts +0 -38
- package/src/commands/config.ts +0 -323
- package/src/commands/create.ts +0 -183
- package/src/commands/delete.ts +0 -74
- package/src/commands/list.ts +0 -37
- package/src/commands/logs-all.ts +0 -251
- package/src/commands/logs.ts +0 -345
- package/src/commands/monitor.ts +0 -110
- package/src/commands/ps.ts +0 -84
- package/src/commands/pull.ts +0 -44
- package/src/commands/rm.ts +0 -107
- package/src/commands/router/config.ts +0 -116
- package/src/commands/router/logs.ts +0 -256
- package/src/commands/router/restart.ts +0 -36
- package/src/commands/router/start.ts +0 -60
- package/src/commands/router/status.ts +0 -119
- package/src/commands/router/stop.ts +0 -33
- package/src/commands/run.ts +0 -233
- package/src/commands/search.ts +0 -107
- package/src/commands/server-show.ts +0 -161
- package/src/commands/show.ts +0 -207
- package/src/commands/start.ts +0 -101
- package/src/commands/stop.ts +0 -39
- package/src/commands/tui.ts +0 -25
- package/src/lib/admin-manager.ts +0 -435
- package/src/lib/admin-server.ts +0 -1243
- package/src/lib/config-generator.ts +0 -130
- package/src/lib/download-job-manager.ts +0 -213
- package/src/lib/history-manager.ts +0 -172
- package/src/lib/launchctl-manager.ts +0 -225
- package/src/lib/metrics-aggregator.ts +0 -257
- package/src/lib/model-downloader.ts +0 -328
- package/src/lib/model-scanner.ts +0 -157
- package/src/lib/model-search.ts +0 -114
- package/src/lib/models-dir-setup.ts +0 -46
- package/src/lib/port-manager.ts +0 -80
- package/src/lib/router-logger.ts +0 -201
- package/src/lib/router-manager.ts +0 -414
- package/src/lib/router-server.ts +0 -538
- package/src/lib/state-manager.ts +0 -206
- package/src/lib/status-checker.ts +0 -113
- package/src/lib/system-collector.ts +0 -315
- package/src/tui/ConfigApp.ts +0 -1085
- package/src/tui/HistoricalMonitorApp.ts +0 -587
- package/src/tui/ModelsApp.ts +0 -368
- package/src/tui/MonitorApp.ts +0 -386
- package/src/tui/MultiServerMonitorApp.ts +0 -1833
- package/src/tui/RootNavigator.ts +0 -74
- package/src/tui/SearchApp.ts +0 -511
- package/src/tui/SplashScreen.ts +0 -149
- package/src/types/admin-config.ts +0 -25
- package/src/types/global-config.ts +0 -26
- package/src/types/history-types.ts +0 -39
- package/src/types/model-info.ts +0 -8
- package/src/types/monitor-types.ts +0 -162
- package/src/types/router-config.ts +0 -25
- package/src/types/server-config.ts +0 -46
- package/src/utils/downsample-utils.ts +0 -128
- package/src/utils/file-utils.ts +0 -146
- package/src/utils/format-utils.ts +0 -98
- package/src/utils/log-parser.ts +0 -284
- package/src/utils/log-utils.ts +0 -178
- package/src/utils/process-utils.ts +0 -316
- package/src/utils/prompt-utils.ts +0 -47
- package/test-load.sh +0 -100
- package/tsconfig.json +0 -20
- package/web/eslint.config.js +0 -23
- package/web/llamacpp-web-dist.tar.gz +0 -0
- package/web/package-lock.json +0 -4017
- package/web/package.json +0 -38
- package/web/postcss.config.js +0 -6
- package/web/src/App.css +0 -42
- package/web/src/App.tsx +0 -86
- package/web/src/assets/react.svg +0 -1
- package/web/src/components/ApiKeyPrompt.tsx +0 -71
- package/web/src/components/CreateServerModal.tsx +0 -372
- package/web/src/components/DownloadProgress.tsx +0 -123
- package/web/src/components/Nav.tsx +0 -89
- package/web/src/components/RouterConfigModal.tsx +0 -240
- package/web/src/components/SearchModal.tsx +0 -306
- package/web/src/components/ServerConfigModal.tsx +0 -291
- package/web/src/hooks/useApi.ts +0 -259
- package/web/src/index.css +0 -42
- package/web/src/lib/api.ts +0 -226
- package/web/src/main.tsx +0 -10
- package/web/src/pages/Dashboard.tsx +0 -103
- package/web/src/pages/Models.tsx +0 -258
- package/web/src/pages/Router.tsx +0 -270
- package/web/src/pages/RouterLogs.tsx +0 -201
- package/web/src/pages/ServerLogs.tsx +0 -553
- package/web/src/pages/Servers.tsx +0 -358
- package/web/src/types/api.ts +0 -140
- package/web/tailwind.config.js +0 -31
- package/web/tsconfig.app.json +0 -28
- package/web/tsconfig.json +0 -7
- package/web/tsconfig.node.json +0 -26
- package/web/vite.config.ts +0 -25
- /package/web/{public → dist}/vite.svg +0 -0
|
@@ -1,201 +0,0 @@
|
|
|
1
|
-
import { useState, useEffect, useRef } from 'react';
|
|
2
|
-
import { useNavigate } from 'react-router-dom';
|
|
3
|
-
import { ArrowLeft, Loader2, ChevronDown } from 'lucide-react';
|
|
4
|
-
import { useRouterLogs } from '../hooks/useApi';
|
|
5
|
-
|
|
6
|
-
type LogType = 'stdout' | 'stderr' | 'both';
|
|
7
|
-
type LogSort = 'newest' | 'oldest';
|
|
8
|
-
|
|
9
|
-
export function RouterLogs() {
|
|
10
|
-
const navigate = useNavigate();
|
|
11
|
-
|
|
12
|
-
const [logType, setLogType] = useState<LogType>('stdout');
|
|
13
|
-
const [sortOrder, setSortOrder] = useState<LogSort>('newest');
|
|
14
|
-
const [showSortDropdown, setShowSortDropdown] = useState(false);
|
|
15
|
-
const [autoScroll, setAutoScroll] = useState(true);
|
|
16
|
-
|
|
17
|
-
const logContainerRef = useRef<HTMLDivElement>(null);
|
|
18
|
-
const dropdownRef = useRef<HTMLDivElement>(null);
|
|
19
|
-
|
|
20
|
-
const { data: logsData, isLoading: logsLoading } = useRouterLogs(50000);
|
|
21
|
-
|
|
22
|
-
// Auto-scroll to bottom when new logs arrive
|
|
23
|
-
useEffect(() => {
|
|
24
|
-
if (autoScroll && logContainerRef.current) {
|
|
25
|
-
logContainerRef.current.scrollTop = logContainerRef.current.scrollHeight;
|
|
26
|
-
}
|
|
27
|
-
}, [logsData, autoScroll, sortOrder]);
|
|
28
|
-
|
|
29
|
-
// Close dropdown on outside click
|
|
30
|
-
useEffect(() => {
|
|
31
|
-
const handleClickOutside = (e: MouseEvent) => {
|
|
32
|
-
if (dropdownRef.current && !dropdownRef.current.contains(e.target as Node)) {
|
|
33
|
-
setShowSortDropdown(false);
|
|
34
|
-
}
|
|
35
|
-
};
|
|
36
|
-
document.addEventListener('mousedown', handleClickOutside);
|
|
37
|
-
return () => document.removeEventListener('mousedown', handleClickOutside);
|
|
38
|
-
}, []);
|
|
39
|
-
|
|
40
|
-
const getFilteredLogs = (): string[] => {
|
|
41
|
-
if (!logsData) return [];
|
|
42
|
-
|
|
43
|
-
let logs: string;
|
|
44
|
-
if (logType === 'stdout') {
|
|
45
|
-
logs = logsData.stdout || '';
|
|
46
|
-
} else if (logType === 'stderr') {
|
|
47
|
-
logs = logsData.stderr || '';
|
|
48
|
-
} else {
|
|
49
|
-
// Combine both
|
|
50
|
-
const stdout = logsData.stdout || '';
|
|
51
|
-
const stderr = logsData.stderr || '';
|
|
52
|
-
logs = [stderr, stdout].filter(l => l.trim()).join('\n');
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
const lines = logs.split('\n').filter(line => line.trim());
|
|
56
|
-
|
|
57
|
-
// Apply sort
|
|
58
|
-
if (sortOrder === 'oldest') {
|
|
59
|
-
return lines;
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
return [...lines].reverse();
|
|
63
|
-
};
|
|
64
|
-
|
|
65
|
-
const filteredLogs = getFilteredLogs();
|
|
66
|
-
|
|
67
|
-
return (
|
|
68
|
-
<div className="h-[calc(100vh-56px)] flex flex-col">
|
|
69
|
-
{/* Header */}
|
|
70
|
-
<div className="flex items-center px-4 py-3 border-b border-gray-200 bg-white">
|
|
71
|
-
<div className="flex items-center gap-3">
|
|
72
|
-
<button
|
|
73
|
-
onClick={() => navigate('/router')}
|
|
74
|
-
className="p-1.5 text-gray-500 hover:text-gray-700 hover:bg-gray-100 rounded-lg transition-colors cursor-pointer"
|
|
75
|
-
>
|
|
76
|
-
<ArrowLeft className="w-5 h-5" />
|
|
77
|
-
</button>
|
|
78
|
-
<div>
|
|
79
|
-
<h1 className="text-lg font-semibold text-gray-900">Router Logs</h1>
|
|
80
|
-
<p className="text-sm text-gray-500">Unified model routing service</p>
|
|
81
|
-
</div>
|
|
82
|
-
</div>
|
|
83
|
-
</div>
|
|
84
|
-
|
|
85
|
-
{/* Filter Bar */}
|
|
86
|
-
<div className="flex items-center justify-between px-4 py-3 border-b border-gray-100 bg-gray-50">
|
|
87
|
-
{/* Log Type Toggle */}
|
|
88
|
-
<div className="flex items-center gap-2">
|
|
89
|
-
<div className="flex items-center bg-white border border-gray-200 rounded-lg overflow-hidden">
|
|
90
|
-
<button
|
|
91
|
-
onClick={() => setLogType('stdout')}
|
|
92
|
-
className={`px-3 py-1.5 text-sm font-medium transition-colors cursor-pointer ${
|
|
93
|
-
logType === 'stdout'
|
|
94
|
-
? 'bg-gray-100 text-gray-900'
|
|
95
|
-
: 'text-gray-600 hover:bg-gray-50'
|
|
96
|
-
}`}
|
|
97
|
-
>
|
|
98
|
-
Activity
|
|
99
|
-
</button>
|
|
100
|
-
<button
|
|
101
|
-
onClick={() => setLogType('stderr')}
|
|
102
|
-
className={`px-3 py-1.5 text-sm font-medium transition-colors cursor-pointer ${
|
|
103
|
-
logType === 'stderr'
|
|
104
|
-
? 'bg-gray-100 text-gray-900'
|
|
105
|
-
: 'text-gray-600 hover:bg-gray-50'
|
|
106
|
-
}`}
|
|
107
|
-
>
|
|
108
|
-
System
|
|
109
|
-
</button>
|
|
110
|
-
<button
|
|
111
|
-
onClick={() => setLogType('both')}
|
|
112
|
-
className={`px-3 py-1.5 text-sm font-medium transition-colors cursor-pointer ${
|
|
113
|
-
logType === 'both'
|
|
114
|
-
? 'bg-gray-100 text-gray-900'
|
|
115
|
-
: 'text-gray-600 hover:bg-gray-50'
|
|
116
|
-
}`}
|
|
117
|
-
>
|
|
118
|
-
Both
|
|
119
|
-
</button>
|
|
120
|
-
</div>
|
|
121
|
-
</div>
|
|
122
|
-
|
|
123
|
-
{/* Sort Dropdown */}
|
|
124
|
-
<div className="relative" ref={dropdownRef}>
|
|
125
|
-
<button
|
|
126
|
-
onClick={() => setShowSortDropdown(!showSortDropdown)}
|
|
127
|
-
className="flex items-center gap-2 px-3 py-1.5 text-sm font-medium text-gray-600 bg-white border border-gray-200 rounded-lg hover:border-gray-300 transition-colors cursor-pointer"
|
|
128
|
-
>
|
|
129
|
-
{sortOrder === 'newest' ? 'Newest' : 'Oldest'}
|
|
130
|
-
<ChevronDown className="w-4 h-4" />
|
|
131
|
-
</button>
|
|
132
|
-
|
|
133
|
-
{showSortDropdown && (
|
|
134
|
-
<div className="absolute right-0 top-full mt-1 w-32 bg-white border border-gray-200 rounded-lg shadow-lg z-10">
|
|
135
|
-
<button
|
|
136
|
-
onClick={() => { setSortOrder('newest'); setShowSortDropdown(false); }}
|
|
137
|
-
className={`w-full text-left px-3 py-2 text-sm transition-colors cursor-pointer ${
|
|
138
|
-
sortOrder === 'newest' ? 'bg-gray-100 text-gray-900' : 'text-gray-600 hover:bg-gray-50'
|
|
139
|
-
}`}
|
|
140
|
-
>
|
|
141
|
-
Newest
|
|
142
|
-
</button>
|
|
143
|
-
<button
|
|
144
|
-
onClick={() => { setSortOrder('oldest'); setShowSortDropdown(false); }}
|
|
145
|
-
className={`w-full text-left px-3 py-2 text-sm transition-colors cursor-pointer ${
|
|
146
|
-
sortOrder === 'oldest' ? 'bg-gray-100 text-gray-900' : 'text-gray-600 hover:bg-gray-50'
|
|
147
|
-
}`}
|
|
148
|
-
>
|
|
149
|
-
Oldest
|
|
150
|
-
</button>
|
|
151
|
-
</div>
|
|
152
|
-
)}
|
|
153
|
-
</div>
|
|
154
|
-
</div>
|
|
155
|
-
|
|
156
|
-
{/* Log Content */}
|
|
157
|
-
<div
|
|
158
|
-
ref={logContainerRef}
|
|
159
|
-
className="flex-1 overflow-y-auto bg-gray-900 p-4 font-mono text-sm"
|
|
160
|
-
onScroll={(e) => {
|
|
161
|
-
const target = e.target as HTMLDivElement;
|
|
162
|
-
const isAtBottom = target.scrollHeight - target.scrollTop <= target.clientHeight + 50;
|
|
163
|
-
setAutoScroll(isAtBottom);
|
|
164
|
-
}}
|
|
165
|
-
>
|
|
166
|
-
{logsLoading ? (
|
|
167
|
-
<div className="flex items-center justify-center h-full">
|
|
168
|
-
<Loader2 className="w-6 h-6 animate-spin text-gray-400" />
|
|
169
|
-
</div>
|
|
170
|
-
) : filteredLogs.length === 0 ? (
|
|
171
|
-
<div className="flex flex-col items-center justify-center h-full text-gray-500">
|
|
172
|
-
<p>No logs found</p>
|
|
173
|
-
<p className="text-sm mt-1">Router may not be running or has no activity yet</p>
|
|
174
|
-
</div>
|
|
175
|
-
) : (
|
|
176
|
-
<div className="space-y-0.5">
|
|
177
|
-
{filteredLogs.map((line, index) => (
|
|
178
|
-
<div
|
|
179
|
-
key={index}
|
|
180
|
-
className="text-gray-300 break-all whitespace-pre-wrap leading-relaxed"
|
|
181
|
-
>
|
|
182
|
-
{line}
|
|
183
|
-
</div>
|
|
184
|
-
))}
|
|
185
|
-
</div>
|
|
186
|
-
)}
|
|
187
|
-
</div>
|
|
188
|
-
|
|
189
|
-
{/* Footer with stats */}
|
|
190
|
-
<div className="flex items-center justify-between px-4 py-2 border-t border-gray-200 bg-gray-50 text-sm text-gray-500">
|
|
191
|
-
<span>
|
|
192
|
-
{filteredLogs.length} {filteredLogs.length === 1 ? 'line' : 'lines'}
|
|
193
|
-
</span>
|
|
194
|
-
<span className="flex items-center gap-2">
|
|
195
|
-
<span className={`w-2 h-2 rounded-full ${autoScroll ? 'bg-green-500' : 'bg-gray-300'}`} />
|
|
196
|
-
{autoScroll ? 'Auto-scroll on' : 'Auto-scroll off'}
|
|
197
|
-
</span>
|
|
198
|
-
</div>
|
|
199
|
-
</div>
|
|
200
|
-
);
|
|
201
|
-
}
|