interplane.Get Omega
Read in your language

MojoLlama

Archived Mojo/MAX quantizer and serving research repository (read-only history)

Brought by drakestapleton

branch main Branches Tags History

MojoLlama / desktop / renderer / settings.html

163 lines · 6443 bytes Raw Blame History
1<!DOCTYPE html>
2<html lang="en">
3<head>
4<meta charset="UTF-8">
5<meta name="viewport" content="width=device-width, initial-scale=1.0">
6<title>MojoLlama Studio — Settings</title>
7<style>
8:root {
9 --bg: #0d1117; --surface: #161b22; --border: #30363d;
10 --text: #e6edf3; --dim: #8b949e; --accent: #58a6ff;
11 --green: #3fb950; --red: #f85149;
12}
13* { margin: 0; padding: 0; box-sizing: border-box; }
14body {
15 font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
16 background: var(--bg); color: var(--text); font-size: 13px;
17 padding: 20px; user-select: none;
18}
19h2 { font-size: 16px; font-weight: 600; margin-bottom: 16px; color: var(--accent); }
20.section { margin-bottom: 20px; }
21.section-title {
22 font-size: 11px; font-weight: 600; text-transform: uppercase;
23 letter-spacing: 0.5px; color: var(--dim); margin-bottom: 12px;
24 padding-bottom: 6px; border-bottom: 1px solid var(--border);
25}
26.field { margin-bottom: 12px; }
27label {
28 display: block; font-size: 12px; color: var(--dim);
29 margin-bottom: 4px; font-weight: 500;
30}
31input, select {
32 width: 100%; padding: 7px 10px; background: var(--surface);
33 border: 1px solid var(--border); border-radius: 6px; color: var(--text);
34 font-size: 13px; font-family: 'SF Mono', 'Monaco', 'Menlo', monospace; outline: none;
35 transition: border-color .2s;
36}
37input:focus, select:focus { border-color: var(--accent); }
38input[type="checkbox"] {
39 width: auto; margin-right: 8px; accent-color: var(--accent);
40 vertical-align: middle; cursor: pointer;
41}
42.checkbox-row { display: flex; align-items: center; margin-bottom: 12px; }
43.checkbox-row label { margin-bottom: 0; cursor: pointer; }
44.help-text { font-size: 10px; color: var(--dim); margin-top: 2px; line-height: 1.4; }
45.buttons { display: flex; gap: 8px; margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--border); }
46.btn {
47 padding: 7px 18px; border: none; border-radius: 6px; cursor: pointer;
48 font-size: 13px; font-weight: 600; transition: all .2s;
49}
50.btn-primary { background: var(--accent); color: #fff; }
51.btn-primary:hover { filter: brightness(1.15); }
52.btn-dim { background: var(--border); color: var(--text); }
53.btn-dim:hover { background: #464f5c; }
54.btn-green { background: var(--green); color: #fff; }
55.btn-green:hover { filter: brightness(1.15); }
56.btn-red { background: var(--red); color: #fff; }
57.btn-red:hover { filter: brightness(1.15); }
58.status-bar {
59 display: flex; align-items: center; gap: 8px; margin-bottom: 16px;
60 padding: 8px 12px; background: var(--surface); border: 1px solid var(--border);
61 border-radius: 6px; font-size: 12px;
62}
63.status-dot {
64 width: 8px; height: 8px; border-radius: 50%; display: inline-block;
65}
66.status-dot.running { background: var(--green); box-shadow: 0 0 6px var(--green); }
67.status-dot.stopped { background: var(--dim); }
68.status-dot.starting,
69.status-dot.stopping { background: #d29922; animation: pulse 1s infinite; }
70.status-dot.error { background: var(--red); }
71@keyframes pulse {
72 0%, 100% { opacity: 1; }
73 50% { opacity: 0.4; }
74}
75.actions { display: flex; gap: 6px; margin-left: auto; }
76.btn-sm { padding: 4px 10px; font-size: 11px; }
77</style>
78</head>
79<body>
80
81<h2>⚙ MojoLlama Settings</h2>
82
83<!-- Server Status -->
84<div class="status-bar">
85 <span class="status-dot stopped" id="statusDot"></span>
86 <span id="statusText">Checking server status...</span>
87 <div class="actions">
88 <button class="btn btn-sm btn-green" id="btnStart" onclick="startServer()">Start</button>
89 <button class="btn btn-sm btn-red" id="btnStop" onclick="stopServer()" disabled>Stop</button>
90 <button class="btn btn-sm btn-dim" id="btnRestart" onclick="restartServer()" disabled>Restart</button>
91 </div>
92</div>
93
94<!-- Server Section -->
95<div class="section">
96 <div class="section-title">Server Configuration</div>
97 <div class="field">
98 <label for="serverPort">Server Port</label>
99 <input type="number" id="serverPort" min="1024" max="65535" value="8080">
100 <div class="help-text">Port for the MojoLlama HTTP server (default: 8080)</div>
101 </div>
102 <div class="field">
103 <label for="llamaPort">llama.cpp Port</label>
104 <input type="number" id="llamaPort" min="1024" max="65535" value="8081">
105 <div class="help-text">Port for llama.cpp backend if used separately (default: 8081)</div>
106 </div>
107 <div class="field">
108 <label for="modelPath">Model Path (GGUF file)</label>
109 <input type="text" id="modelPath" placeholder="/path/to/model.gguf or leave empty for auto-detect">
110 <div class="help-text">Path to a GGUF model file. Leave empty for auto-discovery.</div>
111 </div>
112</div>
113
114<!-- MojoLlama Engine Section -->
115<div class="section">
116 <div class="section-title">MojoLlama Engine</div>
117 <div class="field">
118 <label for="threads">Thread Count (OMP_NUM_THREADS)</label>
119 <input type="number" id="threads" min="1" max="128" value="32">
120 <div class="help-text">Number of OpenMP threads for the MoE engine (default: 32)</div>
121 </div>
122 <div class="field">
123 <label for="engine">Engine Mode</label>
124 <select id="engine">
125 <option value="server_batch_moe">server_batch_moe (batch, recommended)</option>
126 <option value="server_moe">server_moe (single-request)</option>
127 </select>
128 <div class="help-text">server_batch_moe uses continuous batching for higher throughput; server_moe handles one request at a time.</div>
129 </div>
130</div>
131
132<!-- Behavior Section -->
133<div class="section">
134 <div class="section-title">Behavior</div>
135 <div class="checkbox-row">
136 <input type="checkbox" id="autoStart" checked>
137 <label for="autoStart">Auto-start server on launch</label>
138 </div>
139 <div class="checkbox-row">
140 <input type="checkbox" id="minimizeToTray" checked>
141 <label for="minimizeToTray">Minimize to system tray instead of closing</label>
142 </div>
143 <div class="checkbox-row">
144 <input type="checkbox" id="notifications" checked>
145 <label for="notifications">Show desktop notifications for server events</label>
146 </div>
147 <div class="checkbox-row">
148 <input type="checkbox" id="debug">
149 <label for="debug">Debug mode (verbose logging)</label>
150 </div>
151</div>
152
153<!-- Buttons -->
154<div class="buttons">
155 <button class="btn btn-primary" onclick="saveSettings()">Save</button>
156 <button class="btn btn-dim" onclick="cancel()">Cancel</button>
157 <div style="flex:1"></div>
158 <button class="btn btn-dim" onclick="openLog()">View Log</button>
159</div>
160
161<script src="settings.js"></script>
162</body>
163</html>