Update index.html
Browse files- index.html +1347 -541
index.html
CHANGED
|
@@ -1,473 +1,1278 @@
|
|
| 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>NanoMind Β· 152M</title>
|
| 7 |
-
<link rel="preconnect" href="https://fonts.googleapis.com">
|
| 8 |
-
<link
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
|
| 33 |
-
|
| 34 |
-
|
| 35 |
-
|
| 36 |
-
|
| 37 |
-
|
| 38 |
-
|
| 39 |
-
|
| 40 |
-
|
| 41 |
-
|
| 42 |
-
|
| 43 |
-
|
| 44 |
-
|
| 45 |
-
|
| 46 |
-
|
| 47 |
-
|
| 48 |
-
|
| 49 |
-
|
| 50 |
-
|
| 51 |
-
|
| 52 |
-
|
| 53 |
-
|
| 54 |
-
|
| 55 |
-
.
|
| 56 |
-
|
| 57 |
-
|
| 58 |
-
|
| 59 |
-
|
| 60 |
-
|
| 61 |
-
|
| 62 |
-
|
| 63 |
-
|
| 64 |
-
|
| 65 |
-
|
| 66 |
-
|
| 67 |
-
|
| 68 |
-
|
| 69 |
-
|
| 70 |
-
.
|
| 71 |
-
|
| 72 |
-
|
| 73 |
-
|
| 74 |
-
|
| 75 |
-
|
| 76 |
-
|
| 77 |
-
|
| 78 |
-
|
| 79 |
-
|
| 80 |
-
|
| 81 |
-
|
| 82 |
-
|
| 83 |
-
|
| 84 |
-
|
| 85 |
-
.
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 136 |
</head>
|
|
|
|
| 137 |
<body>
|
| 138 |
-
<div class="app">
|
| 139 |
-
|
| 140 |
-
<aside class="sb">
|
| 141 |
-
|
| 142 |
-
|
| 143 |
-
|
| 144 |
-
|
| 145 |
-
|
| 146 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 147 |
</div>
|
| 148 |
-
|
| 149 |
-
|
| 150 |
-
<
|
|
|
|
|
|
|
| 151 |
</div>
|
| 152 |
-
</div>
|
| 153 |
-
</div>
|
| 154 |
|
| 155 |
-
|
| 156 |
-
|
| 157 |
-
|
| 158 |
-
|
| 159 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 160 |
|
| 161 |
-
<!-- Stats Tab -->
|
| 162 |
-
<div id="stats-panel">
|
| 163 |
-
<div class="sb-body">
|
| 164 |
-
<div class="card">
|
| 165 |
-
<div class="ct"><span class="dot off" id="dot-s"></span>Live</div>
|
| 166 |
-
<div class="sr"><span class="sl">Throughput</span><span class="sv g" id="s-tps">β</span></div>
|
| 167 |
-
<div class="sr"><span class="sl">TTFT</span> <span class="sv c" id="s-ttft">β</span></div>
|
| 168 |
-
<div class="sr"><span class="sl">Tokens out</span><span class="sv" id="s-toks">β</span></div>
|
| 169 |
-
<div class="sr"><span class="sl">Latency</span> <span class="sv y" id="s-lat">β</span></div>
|
| 170 |
-
</div>
|
| 171 |
-
<div class="card">
|
| 172 |
-
<div class="ct">Throughput History</div>
|
| 173 |
-
<canvas id="spark"></canvas>
|
| 174 |
-
<div style="margin-top:6px">
|
| 175 |
-
<div class="sr"><span class="sl">Session avg</span><span class="sv g" id="s-avg">β</span></div>
|
| 176 |
-
<div class="sr"><span class="sl">Peak</span> <span class="sv g" id="s-peak">β</span></div>
|
| 177 |
</div>
|
| 178 |
</div>
|
| 179 |
-
|
| 180 |
-
|
| 181 |
-
|
| 182 |
-
<div class="
|
| 183 |
-
|
| 184 |
-
|
| 185 |
-
|
| 186 |
-
<
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 187 |
</div>
|
| 188 |
-
</div>
|
| 189 |
-
<div class="card">
|
| 190 |
-
<div class="ct">Engine</div>
|
| 191 |
-
<div class="sr"><span class="sl">Status</span> <span class="sv g" id="s-eng">β</span></div>
|
| 192 |
-
<div class="sr"><span class="sl">Sessions</span><span class="sv" id="s-sess">β</span></div>
|
| 193 |
-
<div class="sr"><span class="sl">Uptime</span> <span class="sv" id="s-up">β</span></div>
|
| 194 |
</div>
|
| 195 |
|
| 196 |
-
<!--
|
| 197 |
-
<div
|
| 198 |
-
<div class="
|
| 199 |
-
|
| 200 |
-
|
| 201 |
-
|
| 202 |
-
|
| 203 |
-
<
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 204 |
</div>
|
| 205 |
</div>
|
| 206 |
-
|
| 207 |
-
|
| 208 |
-
</div>
|
| 209 |
-
</div>
|
| 210 |
|
| 211 |
-
|
| 212 |
-
|
| 213 |
-
|
| 214 |
-
|
| 215 |
-
|
| 216 |
-
|
| 217 |
-
|
| 218 |
-
|
| 219 |
-
|
| 220 |
-
|
| 221 |
-
|
| 222 |
-
</div>
|
| 223 |
-
</div>
|
| 224 |
-
</div>
|
| 225 |
|
| 226 |
-
|
| 227 |
-
|
| 228 |
-
|
| 229 |
-
|
| 230 |
-
|
| 231 |
-
|
| 232 |
-
|
| 233 |
-
|
| 234 |
-
|
| 235 |
-
|
| 236 |
-
|
| 237 |
-
<
|
| 238 |
-
<
|
| 239 |
-
|
| 240 |
-
</div>
|
| 241 |
-
<div class="pg">
|
| 242 |
-
<label>Top-K <span id="v-topk">40</span></label>
|
| 243 |
-
<input type="range" id="p-topk" min="1" max="200" step="1" value="40"
|
| 244 |
-
oninput="document.getElementById('v-topk').textContent=this.value">
|
| 245 |
-
</div>
|
| 246 |
-
<div class="pg">
|
| 247 |
-
<label>Max tokens <span id="v-maxt">200</span></label>
|
| 248 |
-
<input type="range" id="p-maxt" min="20" max="256" step="10" value="200"
|
| 249 |
-
oninput="document.getElementById('v-maxt').textContent=this.value">
|
| 250 |
</div>
|
| 251 |
</div>
|
| 252 |
</div>
|
| 253 |
-
|
| 254 |
-
|
| 255 |
-
<
|
| 256 |
-
|
| 257 |
-
<
|
| 258 |
-
<
|
| 259 |
-
|
| 260 |
-
|
| 261 |
-
|
| 262 |
-
|
| 263 |
-
|
| 264 |
-
<span class="dot off" id="dot-h"></span>
|
| 265 |
-
<span id="hstatus">Idle</span>
|
| 266 |
-
</div>
|
| 267 |
-
</header>
|
| 268 |
-
|
| 269 |
-
<div class="msgs" id="msgs">
|
| 270 |
-
<div class="welcome" id="welcome">
|
| 271 |
-
<div class="wlogo">NM</div>
|
| 272 |
-
<h2>NanoMind Studio</h2>
|
| 273 |
-
<p>152M parameter GPT-2 model trained on GPT-4 quality data β
|
| 274 |
-
running on a hand-written C++ inference engine with AVX2 SIMD,
|
| 275 |
-
OpenMP parallelism & persistent KV-cache.</p>
|
| 276 |
-
<div class="chips">
|
| 277 |
-
<span class="chip">152M params</span>
|
| 278 |
-
<span class="chip">AVX2 SIMD</span>
|
| 279 |
-
<span class="chip">OpenMP</span>
|
| 280 |
-
<span class="chip">KV Cache</span>
|
| 281 |
-
<span class="chip">Streaming</span>
|
| 282 |
-
<span class="chip">GPT-4 Data</span>
|
| 283 |
</div>
|
| 284 |
-
</
|
| 285 |
</div>
|
| 286 |
|
| 287 |
-
<
|
| 288 |
-
|
| 289 |
-
|
| 290 |
-
|
| 291 |
-
|
| 292 |
-
|
| 293 |
-
|
| 294 |
-
|
| 295 |
-
|
| 296 |
-
|
| 297 |
-
|
| 298 |
-
|
| 299 |
-
|
| 300 |
-
|
| 301 |
-
|
| 302 |
-
|
| 303 |
-
|
| 304 |
-
|
| 305 |
-
|
| 306 |
-
|
| 307 |
-
|
| 308 |
-
|
| 309 |
-
|
| 310 |
-
|
| 311 |
-
|
| 312 |
-
|
| 313 |
-
|
| 314 |
-
|
| 315 |
-
|
| 316 |
-
|
| 317 |
-
}
|
| 318 |
-
|
| 319 |
-
// ββ
|
| 320 |
-
|
| 321 |
-
|
| 322 |
-
|
| 323 |
-
|
| 324 |
-
|
| 325 |
-
|
| 326 |
-
|
| 327 |
-
|
| 328 |
-
|
| 329 |
-
|
| 330 |
-
|
| 331 |
-
|
| 332 |
-
|
| 333 |
-
|
| 334 |
-
|
| 335 |
-
|
| 336 |
-
|
| 337 |
-
|
| 338 |
-
|
| 339 |
-
}
|
| 340 |
-
|
| 341 |
-
|
| 342 |
-
|
| 343 |
-
|
| 344 |
-
|
| 345 |
-
|
| 346 |
-
|
| 347 |
-
});
|
| 348 |
-
document.getElementById('hstatus').textContent = v ? 'Generatingβ¦' : 'Idle';
|
| 349 |
-
}
|
| 350 |
-
function scrollBot() { const el=document.getElementById('msgs'); el.scrollTop=el.scrollHeight; }
|
| 351 |
-
function hideWelcome() { const w=document.getElementById('welcome'); if(w) w.remove(); }
|
| 352 |
-
function esc(s) { return s.replace(/&/g,'&').replace(/</g,'<').replace(/>/g,'>').replace(/"/g,'"').replace(/'/g,'''); }
|
| 353 |
-
|
| 354 |
-
// ββ Messages βββββββββββββββββββββββββββββββββββββββββββββββββ
|
| 355 |
-
function addUserMsg(text) {
|
| 356 |
-
hideWelcome();
|
| 357 |
-
const g = document.createElement('div'); g.className='mg user';
|
| 358 |
-
g.innerHTML=`<div class="mg-role"><div class="mlabel">You</div></div>
|
| 359 |
<div class="mg-body"><div class="bubble">${esc(text)}</div></div>`;
|
| 360 |
-
|
| 361 |
-
}
|
| 362 |
-
function createAsstSlot() {
|
| 363 |
-
|
| 364 |
-
|
| 365 |
-
|
| 366 |
<div class="mg-body">
|
| 367 |
<div class="bubble" id="${bid}"><span class="cur"></span></div>
|
| 368 |
<div class="bmeta" id="${mid}"></div>
|
| 369 |
</div>`;
|
| 370 |
-
|
| 371 |
-
|
| 372 |
-
}
|
| 373 |
-
|
| 374 |
-
// ββ Send βββββββββββββββββββββββββββββββββββββββββββββββββββββ
|
| 375 |
-
async function send() {
|
| 376 |
-
|
| 377 |
-
|
| 378 |
-
|
| 379 |
-
|
| 380 |
-
|
| 381 |
-
|
| 382 |
-
|
| 383 |
-
|
| 384 |
-
|
| 385 |
-
|
| 386 |
-
|
| 387 |
-
|
| 388 |
-
|
| 389 |
-
|
| 390 |
-
|
| 391 |
-
|
| 392 |
-
|
| 393 |
-
|
| 394 |
-
|
| 395 |
-
|
| 396 |
-
|
| 397 |
-
|
| 398 |
-
|
| 399 |
-
|
| 400 |
-
|
| 401 |
-
|
| 402 |
-
|
| 403 |
-
|
| 404 |
-
|
| 405 |
-
|
| 406 |
-
|
| 407 |
-
|
| 408 |
-
|
| 409 |
-
|
| 410 |
-
|
| 411 |
-
|
| 412 |
-
|
| 413 |
-
|
| 414 |
-
|
| 415 |
-
|
| 416 |
-
|
| 417 |
-
|
| 418 |
-
|
| 419 |
-
|
| 420 |
-
|
| 421 |
-
|
| 422 |
-
|
| 423 |
-
|
| 424 |
-
|
| 425 |
-
|
| 426 |
-
|
| 427 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 428 |
}
|
| 429 |
-
turns++; document.getElementById('s-turns').textContent=turns;
|
| 430 |
-
drawSpark();
|
| 431 |
-
} else if(chunk.type==='error'){
|
| 432 |
-
bubble.innerHTML+=`<br><span style="color:var(--red)">β ${esc(chunk.message)}</span>`;
|
| 433 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 434 |
}
|
| 435 |
}
|
| 436 |
-
|
| 437 |
-
|
| 438 |
-
|
| 439 |
-
|
| 440 |
-
|
| 441 |
-
|
| 442 |
-
|
| 443 |
-
|
| 444 |
-
|
| 445 |
-
|
| 446 |
-
|
| 447 |
-
|
| 448 |
-
|
| 449 |
-
|
| 450 |
-
|
| 451 |
-
|
| 452 |
-
|
| 453 |
-
|
| 454 |
-
|
| 455 |
-
|
| 456 |
-
|
| 457 |
-
|
| 458 |
-
|
| 459 |
-
|
| 460 |
-
|
| 461 |
-
|
| 462 |
-
|
| 463 |
-
|
| 464 |
-
// ββ Clear ββββββββββββββββββββββββββββββββββββββββββββββββββββ
|
| 465 |
-
async function clearChat() {
|
| 466 |
-
if(busy) return;
|
| 467 |
-
await fetch(`${API}/chat/reset`,{method:'POST',headers:{'Content-Type':'application/json'},body:JSON.stringify({session_id:sessId})}).catch(()=>{});
|
| 468 |
-
sessId=crypto.randomUUID();
|
| 469 |
-
turns=0; totalToks=0; tpsHist=[]; peakTps=0;
|
| 470 |
-
document.getElementById('msgs').innerHTML=`
|
| 471 |
<div class="welcome" id="welcome">
|
| 472 |
<div class="wlogo">NM</div>
|
| 473 |
<h2>NanoMind Studio</h2>
|
|
@@ -477,110 +1282,111 @@ async function clearChat() {
|
|
| 477 |
<span class="chip">OpenMP</span><span class="chip">KV Cache</span>
|
| 478 |
</div>
|
| 479 |
</div>`;
|
| 480 |
-
|
| 481 |
-
|
| 482 |
-
|
| 483 |
-
}
|
| 484 |
-
|
| 485 |
-
// ββ Metrics Poll βββββββββββββββββββββββββββββββββββββββββββββ
|
| 486 |
-
async function pollMetrics() {
|
| 487 |
-
|
| 488 |
-
|
| 489 |
-
|
| 490 |
-
|
| 491 |
-
|
| 492 |
-
|
| 493 |
-
|
| 494 |
-
|
| 495 |
-
}
|
| 496 |
-
function fmtUptime(s){
|
| 497 |
-
|
| 498 |
-
|
| 499 |
-
|
| 500 |
-
}
|
| 501 |
-
pollMetrics(); setInterval(pollMetrics, 4000);
|
| 502 |
-
|
| 503 |
-
// ββ Benchmark ββββββββββββββββββββββββββββββββββββββββββββββββ
|
| 504 |
-
const PHASES = [
|
| 505 |
-
|
| 506 |
-
|
| 507 |
-
|
| 508 |
-
|
| 509 |
-
|
| 510 |
-
];
|
| 511 |
-
let benchRunning=false, coldSessId=null;
|
| 512 |
-
async function runSinglePrompt(prompt,maxNew,temp,sessionId){
|
| 513 |
-
|
| 514 |
-
|
| 515 |
-
|
| 516 |
-
|
| 517 |
-
|
| 518 |
-
|
| 519 |
-
|
| 520 |
-
|
| 521 |
-
|
| 522 |
-
|
| 523 |
-
|
| 524 |
-
|
| 525 |
-
|
| 526 |
-
|
| 527 |
-
|
| 528 |
-
|
| 529 |
-
|
| 530 |
-
}
|
| 531 |
-
function mkPhaseCard(phase){
|
| 532 |
-
|
| 533 |
-
|
| 534 |
-
|
| 535 |
-
}
|
| 536 |
-
function setPhaseResult(phase,results){
|
| 537 |
-
|
| 538 |
-
|
| 539 |
-
|
| 540 |
-
|
| 541 |
-
|
| 542 |
-
|
| 543 |
-
|
| 544 |
-
|
| 545 |
-
|
| 546 |
-
|
| 547 |
-
|
| 548 |
-
|
| 549 |
-
|
| 550 |
-
|
| 551 |
-
|
| 552 |
-
}
|
| 553 |
-
async function runBench(){
|
| 554 |
-
|
| 555 |
-
|
| 556 |
-
|
| 557 |
-
|
| 558 |
-
|
| 559 |
-
|
| 560 |
-
|
| 561 |
-
|
| 562 |
-
|
| 563 |
-
|
| 564 |
-
|
| 565 |
-
|
| 566 |
-
|
| 567 |
-
|
| 568 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 569 |
}
|
| 570 |
-
summaryData[
|
| 571 |
-
|
| 572 |
-
|
| 573 |
-
|
| 574 |
-
|
| 575 |
-
|
| 576 |
-
|
| 577 |
-
|
| 578 |
-
|
| 579 |
-
const summary=document.createElement('div');
|
| 580 |
-
summary.innerHTML=`${verdict}<div class="b-grid"><div class="b-stat"><div class="bv">${avgTps}</div><div class="bk">Avg tok/s</div></div><div class="b-stat"><div class="bv">${coldTtft}ms</div><div class="bk">Cold TTFT</div></div><div class="b-stat"><div class="bv">${warmTtft}ms</div><div class="bk">Warm TTFT</div></div><div class="b-stat"><div class="bv">${cacheGain}%</div><div class="bk">Cache Speedup</div></div></div>`;
|
| 581 |
-
scroll.insertBefore(summary,scroll.firstChild);
|
| 582 |
-
btn.textContent='βΊ Run Again'; btn.disabled=false; benchRunning=false;
|
| 583 |
-
}
|
| 584 |
-
</script>
|
| 585 |
</body>
|
|
|
|
| 586 |
</html>
|
|
|
|
| 1 |
<!DOCTYPE html>
|
| 2 |
<html lang="en">
|
| 3 |
+
|
| 4 |
<head>
|
| 5 |
+
<meta charset="UTF-8" />
|
| 6 |
+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
| 7 |
+
<title>NanoMind Β· 152M</title>
|
| 8 |
+
<link rel="preconnect" href="https://fonts.googleapis.com">
|
| 9 |
+
<link
|
| 10 |
+
href="https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@300;400;500;700&family=DM+Sans:wght@300;500;700;900&display=swap"
|
| 11 |
+
rel="stylesheet">
|
| 12 |
+
<style>
|
| 13 |
+
*,
|
| 14 |
+
*::before,
|
| 15 |
+
*::after {
|
| 16 |
+
box-sizing: border-box;
|
| 17 |
+
margin: 0;
|
| 18 |
+
padding: 0
|
| 19 |
+
}
|
| 20 |
+
|
| 21 |
+
:root {
|
| 22 |
+
--bg: #06080f;
|
| 23 |
+
--bg1: #0c0f1a;
|
| 24 |
+
--bg2: #121627;
|
| 25 |
+
--bg3: #1a2035;
|
| 26 |
+
--bg4: #222840;
|
| 27 |
+
--acc: #7c6bff;
|
| 28 |
+
--acc2: #9d8fff;
|
| 29 |
+
--acc3: #5a48e0;
|
| 30 |
+
--dim: rgba(124, 107, 255, .08);
|
| 31 |
+
--dimb: rgba(124, 107, 255, .18);
|
| 32 |
+
--cyan: #3ddcff;
|
| 33 |
+
--green: #3dffb4;
|
| 34 |
+
--red: #ff5c6e;
|
| 35 |
+
--warn: #ffc260;
|
| 36 |
+
--t0: #f2f0ff;
|
| 37 |
+
--t1: #c0bde8;
|
| 38 |
+
--t2: #7a78a0;
|
| 39 |
+
--t3: #3a384d;
|
| 40 |
+
--mono: 'IBM Plex Mono', monospace;
|
| 41 |
+
--sans: 'DM Sans', sans-serif;
|
| 42 |
+
--r: 8px;
|
| 43 |
+
--sb: 280px;
|
| 44 |
+
}
|
| 45 |
+
|
| 46 |
+
html,
|
| 47 |
+
body {
|
| 48 |
+
height: 100%;
|
| 49 |
+
background: var(--bg);
|
| 50 |
+
color: var(--t0);
|
| 51 |
+
font-family: var(--mono);
|
| 52 |
+
font-size: 13px;
|
| 53 |
+
overflow: hidden
|
| 54 |
+
}
|
| 55 |
+
|
| 56 |
+
.app {
|
| 57 |
+
display: flex;
|
| 58 |
+
height: 100vh
|
| 59 |
+
}
|
| 60 |
+
|
| 61 |
+
.app::before {
|
| 62 |
+
content: '';
|
| 63 |
+
position: fixed;
|
| 64 |
+
inset: 0;
|
| 65 |
+
background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.03'/%3E%3C/svg%3E");
|
| 66 |
+
pointer-events: none;
|
| 67 |
+
z-index: 0;
|
| 68 |
+
opacity: .4
|
| 69 |
+
}
|
| 70 |
+
|
| 71 |
+
.app>* {
|
| 72 |
+
position: relative;
|
| 73 |
+
z-index: 1
|
| 74 |
+
}
|
| 75 |
+
|
| 76 |
+
.sb {
|
| 77 |
+
width: var(--sb);
|
| 78 |
+
min-width: var(--sb);
|
| 79 |
+
background: var(--bg1);
|
| 80 |
+
border-right: 1px solid var(--bg3);
|
| 81 |
+
display: flex;
|
| 82 |
+
flex-direction: column;
|
| 83 |
+
overflow: hidden
|
| 84 |
+
}
|
| 85 |
+
|
| 86 |
+
.sb-logo {
|
| 87 |
+
padding: 16px;
|
| 88 |
+
background: var(--bg);
|
| 89 |
+
border-bottom: 1px solid var(--bg3);
|
| 90 |
+
flex-shrink: 0
|
| 91 |
+
}
|
| 92 |
+
|
| 93 |
+
.logo-row {
|
| 94 |
+
display: flex;
|
| 95 |
+
align-items: center;
|
| 96 |
+
gap: 10px
|
| 97 |
+
}
|
| 98 |
+
|
| 99 |
+
.logo-icon {
|
| 100 |
+
width: 34px;
|
| 101 |
+
height: 34px;
|
| 102 |
+
border-radius: 9px;
|
| 103 |
+
background: linear-gradient(135deg, var(--acc3), var(--acc2));
|
| 104 |
+
display: flex;
|
| 105 |
+
align-items: center;
|
| 106 |
+
justify-content: center;
|
| 107 |
+
flex-shrink: 0;
|
| 108 |
+
box-shadow: 0 0 20px rgba(124, 107, 255, .35)
|
| 109 |
+
}
|
| 110 |
+
|
| 111 |
+
.logo-icon svg {
|
| 112 |
+
fill: #fff
|
| 113 |
+
}
|
| 114 |
+
|
| 115 |
+
.logo-text h2 {
|
| 116 |
+
font-family: var(--sans);
|
| 117 |
+
font-size: 18px;
|
| 118 |
+
font-weight: 900;
|
| 119 |
+
letter-spacing: -.04em;
|
| 120 |
+
color: var(--t0)
|
| 121 |
+
}
|
| 122 |
+
|
| 123 |
+
.logo-text h2 em {
|
| 124 |
+
color: var(--acc2);
|
| 125 |
+
font-style: normal
|
| 126 |
+
}
|
| 127 |
+
|
| 128 |
+
.logo-text p {
|
| 129 |
+
font-size: 9px;
|
| 130 |
+
color: var(--t2);
|
| 131 |
+
margin-top: 2px;
|
| 132 |
+
letter-spacing: .1em;
|
| 133 |
+
text-transform: uppercase
|
| 134 |
+
}
|
| 135 |
+
|
| 136 |
+
.sb-tabs {
|
| 137 |
+
display: flex;
|
| 138 |
+
border-bottom: 1px solid var(--bg3);
|
| 139 |
+
flex-shrink: 0;
|
| 140 |
+
background: var(--bg1)
|
| 141 |
+
}
|
| 142 |
+
|
| 143 |
+
.sb-tab {
|
| 144 |
+
flex: 1;
|
| 145 |
+
padding: 8px 4px;
|
| 146 |
+
text-align: center;
|
| 147 |
+
font-size: 9px;
|
| 148 |
+
font-weight: 700;
|
| 149 |
+
color: var(--t2);
|
| 150 |
+
text-transform: uppercase;
|
| 151 |
+
letter-spacing: .08em;
|
| 152 |
+
cursor: pointer;
|
| 153 |
+
border: none;
|
| 154 |
+
background: none;
|
| 155 |
+
font-family: var(--mono);
|
| 156 |
+
border-bottom: 2px solid transparent;
|
| 157 |
+
transition: .15s
|
| 158 |
+
}
|
| 159 |
+
|
| 160 |
+
.sb-tab.on {
|
| 161 |
+
color: var(--acc2);
|
| 162 |
+
border-bottom-color: var(--acc);
|
| 163 |
+
background: var(--dim)
|
| 164 |
+
}
|
| 165 |
+
|
| 166 |
+
.sb-body {
|
| 167 |
+
flex: 1;
|
| 168 |
+
overflow-y: auto;
|
| 169 |
+
padding: 10px;
|
| 170 |
+
scrollbar-width: thin;
|
| 171 |
+
scrollbar-color: var(--bg4) transparent
|
| 172 |
+
}
|
| 173 |
+
|
| 174 |
+
.card {
|
| 175 |
+
background: var(--bg2);
|
| 176 |
+
border: 1px solid var(--bg3);
|
| 177 |
+
border-radius: var(--r);
|
| 178 |
+
padding: 11px 13px;
|
| 179 |
+
margin-bottom: 8px
|
| 180 |
+
}
|
| 181 |
+
|
| 182 |
+
.ct {
|
| 183 |
+
font-size: 9px;
|
| 184 |
+
font-weight: 700;
|
| 185 |
+
color: var(--t2);
|
| 186 |
+
text-transform: uppercase;
|
| 187 |
+
letter-spacing: .1em;
|
| 188 |
+
margin-bottom: 8px;
|
| 189 |
+
display: flex;
|
| 190 |
+
align-items: center;
|
| 191 |
+
gap: 6px
|
| 192 |
+
}
|
| 193 |
+
|
| 194 |
+
.sr {
|
| 195 |
+
display: flex;
|
| 196 |
+
justify-content: space-between;
|
| 197 |
+
align-items: center;
|
| 198 |
+
padding: 3px 0
|
| 199 |
+
}
|
| 200 |
+
|
| 201 |
+
.sl {
|
| 202 |
+
color: var(--t1);
|
| 203 |
+
font-size: 11px
|
| 204 |
+
}
|
| 205 |
+
|
| 206 |
+
.sv {
|
| 207 |
+
font-size: 12px;
|
| 208 |
+
font-weight: 700;
|
| 209 |
+
font-variant-numeric: tabular-nums;
|
| 210 |
+
color: var(--t0)
|
| 211 |
+
}
|
| 212 |
+
|
| 213 |
+
.g {
|
| 214 |
+
color: var(--green)
|
| 215 |
+
}
|
| 216 |
+
|
| 217 |
+
.c {
|
| 218 |
+
color: var(--cyan)
|
| 219 |
+
}
|
| 220 |
+
|
| 221 |
+
.y {
|
| 222 |
+
color: var(--warn)
|
| 223 |
+
}
|
| 224 |
+
|
| 225 |
+
.r {
|
| 226 |
+
color: var(--red)
|
| 227 |
+
}
|
| 228 |
+
|
| 229 |
+
.p {
|
| 230 |
+
color: var(--acc2)
|
| 231 |
+
}
|
| 232 |
+
|
| 233 |
+
.dot {
|
| 234 |
+
display: inline-block;
|
| 235 |
+
width: 6px;
|
| 236 |
+
height: 6px;
|
| 237 |
+
border-radius: 50%;
|
| 238 |
+
flex-shrink: 0
|
| 239 |
+
}
|
| 240 |
+
|
| 241 |
+
.dot.off {
|
| 242 |
+
background: var(--t3)
|
| 243 |
+
}
|
| 244 |
+
|
| 245 |
+
.dot.on {
|
| 246 |
+
background: var(--green);
|
| 247 |
+
animation: pulse 1.4s infinite
|
| 248 |
+
}
|
| 249 |
+
|
| 250 |
+
@keyframes pulse {
|
| 251 |
+
|
| 252 |
+
0%,
|
| 253 |
+
100% {
|
| 254 |
+
opacity: 1;
|
| 255 |
+
transform: scale(1)
|
| 256 |
+
}
|
| 257 |
+
|
| 258 |
+
50% {
|
| 259 |
+
opacity: .3;
|
| 260 |
+
transform: scale(.7)
|
| 261 |
+
}
|
| 262 |
+
}
|
| 263 |
+
|
| 264 |
+
canvas#spark {
|
| 265 |
+
width: 100%;
|
| 266 |
+
height: 44px;
|
| 267 |
+
display: block;
|
| 268 |
+
border-radius: var(--r);
|
| 269 |
+
background: var(--bg)
|
| 270 |
+
}
|
| 271 |
+
|
| 272 |
+
.ta {
|
| 273 |
+
width: 100%;
|
| 274 |
+
background: var(--bg);
|
| 275 |
+
border: 1px solid var(--bg3);
|
| 276 |
+
border-radius: var(--r);
|
| 277 |
+
color: var(--t0);
|
| 278 |
+
font-size: 11px;
|
| 279 |
+
padding: 8px 10px;
|
| 280 |
+
resize: vertical;
|
| 281 |
+
min-height: 56px;
|
| 282 |
+
font-family: var(--mono);
|
| 283 |
+
line-height: 1.6
|
| 284 |
+
}
|
| 285 |
+
|
| 286 |
+
.ta:focus {
|
| 287 |
+
outline: none;
|
| 288 |
+
border-color: var(--acc)
|
| 289 |
+
}
|
| 290 |
+
|
| 291 |
+
.pg {
|
| 292 |
+
display: flex;
|
| 293 |
+
flex-direction: column;
|
| 294 |
+
gap: 4px
|
| 295 |
+
}
|
| 296 |
+
|
| 297 |
+
.pg label {
|
| 298 |
+
font-size: 9px;
|
| 299 |
+
color: var(--t2);
|
| 300 |
+
text-transform: uppercase;
|
| 301 |
+
letter-spacing: .08em;
|
| 302 |
+
display: flex;
|
| 303 |
+
justify-content: space-between
|
| 304 |
+
}
|
| 305 |
+
|
| 306 |
+
.pg label span {
|
| 307 |
+
color: var(--acc2);
|
| 308 |
+
font-weight: 700
|
| 309 |
+
}
|
| 310 |
+
|
| 311 |
+
.pg input[type=range] {
|
| 312 |
+
width: 100%;
|
| 313 |
+
-webkit-appearance: none;
|
| 314 |
+
height: 2px;
|
| 315 |
+
background: var(--bg4);
|
| 316 |
+
border-radius: 1px;
|
| 317 |
+
outline: none
|
| 318 |
+
}
|
| 319 |
+
|
| 320 |
+
.pg input[type=range]::-webkit-slider-thumb {
|
| 321 |
+
-webkit-appearance: none;
|
| 322 |
+
width: 11px;
|
| 323 |
+
height: 11px;
|
| 324 |
+
border-radius: 50%;
|
| 325 |
+
background: var(--acc);
|
| 326 |
+
cursor: pointer;
|
| 327 |
+
border: 2px solid var(--bg1)
|
| 328 |
+
}
|
| 329 |
+
|
| 330 |
+
.btn {
|
| 331 |
+
display: inline-flex;
|
| 332 |
+
align-items: center;
|
| 333 |
+
gap: 5px;
|
| 334 |
+
padding: 6px 12px;
|
| 335 |
+
border-radius: var(--r);
|
| 336 |
+
border: 1px solid var(--bg4);
|
| 337 |
+
cursor: pointer;
|
| 338 |
+
font-size: 10px;
|
| 339 |
+
font-weight: 700;
|
| 340 |
+
font-family: var(--mono);
|
| 341 |
+
text-transform: uppercase;
|
| 342 |
+
letter-spacing: .05em;
|
| 343 |
+
transition: .13s
|
| 344 |
+
}
|
| 345 |
+
|
| 346 |
+
.bp {
|
| 347 |
+
background: var(--acc);
|
| 348 |
+
color: #fff;
|
| 349 |
+
border-color: var(--acc)
|
| 350 |
+
}
|
| 351 |
+
|
| 352 |
+
.bp:hover {
|
| 353 |
+
background: var(--acc2)
|
| 354 |
+
}
|
| 355 |
+
|
| 356 |
+
.bs {
|
| 357 |
+
background: var(--bg3);
|
| 358 |
+
color: var(--t1)
|
| 359 |
+
}
|
| 360 |
+
|
| 361 |
+
.bs:hover {
|
| 362 |
+
background: var(--bg4);
|
| 363 |
+
color: var(--t0)
|
| 364 |
+
}
|
| 365 |
+
|
| 366 |
+
.btn.full {
|
| 367 |
+
width: 100%;
|
| 368 |
+
justify-content: center
|
| 369 |
+
}
|
| 370 |
+
|
| 371 |
+
.btn:disabled {
|
| 372 |
+
opacity: .3;
|
| 373 |
+
cursor: not-allowed
|
| 374 |
+
}
|
| 375 |
+
|
| 376 |
+
/* ββ Filter items ββ */
|
| 377 |
+
.fi {
|
| 378 |
+
display: flex;
|
| 379 |
+
align-items: center;
|
| 380 |
+
gap: 8px;
|
| 381 |
+
padding: 5px 7px;
|
| 382 |
+
border-radius: 6px;
|
| 383 |
+
cursor: pointer;
|
| 384 |
+
border: 1px solid transparent;
|
| 385 |
+
transition: .12s;
|
| 386 |
+
margin-bottom: 3px;
|
| 387 |
+
user-select: none
|
| 388 |
+
}
|
| 389 |
+
|
| 390 |
+
.fi:hover {
|
| 391 |
+
background: var(--bg3)
|
| 392 |
+
}
|
| 393 |
+
|
| 394 |
+
.fi.on {
|
| 395 |
+
background: rgba(124, 107, 255, .1);
|
| 396 |
+
border-color: rgba(124, 107, 255, .25)
|
| 397 |
+
}
|
| 398 |
+
|
| 399 |
+
.fi.stories-on {
|
| 400 |
+
background: rgba(61, 220, 255, .08);
|
| 401 |
+
border-color: rgba(61, 220, 255, .25)
|
| 402 |
+
}
|
| 403 |
+
|
| 404 |
+
.fcb {
|
| 405 |
+
width: 13px;
|
| 406 |
+
height: 13px;
|
| 407 |
+
border-radius: 3px;
|
| 408 |
+
border: 1px solid var(--bg4);
|
| 409 |
+
background: var(--bg);
|
| 410 |
+
display: flex;
|
| 411 |
+
align-items: center;
|
| 412 |
+
justify-content: center;
|
| 413 |
+
flex-shrink: 0;
|
| 414 |
+
transition: .12s
|
| 415 |
+
}
|
| 416 |
+
|
| 417 |
+
.fi.on .fcb {
|
| 418 |
+
background: var(--acc);
|
| 419 |
+
border-color: var(--acc)
|
| 420 |
+
}
|
| 421 |
+
|
| 422 |
+
.fi.stories-on .fcb {
|
| 423 |
+
background: var(--cyan);
|
| 424 |
+
border-color: var(--cyan)
|
| 425 |
+
}
|
| 426 |
+
|
| 427 |
+
.fcb svg {
|
| 428 |
+
opacity: 0;
|
| 429 |
+
transition: .1s
|
| 430 |
+
}
|
| 431 |
+
|
| 432 |
+
.fi.on .fcb svg,
|
| 433 |
+
.fi.stories-on .fcb svg {
|
| 434 |
+
opacity: 1
|
| 435 |
+
}
|
| 436 |
+
|
| 437 |
+
.fdot {
|
| 438 |
+
width: 6px;
|
| 439 |
+
height: 6px;
|
| 440 |
+
border-radius: 50%;
|
| 441 |
+
flex-shrink: 0
|
| 442 |
+
}
|
| 443 |
+
|
| 444 |
+
.flabel {
|
| 445 |
+
font-size: 11px;
|
| 446 |
+
color: var(--t1)
|
| 447 |
+
}
|
| 448 |
+
|
| 449 |
+
.fi.on .flabel,
|
| 450 |
+
.fi.stories-on .flabel {
|
| 451 |
+
color: var(--t0)
|
| 452 |
+
}
|
| 453 |
+
|
| 454 |
+
#bench-panel {
|
| 455 |
+
display: none;
|
| 456 |
+
flex-direction: column;
|
| 457 |
+
height: 100%;
|
| 458 |
+
overflow: hidden
|
| 459 |
+
}
|
| 460 |
+
|
| 461 |
+
#bench-panel.visible {
|
| 462 |
+
display: flex
|
| 463 |
+
}
|
| 464 |
+
|
| 465 |
+
#stats-panel,
|
| 466 |
+
#params-panel {
|
| 467 |
+
display: flex;
|
| 468 |
+
flex-direction: column;
|
| 469 |
+
flex: 1;
|
| 470 |
+
overflow: hidden
|
| 471 |
+
}
|
| 472 |
+
|
| 473 |
+
.bench-actions {
|
| 474 |
+
padding: 10px;
|
| 475 |
+
flex-shrink: 0;
|
| 476 |
+
display: flex;
|
| 477 |
+
flex-direction: column;
|
| 478 |
+
gap: 6px
|
| 479 |
+
}
|
| 480 |
+
|
| 481 |
+
.bench-scroll {
|
| 482 |
+
flex: 1;
|
| 483 |
+
overflow-y: auto;
|
| 484 |
+
padding: 0 10px 10px;
|
| 485 |
+
scrollbar-width: thin;
|
| 486 |
+
scrollbar-color: var(--bg4) transparent
|
| 487 |
+
}
|
| 488 |
+
|
| 489 |
+
.b-grid {
|
| 490 |
+
display: grid;
|
| 491 |
+
grid-template-columns: 1fr 1fr;
|
| 492 |
+
gap: 5px;
|
| 493 |
+
margin-bottom: 10px
|
| 494 |
+
}
|
| 495 |
+
|
| 496 |
+
.b-stat {
|
| 497 |
+
background: var(--bg2);
|
| 498 |
+
border: 1px solid var(--bg3);
|
| 499 |
+
border-radius: var(--r);
|
| 500 |
+
padding: 10px;
|
| 501 |
+
text-align: center
|
| 502 |
+
}
|
| 503 |
+
|
| 504 |
+
.b-stat .bv {
|
| 505 |
+
font-family: var(--sans);
|
| 506 |
+
font-size: 22px;
|
| 507 |
+
font-weight: 900;
|
| 508 |
+
color: var(--acc2);
|
| 509 |
+
letter-spacing: -.04em
|
| 510 |
+
}
|
| 511 |
+
|
| 512 |
+
.b-stat .bk {
|
| 513 |
+
font-size: 9px;
|
| 514 |
+
color: var(--t2);
|
| 515 |
+
text-transform: uppercase;
|
| 516 |
+
letter-spacing: .1em;
|
| 517 |
+
margin-top: 2px
|
| 518 |
+
}
|
| 519 |
+
|
| 520 |
+
.ph-card {
|
| 521 |
+
background: var(--bg2);
|
| 522 |
+
border: 1px solid var(--bg3);
|
| 523 |
+
border-radius: var(--r);
|
| 524 |
+
padding: 9px 11px;
|
| 525 |
+
margin-bottom: 6px;
|
| 526 |
+
animation: fadeup .2s ease
|
| 527 |
+
}
|
| 528 |
+
|
| 529 |
+
.ph-title {
|
| 530 |
+
font-size: 9px;
|
| 531 |
+
font-weight: 700;
|
| 532 |
+
color: var(--acc2);
|
| 533 |
+
text-transform: uppercase;
|
| 534 |
+
letter-spacing: .08em;
|
| 535 |
+
margin-bottom: 6px
|
| 536 |
+
}
|
| 537 |
+
|
| 538 |
+
.ph-label {
|
| 539 |
+
font-size: 11px;
|
| 540 |
+
color: var(--t2);
|
| 541 |
+
margin-bottom: 4px
|
| 542 |
+
}
|
| 543 |
+
|
| 544 |
+
.ph-stats {
|
| 545 |
+
display: flex;
|
| 546 |
+
gap: 8px;
|
| 547 |
+
flex-wrap: wrap;
|
| 548 |
+
margin-top: 5px
|
| 549 |
+
}
|
| 550 |
+
|
| 551 |
+
.ph-stat {
|
| 552 |
+
display: flex;
|
| 553 |
+
flex-direction: column;
|
| 554 |
+
gap: 1px;
|
| 555 |
+
min-width: 50px
|
| 556 |
+
}
|
| 557 |
+
|
| 558 |
+
.ph-stat .pv {
|
| 559 |
+
font-size: 13px;
|
| 560 |
+
font-weight: 700;
|
| 561 |
+
color: var(--green);
|
| 562 |
+
font-variant-numeric: tabular-nums
|
| 563 |
+
}
|
| 564 |
+
|
| 565 |
+
.ph-stat .pk {
|
| 566 |
+
font-size: 9px;
|
| 567 |
+
color: var(--t2);
|
| 568 |
+
text-transform: uppercase;
|
| 569 |
+
letter-spacing: .06em
|
| 570 |
+
}
|
| 571 |
+
|
| 572 |
+
.ph-bar {
|
| 573 |
+
height: 2px;
|
| 574 |
+
background: var(--bg4);
|
| 575 |
+
border-radius: 1px;
|
| 576 |
+
margin-top: 5px;
|
| 577 |
+
overflow: hidden
|
| 578 |
+
}
|
| 579 |
+
|
| 580 |
+
.ph-fill {
|
| 581 |
+
height: 100%;
|
| 582 |
+
background: linear-gradient(90deg, var(--acc3), var(--acc2));
|
| 583 |
+
border-radius: 1px;
|
| 584 |
+
transition: width .5s ease;
|
| 585 |
+
width: 0%
|
| 586 |
+
}
|
| 587 |
+
|
| 588 |
+
.ph-running {
|
| 589 |
+
display: flex;
|
| 590 |
+
align-items: center;
|
| 591 |
+
gap: 5px;
|
| 592 |
+
font-size: 10px;
|
| 593 |
+
color: var(--warn)
|
| 594 |
+
}
|
| 595 |
+
|
| 596 |
+
.spin {
|
| 597 |
+
width: 8px;
|
| 598 |
+
height: 8px;
|
| 599 |
+
border: 1.5px solid var(--warn);
|
| 600 |
+
border-top-color: transparent;
|
| 601 |
+
border-radius: 50%;
|
| 602 |
+
animation: spin .7s linear infinite;
|
| 603 |
+
flex-shrink: 0
|
| 604 |
+
}
|
| 605 |
+
|
| 606 |
+
@keyframes spin {
|
| 607 |
+
to {
|
| 608 |
+
transform: rotate(360deg)
|
| 609 |
+
}
|
| 610 |
+
}
|
| 611 |
+
|
| 612 |
+
.bench-empty {
|
| 613 |
+
text-align: center;
|
| 614 |
+
padding: 30px 16px;
|
| 615 |
+
color: var(--t2);
|
| 616 |
+
font-size: 12px;
|
| 617 |
+
line-height: 1.9
|
| 618 |
+
}
|
| 619 |
+
|
| 620 |
+
.verdict {
|
| 621 |
+
padding: 10px 12px;
|
| 622 |
+
border-radius: var(--r);
|
| 623 |
+
font-size: 11px;
|
| 624 |
+
margin-bottom: 8px;
|
| 625 |
+
border: 1px solid var(--bg3)
|
| 626 |
+
}
|
| 627 |
+
|
| 628 |
+
.verdict.good {
|
| 629 |
+
border-color: rgba(61, 255, 180, .3);
|
| 630 |
+
background: rgba(61, 255, 180, .06);
|
| 631 |
+
color: var(--green)
|
| 632 |
+
}
|
| 633 |
+
|
| 634 |
+
.verdict.mid {
|
| 635 |
+
border-color: rgba(255, 194, 96, .3);
|
| 636 |
+
background: rgba(255, 194, 96, .06);
|
| 637 |
+
color: var(--warn)
|
| 638 |
+
}
|
| 639 |
+
|
| 640 |
+
.chat {
|
| 641 |
+
flex: 1;
|
| 642 |
+
display: flex;
|
| 643 |
+
flex-direction: column;
|
| 644 |
+
overflow: hidden
|
| 645 |
+
}
|
| 646 |
+
|
| 647 |
+
.chat-hdr {
|
| 648 |
+
height: 50px;
|
| 649 |
+
display: flex;
|
| 650 |
+
align-items: center;
|
| 651 |
+
padding: 0 20px;
|
| 652 |
+
border-bottom: 1px solid var(--bg3);
|
| 653 |
+
background: var(--bg1);
|
| 654 |
+
gap: 8px;
|
| 655 |
+
flex-shrink: 0
|
| 656 |
+
}
|
| 657 |
+
|
| 658 |
+
.badge {
|
| 659 |
+
background: var(--dim);
|
| 660 |
+
border: 1px solid rgba(124, 107, 255, .3);
|
| 661 |
+
border-radius: 20px;
|
| 662 |
+
padding: 3px 10px;
|
| 663 |
+
font-size: 10px;
|
| 664 |
+
font-weight: 700;
|
| 665 |
+
color: var(--acc2);
|
| 666 |
+
font-family: var(--sans)
|
| 667 |
+
}
|
| 668 |
+
|
| 669 |
+
.hdr-title {
|
| 670 |
+
font-family: var(--sans);
|
| 671 |
+
font-size: 13px;
|
| 672 |
+
font-weight: 600;
|
| 673 |
+
color: var(--t1)
|
| 674 |
+
}
|
| 675 |
+
|
| 676 |
+
.spc {
|
| 677 |
+
flex: 1
|
| 678 |
+
}
|
| 679 |
+
|
| 680 |
+
.hpill {
|
| 681 |
+
display: flex;
|
| 682 |
+
align-items: center;
|
| 683 |
+
gap: 6px;
|
| 684 |
+
font-size: 10px;
|
| 685 |
+
color: var(--t2);
|
| 686 |
+
text-transform: uppercase;
|
| 687 |
+
letter-spacing: .06em
|
| 688 |
+
}
|
| 689 |
+
|
| 690 |
+
.msgs {
|
| 691 |
+
flex: 1;
|
| 692 |
+
overflow-y: auto;
|
| 693 |
+
display: flex;
|
| 694 |
+
flex-direction: column;
|
| 695 |
+
scrollbar-width: thin;
|
| 696 |
+
scrollbar-color: var(--bg4) transparent
|
| 697 |
+
}
|
| 698 |
+
|
| 699 |
+
.welcome {
|
| 700 |
+
flex: 1;
|
| 701 |
+
display: flex;
|
| 702 |
+
flex-direction: column;
|
| 703 |
+
align-items: center;
|
| 704 |
+
justify-content: center;
|
| 705 |
+
gap: 14px;
|
| 706 |
+
text-align: center;
|
| 707 |
+
padding: 40px;
|
| 708 |
+
animation: fadeup .4s ease
|
| 709 |
+
}
|
| 710 |
+
|
| 711 |
+
.wlogo {
|
| 712 |
+
font-family: var(--sans);
|
| 713 |
+
font-size: 72px;
|
| 714 |
+
font-weight: 900;
|
| 715 |
+
background: linear-gradient(135deg, var(--acc), var(--cyan));
|
| 716 |
+
-webkit-background-clip: text;
|
| 717 |
+
-webkit-text-fill-color: transparent;
|
| 718 |
+
background-clip: text;
|
| 719 |
+
letter-spacing: -.05em;
|
| 720 |
+
line-height: 1
|
| 721 |
+
}
|
| 722 |
+
|
| 723 |
+
.welcome h2 {
|
| 724 |
+
font-family: var(--sans);
|
| 725 |
+
font-size: 22px;
|
| 726 |
+
font-weight: 700;
|
| 727 |
+
color: var(--t0);
|
| 728 |
+
letter-spacing: -.02em
|
| 729 |
+
}
|
| 730 |
+
|
| 731 |
+
.welcome p {
|
| 732 |
+
max-width: 400px;
|
| 733 |
+
line-height: 1.8;
|
| 734 |
+
font-size: 12px;
|
| 735 |
+
color: var(--t1)
|
| 736 |
+
}
|
| 737 |
+
|
| 738 |
+
.chips {
|
| 739 |
+
display: flex;
|
| 740 |
+
gap: 6px;
|
| 741 |
+
flex-wrap: wrap;
|
| 742 |
+
justify-content: center;
|
| 743 |
+
margin-top: 2px
|
| 744 |
+
}
|
| 745 |
+
|
| 746 |
+
.chip {
|
| 747 |
+
font-size: 9px;
|
| 748 |
+
padding: 4px 10px;
|
| 749 |
+
border: 1px solid var(--bg4);
|
| 750 |
+
border-radius: 20px;
|
| 751 |
+
color: var(--t2);
|
| 752 |
+
letter-spacing: .07em;
|
| 753 |
+
text-transform: uppercase;
|
| 754 |
+
background: var(--bg2)
|
| 755 |
+
}
|
| 756 |
+
|
| 757 |
+
.mg {
|
| 758 |
+
display: flex;
|
| 759 |
+
gap: 0;
|
| 760 |
+
padding: 14px 20px;
|
| 761 |
+
border-bottom: 1px solid var(--bg3);
|
| 762 |
+
animation: fadeup .18s ease
|
| 763 |
+
}
|
| 764 |
+
|
| 765 |
+
.mg:last-child {
|
| 766 |
+
border-bottom: none
|
| 767 |
+
}
|
| 768 |
+
|
| 769 |
+
@keyframes fadeup {
|
| 770 |
+
from {
|
| 771 |
+
opacity: 0;
|
| 772 |
+
transform: translateY(6px)
|
| 773 |
+
}
|
| 774 |
+
|
| 775 |
+
to {
|
| 776 |
+
opacity: 1;
|
| 777 |
+
transform: none
|
| 778 |
+
}
|
| 779 |
+
}
|
| 780 |
+
|
| 781 |
+
.mg-role {
|
| 782 |
+
width: 60px;
|
| 783 |
+
flex-shrink: 0;
|
| 784 |
+
padding-top: 2px
|
| 785 |
+
}
|
| 786 |
+
|
| 787 |
+
.mlabel {
|
| 788 |
+
font-size: 9px;
|
| 789 |
+
font-weight: 700;
|
| 790 |
+
letter-spacing: .1em;
|
| 791 |
+
text-transform: uppercase
|
| 792 |
+
}
|
| 793 |
+
|
| 794 |
+
.mg.user .mlabel {
|
| 795 |
+
color: var(--acc2)
|
| 796 |
+
}
|
| 797 |
+
|
| 798 |
+
.mg.asst .mlabel {
|
| 799 |
+
color: var(--cyan)
|
| 800 |
+
}
|
| 801 |
+
|
| 802 |
+
.mg-body {
|
| 803 |
+
flex: 1;
|
| 804 |
+
min-width: 0
|
| 805 |
+
}
|
| 806 |
+
|
| 807 |
+
.bubble {
|
| 808 |
+
font-size: 13px;
|
| 809 |
+
line-height: 1.75;
|
| 810 |
+
color: var(--t1);
|
| 811 |
+
white-space: pre-wrap;
|
| 812 |
+
word-break: break-word;
|
| 813 |
+
max-width: 660px
|
| 814 |
+
}
|
| 815 |
+
|
| 816 |
+
.mg.user .bubble {
|
| 817 |
+
color: var(--t2)
|
| 818 |
+
}
|
| 819 |
+
|
| 820 |
+
.cur {
|
| 821 |
+
display: inline-block;
|
| 822 |
+
width: 7px;
|
| 823 |
+
height: 2px;
|
| 824 |
+
background: var(--acc2);
|
| 825 |
+
margin-left: 3px;
|
| 826 |
+
vertical-align: middle;
|
| 827 |
+
animation: blink .6s infinite
|
| 828 |
+
}
|
| 829 |
+
|
| 830 |
+
@keyframes blink {
|
| 831 |
+
|
| 832 |
+
0%,
|
| 833 |
+
49% {
|
| 834 |
+
opacity: 1
|
| 835 |
+
}
|
| 836 |
+
|
| 837 |
+
50%,
|
| 838 |
+
100% {
|
| 839 |
+
opacity: 0
|
| 840 |
+
}
|
| 841 |
+
}
|
| 842 |
+
|
| 843 |
+
.bmeta {
|
| 844 |
+
font-size: 10px;
|
| 845 |
+
color: var(--t3);
|
| 846 |
+
margin-top: 5px;
|
| 847 |
+
display: flex;
|
| 848 |
+
flex-wrap: wrap;
|
| 849 |
+
gap: 8px
|
| 850 |
+
}
|
| 851 |
+
|
| 852 |
+
.bmeta b {
|
| 853 |
+
color: var(--acc2)
|
| 854 |
+
}
|
| 855 |
+
|
| 856 |
+
.inputbar {
|
| 857 |
+
padding: 12px 16px;
|
| 858 |
+
border-top: 1px solid var(--bg3);
|
| 859 |
+
background: var(--bg1);
|
| 860 |
+
flex-shrink: 0
|
| 861 |
+
}
|
| 862 |
+
|
| 863 |
+
.inputwrap {
|
| 864 |
+
background: var(--bg2);
|
| 865 |
+
border: 1px solid var(--bg3);
|
| 866 |
+
border-radius: var(--r);
|
| 867 |
+
display: flex;
|
| 868 |
+
align-items: flex-end;
|
| 869 |
+
padding: 3px 3px 3px 12px;
|
| 870 |
+
gap: 4px;
|
| 871 |
+
transition: .13s
|
| 872 |
+
}
|
| 873 |
+
|
| 874 |
+
.inputwrap:focus-within {
|
| 875 |
+
border-color: var(--acc)
|
| 876 |
+
}
|
| 877 |
+
|
| 878 |
+
#inp {
|
| 879 |
+
flex: 1;
|
| 880 |
+
background: none;
|
| 881 |
+
border: none;
|
| 882 |
+
outline: none;
|
| 883 |
+
color: var(--t0);
|
| 884 |
+
font-size: 13px;
|
| 885 |
+
font-family: var(--mono);
|
| 886 |
+
resize: none;
|
| 887 |
+
line-height: 1.6;
|
| 888 |
+
max-height: 110px;
|
| 889 |
+
padding: 7px 0
|
| 890 |
+
}
|
| 891 |
+
|
| 892 |
+
#inp::placeholder {
|
| 893 |
+
color: var(--t3)
|
| 894 |
+
}
|
| 895 |
+
|
| 896 |
+
.sbtn {
|
| 897 |
+
background: linear-gradient(135deg, var(--acc3), var(--acc2));
|
| 898 |
+
border: none;
|
| 899 |
+
cursor: pointer;
|
| 900 |
+
width: 32px;
|
| 901 |
+
height: 32px;
|
| 902 |
+
border-radius: 6px;
|
| 903 |
+
display: flex;
|
| 904 |
+
align-items: center;
|
| 905 |
+
justify-content: center;
|
| 906 |
+
flex-shrink: 0;
|
| 907 |
+
transition: .13s;
|
| 908 |
+
align-self: flex-end;
|
| 909 |
+
margin-bottom: 3px;
|
| 910 |
+
box-shadow: 0 0 12px rgba(124, 107, 255, .4)
|
| 911 |
+
}
|
| 912 |
+
|
| 913 |
+
.sbtn:hover {
|
| 914 |
+
filter: brightness(1.15)
|
| 915 |
+
}
|
| 916 |
+
|
| 917 |
+
.sbtn:disabled {
|
| 918 |
+
opacity: .3;
|
| 919 |
+
cursor: not-allowed
|
| 920 |
+
}
|
| 921 |
+
|
| 922 |
+
.sbtn svg {
|
| 923 |
+
fill: #fff
|
| 924 |
+
}
|
| 925 |
+
|
| 926 |
+
.hint {
|
| 927 |
+
margin-top: 5px;
|
| 928 |
+
font-size: 10px;
|
| 929 |
+
color: var(--t3);
|
| 930 |
+
text-align: right;
|
| 931 |
+
letter-spacing: .04em
|
| 932 |
+
}
|
| 933 |
+
</style>
|
| 934 |
</head>
|
| 935 |
+
|
| 936 |
<body>
|
| 937 |
+
<div class="app">
|
| 938 |
+
|
| 939 |
+
<aside class="sb">
|
| 940 |
+
<div class="sb-logo">
|
| 941 |
+
<div class="logo-row">
|
| 942 |
+
<div class="logo-icon">
|
| 943 |
+
<svg width="18" height="18" viewBox="0 0 24 24">
|
| 944 |
+
<path
|
| 945 |
+
d="M9.5 3A6.5 6.5 0 0 1 16 9.5c0 1.61-.59 3.09-1.56 4.23l.27.27h.79l5 5-1.5 1.5-5-5v-.79l-.27-.27A6.516 6.516 0 0 1 9.5 16 6.5 6.5 0 0 1 3 9.5 6.5 6.5 0 0 1 9.5 3m0 2C7 5 5 7 5 9.5S7 14 9.5 14 14 12 14 9.5 12 5 9.5 5Z" />
|
| 946 |
+
</svg>
|
| 947 |
+
</div>
|
| 948 |
+
<div class="logo-text">
|
| 949 |
+
<h2>Nano<em>Mind</em></h2>
|
| 950 |
+
<p>152M Β· GPT-2 Β· AVX2 + OpenMP</p>
|
| 951 |
+
</div>
|
| 952 |
+
</div>
|
| 953 |
</div>
|
| 954 |
+
|
| 955 |
+
<div class="sb-tabs">
|
| 956 |
+
<button class="sb-tab on" id="tab-stats" onclick="switchTab('stats')">Stats</button>
|
| 957 |
+
<button class="sb-tab" id="tab-bench" onclick="switchTab('bench')">Bench</button>
|
| 958 |
+
<button class="sb-tab" id="tab-params" onclick="switchTab('params')">Params</button>
|
| 959 |
</div>
|
|
|
|
|
|
|
| 960 |
|
| 961 |
+
<!-- Stats Tab -->
|
| 962 |
+
<div id="stats-panel">
|
| 963 |
+
<div class="sb-body">
|
| 964 |
+
<div class="card">
|
| 965 |
+
<div class="ct"><span class="dot off" id="dot-s"></span>Live</div>
|
| 966 |
+
<div class="sr"><span class="sl">Throughput</span><span class="sv g" id="s-tps">β</span></div>
|
| 967 |
+
<div class="sr"><span class="sl">TTFT</span> <span class="sv c" id="s-ttft">β</span></div>
|
| 968 |
+
<div class="sr"><span class="sl">Tokens out</span><span class="sv" id="s-toks">β</span></div>
|
| 969 |
+
<div class="sr"><span class="sl">Latency</span> <span class="sv y" id="s-lat">β</span></div>
|
| 970 |
+
</div>
|
| 971 |
+
<div class="card">
|
| 972 |
+
<div class="ct">Throughput History</div>
|
| 973 |
+
<canvas id="spark"></canvas>
|
| 974 |
+
<div style="margin-top:6px">
|
| 975 |
+
<div class="sr"><span class="sl">Session avg</span><span class="sv g" id="s-avg">β</span></div>
|
| 976 |
+
<div class="sr"><span class="sl">Peak</span> <span class="sv g" id="s-peak">β</span></div>
|
| 977 |
+
</div>
|
| 978 |
+
</div>
|
| 979 |
+
<div class="card">
|
| 980 |
+
<div class="ct">Session</div>
|
| 981 |
+
<div class="sr"><span class="sl">Turns</span> <span class="sv" id="s-turns">0</span></div>
|
| 982 |
+
<div class="sr"><span class="sl">Total tokens</span><span class="sv" id="s-totok">0</span></div>
|
| 983 |
+
<div class="sr"><span class="sl">KV cache</span> <span class="sv c" id="s-kv">β</span></div>
|
| 984 |
+
<div class="sr"><span class="sl">Server RAM</span> <span class="sv" id="s-ram">β</span></div>
|
| 985 |
+
<div style="display:flex;gap:6px;margin-top:8px">
|
| 986 |
+
<button class="btn bs full" onclick="clearChat()">βΊ Reset</button>
|
| 987 |
+
</div>
|
| 988 |
+
</div>
|
| 989 |
+
<div class="card">
|
| 990 |
+
<div class="ct">Engine</div>
|
| 991 |
+
<div class="sr"><span class="sl">Status</span> <span class="sv g" id="s-eng">β</span></div>
|
| 992 |
+
<div class="sr"><span class="sl">Sessions</span><span class="sv" id="s-sess">β</span></div>
|
| 993 |
+
<div class="sr"><span class="sl">Uptime</span> <span class="sv" id="s-up">β</span></div>
|
| 994 |
+
</div>
|
| 995 |
+
|
| 996 |
+
<!-- ββ FILTERS CARD ββ -->
|
| 997 |
+
<div class="card">
|
| 998 |
+
<div class="ct">Filters</div>
|
| 999 |
+
<!-- Stories β redirects to inference space -->
|
| 1000 |
+
<div class="fi" id="fi-stories" onclick="goStories()">
|
| 1001 |
+
<div class="fcb"><svg width="8" height="6" viewBox="0 0 8 6" fill="none">
|
| 1002 |
+
<path d="M1 3l2 2 4-4" stroke="#fff" stroke-width="1.5" stroke-linecap="round" />
|
| 1003 |
+
</svg></div>
|
| 1004 |
+
<div class="fdot" style="background:var(--cyan)"></div>
|
| 1005 |
+
<span class="flabel">Stories β</span>
|
| 1006 |
+
</div>
|
| 1007 |
+
</div>
|
| 1008 |
+
<!-- ββ END FILTERS CARD ββ -->
|
| 1009 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1010 |
</div>
|
| 1011 |
</div>
|
| 1012 |
+
|
| 1013 |
+
<!-- Benchmark Tab -->
|
| 1014 |
+
<div id="bench-panel">
|
| 1015 |
+
<div class="bench-actions">
|
| 1016 |
+
<button class="btn bp full" id="btnbench" onclick="runBench()">βΆ Run Benchmark</button>
|
| 1017 |
+
<div style="font-size:9px;color:var(--t2);text-align:center;line-height:1.6">
|
| 1018 |
+
5 phases Β· cold/warm TTFT Β· throughput Β· concurrency
|
| 1019 |
+
</div>
|
| 1020 |
+
</div>
|
| 1021 |
+
<div class="bench-scroll" id="bench-scroll">
|
| 1022 |
+
<div class="bench-empty" id="bench-empty">
|
| 1023 |
+
Run benchmark to measure<br>real system performance
|
| 1024 |
+
</div>
|
| 1025 |
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1026 |
</div>
|
| 1027 |
|
| 1028 |
+
<!-- Params Tab -->
|
| 1029 |
+
<div id="params-panel" style="display:none">
|
| 1030 |
+
<div class="sb-body">
|
| 1031 |
+
<div class="card">
|
| 1032 |
+
<div class="ct">System Prompt</div>
|
| 1033 |
+
<textarea class="ta" id="sysprompt"
|
| 1034 |
+
rows="4">You are a helpful, thoughtful, and articulate AI assistant.</textarea>
|
| 1035 |
+
</div>
|
| 1036 |
+
<div class="card">
|
| 1037 |
+
<div class="ct">Generation</div>
|
| 1038 |
+
<div style="display:flex;flex-direction:column;gap:10px;margin-top:2px">
|
| 1039 |
+
<div class="pg">
|
| 1040 |
+
<label>Temperature <span id="v-temp">0.70</span></label>
|
| 1041 |
+
<input type="range" id="p-temp" min="0.1" max="2.0" step="0.05" value="0.7"
|
| 1042 |
+
oninput="document.getElementById('v-temp').textContent=parseFloat(this.value).toFixed(2)">
|
| 1043 |
+
</div>
|
| 1044 |
+
<div class="pg">
|
| 1045 |
+
<label>Top-K <span id="v-topk">40</span></label>
|
| 1046 |
+
<input type="range" id="p-topk" min="1" max="200" step="1" value="40"
|
| 1047 |
+
oninput="document.getElementById('v-topk').textContent=this.value">
|
| 1048 |
+
</div>
|
| 1049 |
+
<div class="pg">
|
| 1050 |
+
<label>Max tokens <span id="v-maxt">200</span></label>
|
| 1051 |
+
<input type="range" id="p-maxt" min="20" max="256" step="10" value="200"
|
| 1052 |
+
oninput="document.getElementById('v-maxt').textContent=this.value">
|
| 1053 |
+
</div>
|
| 1054 |
+
</div>
|
| 1055 |
+
</div>
|
| 1056 |
</div>
|
| 1057 |
</div>
|
| 1058 |
+
</aside>
|
|
|
|
|
|
|
|
|
|
| 1059 |
|
| 1060 |
+
<!-- CHAT -->
|
| 1061 |
+
<main class="chat">
|
| 1062 |
+
<header class="chat-hdr">
|
| 1063 |
+
<div class="badge">NanoMind Β· 152M</div>
|
| 1064 |
+
<span class="hdr-title">Chat</span>
|
| 1065 |
+
<div class="spc"></div>
|
| 1066 |
+
<div class="hpill">
|
| 1067 |
+
<span class="dot off" id="dot-h"></span>
|
| 1068 |
+
<span id="hstatus">Idle</span>
|
| 1069 |
+
</div>
|
| 1070 |
+
</header>
|
|
|
|
|
|
|
|
|
|
| 1071 |
|
| 1072 |
+
<div class="msgs" id="msgs">
|
| 1073 |
+
<div class="welcome" id="welcome">
|
| 1074 |
+
<div class="wlogo">NM</div>
|
| 1075 |
+
<h2>NanoMind Studio</h2>
|
| 1076 |
+
<p>152M parameter GPT-2 model trained on GPT-4 quality data β
|
| 1077 |
+
running on a hand-written C++ inference engine with AVX2 SIMD,
|
| 1078 |
+
OpenMP parallelism & persistent KV-cache.</p>
|
| 1079 |
+
<div class="chips">
|
| 1080 |
+
<span class="chip">152M params</span>
|
| 1081 |
+
<span class="chip">AVX2 SIMD</span>
|
| 1082 |
+
<span class="chip">OpenMP</span>
|
| 1083 |
+
<span class="chip">KV Cache</span>
|
| 1084 |
+
<span class="chip">Streaming</span>
|
| 1085 |
+
<span class="chip">GPT-4 Data</span>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1086 |
</div>
|
| 1087 |
</div>
|
| 1088 |
</div>
|
| 1089 |
+
|
| 1090 |
+
<div class="inputbar">
|
| 1091 |
+
<div class="inputwrap">
|
| 1092 |
+
<textarea id="inp" rows="1" placeholder="Send a messageβ¦" onkeydown="handleKey(event)"></textarea>
|
| 1093 |
+
<button class="sbtn" id="sbtn" onclick="send()">
|
| 1094 |
+
<svg width="14" height="14" viewBox="0 0 24 24">
|
| 1095 |
+
<path d="M2 21l21-9L2 3v7l15 2-15 2v7z" />
|
| 1096 |
+
</svg>
|
| 1097 |
+
</button>
|
| 1098 |
+
</div>
|
| 1099 |
+
<div class="hint">Enter β΅ to send Β· Shift+Enter for newline</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1100 |
</div>
|
| 1101 |
+
</main>
|
| 1102 |
</div>
|
| 1103 |
|
| 1104 |
+
<script>
|
| 1105 |
+
const API = '';
|
| 1106 |
+
let sessId = crypto.randomUUID();
|
| 1107 |
+
let busy = false, turns = 0, totalToks = 0;
|
| 1108 |
+
let tpsHist = [], peakTps = 0;
|
| 1109 |
+
|
| 1110 |
+
// ββ Filter logic βββββββββββββββββββββββββββββββββββββββββββββ
|
| 1111 |
+
function toggleFilter(el, key) {
|
| 1112 |
+
el.classList.toggle('on');
|
| 1113 |
+
}
|
| 1114 |
+
|
| 1115 |
+
function goStories() {
|
| 1116 |
+
const el = document.getElementById('fi-stories');
|
| 1117 |
+
el.classList.add('stories-on');
|
| 1118 |
+
setTimeout(() => {
|
| 1119 |
+
window.open('https://not-omega-inference.hf.space/', '_blank');
|
| 1120 |
+
setTimeout(() => el.classList.remove('stories-on'), 400);
|
| 1121 |
+
}, 160);
|
| 1122 |
+
}
|
| 1123 |
+
|
| 1124 |
+
// ββ Tab Switch βββββββββββββββββββββββββββββββββββββββββββββββ
|
| 1125 |
+
function switchTab(name) {
|
| 1126 |
+
['stats', 'bench', 'params'].forEach(t => {
|
| 1127 |
+
const panelId = t === 'stats' ? 'stats-panel' : t + '-panel';
|
| 1128 |
+
const panel = document.getElementById(panelId);
|
| 1129 |
+
const tab = document.getElementById('tab-' + t);
|
| 1130 |
+
const show = t === name;
|
| 1131 |
+
panel.style.display = show ? 'flex' : 'none';
|
| 1132 |
+
tab.classList.toggle('on', show);
|
| 1133 |
+
});
|
| 1134 |
+
}
|
| 1135 |
+
|
| 1136 |
+
// ββ Input ββββββββββββββββββββββββββββββββββββββββββββββββββββ
|
| 1137 |
+
const inp = document.getElementById('inp');
|
| 1138 |
+
inp.addEventListener('input', () => {
|
| 1139 |
+
inp.style.height = 'auto';
|
| 1140 |
+
inp.style.height = Math.min(inp.scrollHeight, 110) + 'px';
|
| 1141 |
+
});
|
| 1142 |
+
function handleKey(e) {
|
| 1143 |
+
if (e.key === 'Enter' && !e.shiftKey) { e.preventDefault(); send(); }
|
| 1144 |
+
}
|
| 1145 |
+
|
| 1146 |
+
// ββ UI Helpers βββββββββββββββββββββββββββββββββββββββββββββββ
|
| 1147 |
+
function setBusy(v) {
|
| 1148 |
+
busy = v;
|
| 1149 |
+
document.getElementById('sbtn').disabled = v;
|
| 1150 |
+
['dot-s', 'dot-h'].forEach(id => {
|
| 1151 |
+
document.getElementById(id).className = 'dot ' + (v ? 'on' : 'off');
|
| 1152 |
+
});
|
| 1153 |
+
document.getElementById('hstatus').textContent = v ? 'Generatingβ¦' : 'Idle';
|
| 1154 |
+
}
|
| 1155 |
+
function scrollBot() { const el = document.getElementById('msgs'); el.scrollTop = el.scrollHeight; }
|
| 1156 |
+
function hideWelcome() { const w = document.getElementById('welcome'); if (w) w.remove(); }
|
| 1157 |
+
function esc(s) { return s.replace(/&/g, '&').replace(/</g, '<').replace(/>/g, '>').replace(/"/g, '"').replace(/'/g, '''); }
|
| 1158 |
+
|
| 1159 |
+
// ββ Messages βββββββββββββββββββββββββββββββββββββββββββββββββ
|
| 1160 |
+
function addUserMsg(text) {
|
| 1161 |
+
hideWelcome();
|
| 1162 |
+
const g = document.createElement('div'); g.className = 'mg user';
|
| 1163 |
+
g.innerHTML = `<div class="mg-role"><div class="mlabel">You</div></div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1164 |
<div class="mg-body"><div class="bubble">${esc(text)}</div></div>`;
|
| 1165 |
+
document.getElementById('msgs').appendChild(g); scrollBot();
|
| 1166 |
+
}
|
| 1167 |
+
function createAsstSlot() {
|
| 1168 |
+
const g = document.createElement('div'); g.className = 'mg asst';
|
| 1169 |
+
const bid = 'b' + Date.now(), mid = 'm' + Date.now();
|
| 1170 |
+
g.innerHTML = `<div class="mg-role"><div class="mlabel">AI</div></div>
|
| 1171 |
<div class="mg-body">
|
| 1172 |
<div class="bubble" id="${bid}"><span class="cur"></span></div>
|
| 1173 |
<div class="bmeta" id="${mid}"></div>
|
| 1174 |
</div>`;
|
| 1175 |
+
document.getElementById('msgs').appendChild(g); scrollBot();
|
| 1176 |
+
return { bubble: document.getElementById(bid), meta: document.getElementById(mid) };
|
| 1177 |
+
}
|
| 1178 |
+
|
| 1179 |
+
// ββ Send βββββββββββββββββββββββββββββββββββββββββββββββββββββ
|
| 1180 |
+
async function send() {
|
| 1181 |
+
if (busy) return;
|
| 1182 |
+
const text = inp.value.trim(); if (!text) return;
|
| 1183 |
+
inp.value = ''; inp.style.height = 'auto';
|
| 1184 |
+
addUserMsg(text); setBusy(true);
|
| 1185 |
+
const { bubble, meta } = createAsstSlot();
|
| 1186 |
+
let content = '', t0 = Date.now(), firstTok = null, tokCount = 0;
|
| 1187 |
+
const payload = {
|
| 1188 |
+
message: text,
|
| 1189 |
+
session_id: sessId,
|
| 1190 |
+
system_prompt: document.getElementById('sysprompt').value,
|
| 1191 |
+
max_new_tokens: parseInt(document.getElementById('p-maxt').value),
|
| 1192 |
+
temperature: parseFloat(document.getElementById('p-temp').value),
|
| 1193 |
+
top_k: parseInt(document.getElementById('p-topk').value),
|
| 1194 |
+
};
|
| 1195 |
+
try {
|
| 1196 |
+
const resp = await fetch(`${API}/chat`, { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify(payload) });
|
| 1197 |
+
if (!resp.ok) throw new Error(`HTTP ${resp.status}`);
|
| 1198 |
+
const reader = resp.body.getReader(), decoder = new TextDecoder();
|
| 1199 |
+
let buf = '';
|
| 1200 |
+
while (true) {
|
| 1201 |
+
const { done, value } = await reader.read(); if (done) break;
|
| 1202 |
+
buf += decoder.decode(value, { stream: true });
|
| 1203 |
+
let nl;
|
| 1204 |
+
while ((nl = buf.indexOf('\n')) !== -1) {
|
| 1205 |
+
const line = buf.slice(0, nl).trim(); buf = buf.slice(nl + 1);
|
| 1206 |
+
if (!line.startsWith('data:')) continue;
|
| 1207 |
+
const raw = line.slice(5).trim(); if (raw === '[DONE]') break;
|
| 1208 |
+
let chunk; try { chunk = JSON.parse(raw); } catch { continue; }
|
| 1209 |
+
if (chunk.type === 'token') {
|
| 1210 |
+
if (firstTok === null) firstTok = Date.now();
|
| 1211 |
+
content += chunk.text; tokCount++; totalToks++;
|
| 1212 |
+
document.getElementById('s-totok').textContent = totalToks;
|
| 1213 |
+
document.getElementById('s-toks').textContent = tokCount + ' tok';
|
| 1214 |
+
document.getElementById('s-ttft').textContent = (firstTok - t0) + ' ms';
|
| 1215 |
+
bubble.innerHTML = esc(content) + '<span class="cur"></span>';
|
| 1216 |
+
scrollBot();
|
| 1217 |
+
} else if (chunk.type === 'done') {
|
| 1218 |
+
bubble.innerHTML = esc(content);
|
| 1219 |
+
const ttft = firstTok ? (firstTok - t0) : 0, tps = chunk.tps, ms = chunk.total_ms;
|
| 1220 |
+
meta.innerHTML = `<b>${tps}</b> tok/s Β· TTFT <b>${ttft}ms</b> Β· <b>${tokCount}</b> tokens Β· <b>${ms.toFixed(0)}ms</b>`;
|
| 1221 |
+
document.getElementById('s-tps').textContent = tps + ' tok/s';
|
| 1222 |
+
document.getElementById('s-lat').textContent = ms.toFixed(0) + ' ms';
|
| 1223 |
+
tpsHist.push(tps); if (tpsHist.length > 30) tpsHist.shift();
|
| 1224 |
+
if (tps > peakTps) peakTps = tps;
|
| 1225 |
+
const avg = (tpsHist.reduce((a, b) => a + b, 0) / tpsHist.length).toFixed(1);
|
| 1226 |
+
document.getElementById('s-avg').textContent = avg + ' tok/s';
|
| 1227 |
+
document.getElementById('s-peak').textContent = peakTps.toFixed(1) + ' tok/s';
|
| 1228 |
+
if (chunk.session_id) {
|
| 1229 |
+
fetch(`${API}/chat/history?session_id=${chunk.session_id}`)
|
| 1230 |
+
.then(r => r.json())
|
| 1231 |
+
.then(d => { document.getElementById('s-kv').textContent = (d.tokens_in_engine || 0) + ' tok'; })
|
| 1232 |
+
.catch(() => { });
|
| 1233 |
+
}
|
| 1234 |
+
turns++; document.getElementById('s-turns').textContent = turns;
|
| 1235 |
+
drawSpark();
|
| 1236 |
+
} else if (chunk.type === 'error') {
|
| 1237 |
+
bubble.innerHTML += `<br><span style="color:var(--red)">β ${esc(chunk.message)}</span>`;
|
| 1238 |
+
}
|
| 1239 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1240 |
}
|
| 1241 |
+
} catch (err) {
|
| 1242 |
+
if (tokCount === 0) bubble.innerHTML = `<span style="color:var(--red)">Connection error: ${esc(err.message)}</span>`;
|
| 1243 |
+
else meta.innerHTML += ` <span style="color:var(--warn)">[interrupted]</span>`;
|
| 1244 |
+
} finally {
|
| 1245 |
+
const c = bubble.querySelector('.cur'); if (c) c.remove();
|
| 1246 |
+
setBusy(false); scrollBot();
|
| 1247 |
}
|
| 1248 |
}
|
| 1249 |
+
|
| 1250 |
+
// ββ Sparkline ββοΏ½οΏ½βββββββββββββββββββββββββββββββββββββββββββββ
|
| 1251 |
+
function drawSpark() {
|
| 1252 |
+
const el = document.getElementById('spark'), ctx = el.getContext('2d');
|
| 1253 |
+
const dpr = window.devicePixelRatio || 1;
|
| 1254 |
+
el.width = el.clientWidth * dpr; el.height = el.clientHeight * dpr;
|
| 1255 |
+
ctx.scale(dpr, dpr);
|
| 1256 |
+
const W = el.clientWidth, H = el.clientHeight;
|
| 1257 |
+
ctx.clearRect(0, 0, W, H);
|
| 1258 |
+
const d = tpsHist; if (d.length < 2) return;
|
| 1259 |
+
const mx = Math.max(...d) * 1.15 || 1, step = W / (d.length - 1);
|
| 1260 |
+
const grad = ctx.createLinearGradient(0, 0, 0, H);
|
| 1261 |
+
grad.addColorStop(0, 'rgba(124,107,255,.3)'); grad.addColorStop(1, 'rgba(124,107,255,.02)');
|
| 1262 |
+
ctx.beginPath();
|
| 1263 |
+
d.forEach((v, i) => { const x = i * step, y = H - (v / mx) * (H - 4) - 2; i === 0 ? ctx.moveTo(x, y) : ctx.lineTo(x, y); });
|
| 1264 |
+
ctx.strokeStyle = '#9d8fff'; ctx.lineWidth = 1.5; ctx.stroke();
|
| 1265 |
+
ctx.lineTo((d.length - 1) * step, H); ctx.lineTo(0, H); ctx.closePath();
|
| 1266 |
+
ctx.fillStyle = grad; ctx.fill();
|
| 1267 |
+
}
|
| 1268 |
+
|
| 1269 |
+
// ββ Clear ββββββββββββββββββββββββββββββββββββββββββββββββββββ
|
| 1270 |
+
async function clearChat() {
|
| 1271 |
+
if (busy) return;
|
| 1272 |
+
await fetch(`${API}/chat/reset`, { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ session_id: sessId }) }).catch(() => { });
|
| 1273 |
+
sessId = crypto.randomUUID();
|
| 1274 |
+
turns = 0; totalToks = 0; tpsHist = []; peakTps = 0;
|
| 1275 |
+
document.getElementById('msgs').innerHTML = `
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1276 |
<div class="welcome" id="welcome">
|
| 1277 |
<div class="wlogo">NM</div>
|
| 1278 |
<h2>NanoMind Studio</h2>
|
|
|
|
| 1282 |
<span class="chip">OpenMP</span><span class="chip">KV Cache</span>
|
| 1283 |
</div>
|
| 1284 |
</div>`;
|
| 1285 |
+
['s-turns', 's-totok'].forEach(id => document.getElementById(id).textContent = '0');
|
| 1286 |
+
['s-tps', 's-ttft', 's-lat', 's-avg', 's-peak', 's-toks', 's-kv'].forEach(id => document.getElementById(id).textContent = 'β');
|
| 1287 |
+
drawSpark();
|
| 1288 |
+
}
|
| 1289 |
+
|
| 1290 |
+
// ββ Metrics Poll βββββββββββββββββββββββββββββββββββββββββββββ
|
| 1291 |
+
async function pollMetrics() {
|
| 1292 |
+
try {
|
| 1293 |
+
const r = await fetch(`${API}/metrics`); if (!r.ok) return;
|
| 1294 |
+
const d = await r.json();
|
| 1295 |
+
document.getElementById('s-ram').textContent = d.system_ram_used_pct.toFixed(0) + '% (' + d.process_ram_mb + 'MB)';
|
| 1296 |
+
document.getElementById('s-eng').textContent = (d.engines_ready || 0) + ' / ' + (d.n_engines || '?') + ' ready';
|
| 1297 |
+
document.getElementById('s-sess').textContent = d.active_sessions || 0;
|
| 1298 |
+
document.getElementById('s-up').textContent = fmtUptime(d.uptime_s || 0);
|
| 1299 |
+
} catch { }
|
| 1300 |
+
}
|
| 1301 |
+
function fmtUptime(s) {
|
| 1302 |
+
if (s < 60) return s + 's';
|
| 1303 |
+
if (s < 3600) return Math.floor(s / 60) + 'm ' + (s % 60 | 0) + 's';
|
| 1304 |
+
return Math.floor(s / 3600) + 'h ' + Math.floor((s % 3600) / 60) + 'm';
|
| 1305 |
+
}
|
| 1306 |
+
pollMetrics(); setInterval(pollMetrics, 4000);
|
| 1307 |
+
|
| 1308 |
+
// ββ Benchmark ββββββββββββββββββββββββββββββββββββββββββββββββ
|
| 1309 |
+
const PHASES = [
|
| 1310 |
+
{ id: 'cold_ttft', title: 'Phase 1 β Cold TTFT', desc: 'First token latency on a fresh session', prompts: ["What is the capital of Japan?"], maxNew: 60, temp: 0.1, metric: 'ttft' },
|
| 1311 |
+
{ id: 'warm_ttft', title: 'Phase 2 β Warm TTFT (KV Cache)', desc: 'TTFT on same session β measures KV-cache speedup', prompts: ["Now tell me about Tokyo's population."], maxNew: 60, temp: 0.1, reuseSession: true, metric: 'ttft' },
|
| 1312 |
+
{ id: 'throughput', title: 'Phase 3 β Throughput (tok/s)', desc: '5 prompts, 80 tokens each β avg TPS', prompts: ["Explain machine learning in simple terms.", "Write a Python function to reverse a string.", "What are 3 benefits of regular exercise?", "How does a neural network learn from data?", "Describe the water cycle briefly."], maxNew: 80, temp: 0.7, metric: 'tps' },
|
| 1313 |
+
{ id: 'long_context', title: 'Phase 4 β Long Context', desc: 'Longer prompt input β tests attention scaling', prompts: ["Please provide a detailed explanation of how transformers work in natural language processing, covering the key components including attention mechanisms, positional encoding, and the encoder-decoder architecture used in models like BERT and GPT."], maxNew: 100, temp: 0.5, metric: 'tps' },
|
| 1314 |
+
{ id: 'consistency', title: 'Phase 5 β Consistency', desc: '3 identical prompts β checks TPS variance', prompts: ["What is machine learning?", "What is machine learning?", "What is machine learning?"], maxNew: 60, temp: 0.1, metric: 'variance' },
|
| 1315 |
+
];
|
| 1316 |
+
let benchRunning = false, coldSessId = null;
|
| 1317 |
+
async function runSinglePrompt(prompt, maxNew, temp, sessionId) {
|
| 1318 |
+
const t0 = Date.now(); let firstTok = null, tokCount = 0, finalTps = 0, finalMs = 0;
|
| 1319 |
+
const resp = await fetch(`${API}/chat`, { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ message: prompt, session_id: sessionId, system_prompt: 'You are a helpful assistant.', max_new_tokens: maxNew, temperature: temp, top_k: 40 }) });
|
| 1320 |
+
if (!resp.ok) throw new Error(`HTTP ${resp.status}`);
|
| 1321 |
+
const reader = resp.body.getReader(), decoder = new TextDecoder(); let buf = '';
|
| 1322 |
+
while (true) {
|
| 1323 |
+
const { done, value } = await reader.read(); if (done) break;
|
| 1324 |
+
buf += decoder.decode(value, { stream: true }); let nl;
|
| 1325 |
+
while ((nl = buf.indexOf('\n')) !== -1) {
|
| 1326 |
+
const line = buf.slice(0, nl).trim(); buf = buf.slice(nl + 1);
|
| 1327 |
+
if (!line.startsWith('data:')) continue;
|
| 1328 |
+
const raw = line.slice(5).trim(); if (raw === '[DONE]') break;
|
| 1329 |
+
let chunk; try { chunk = JSON.parse(raw); } catch { continue; }
|
| 1330 |
+
if (chunk.type === 'token') { if (firstTok === null) firstTok = Date.now(); tokCount++; }
|
| 1331 |
+
else if (chunk.type === 'done') { finalTps = chunk.tps; finalMs = chunk.total_ms; }
|
| 1332 |
+
}
|
| 1333 |
+
}
|
| 1334 |
+
return { ttft: firstTok ? (firstTok - t0) : 0, tps: finalTps, totalMs: finalMs, tokens: tokCount };
|
| 1335 |
+
}
|
| 1336 |
+
function mkPhaseCard(phase) {
|
| 1337 |
+
const div = document.createElement('div'); div.className = 'ph-card'; div.id = 'ph-' + phase.id;
|
| 1338 |
+
div.innerHTML = `<div class="ph-title">${phase.title}</div><div class="ph-label">${phase.desc}</div><div class="ph-running" id="ph-st-${phase.id}"><span class="spin"></span> Runningβ¦</div><div class="ph-bar"><div class="ph-fill" id="ph-bar-${phase.id}"></div></div>`;
|
| 1339 |
+
return div;
|
| 1340 |
+
}
|
| 1341 |
+
function setPhaseResult(phase, results) {
|
| 1342 |
+
const st = document.getElementById('ph-st-' + phase.id), bar = document.getElementById('ph-bar-' + phase.id);
|
| 1343 |
+
bar.style.width = '100%';
|
| 1344 |
+
if (phase.metric === 'ttft') {
|
| 1345 |
+
const avg = results.reduce((s, r) => s + r.ttft, 0) / results.length, cls = avg < 1000 ? 'g' : avg < 2000 ? 'y' : 'r';
|
| 1346 |
+
st.innerHTML = `<div class="ph-stats"><div class="ph-stat"><div class="pv" style="color:var(--${cls})">${avg.toFixed(0)}ms</div><div class="pk">TTFT</div></div><div class="ph-stat"><div class="pv">${results[0].tokens}</div><div class="pk">tokens</div></div><div class="ph-stat"><div class="pv">${results[0].tps}</div><div class="pk">tok/s</div></div></div>`;
|
| 1347 |
+
return { label: 'TTFT', value: avg, unit: 'ms' };
|
| 1348 |
+
} else if (phase.metric === 'tps') {
|
| 1349 |
+
const avgTps = results.reduce((s, r) => s + r.tps, 0) / results.length, avgTtft = results.reduce((s, r) => s + r.ttft, 0) / results.length, cls = avgTps > 35 ? 'g' : avgTps > 20 ? 'y' : 'r';
|
| 1350 |
+
st.innerHTML = `<div class="ph-stats">${results.map((r, i) => `<div class="ph-stat"><div class="pv" style="color:var(--${cls})">${r.tps}</div><div class="pk">P${i + 1} tok/s</div></div>`).join('')}<div class="ph-stat"><div class="pv" style="color:var(--c)">${avgTtft.toFixed(0)}ms</div><div class="pk">avg TTFT</div></div></div>`;
|
| 1351 |
+
return { label: 'Avg TPS', value: avgTps, unit: 'tok/s' };
|
| 1352 |
+
} else {
|
| 1353 |
+
const tpsList = results.map(r => r.tps), avg = tpsList.reduce((a, b) => a + b, 0) / tpsList.length, stddev = Math.sqrt(tpsList.reduce((s, v) => s + Math.pow(v - avg, 2), 0) / tpsList.length).toFixed(1);
|
| 1354 |
+
st.innerHTML = `<div class="ph-stats">${tpsList.map((t, i) => `<div class="ph-stat"><div class="pv">${t}</div><div class="pk">run ${i + 1}</div></div>`).join('')}<div class="ph-stat"><div class="pv" style="color:var(--c)">Β±${stddev}</div><div class="pk">std dev</div></div></div>`;
|
| 1355 |
+
return { label: 'Std Dev', value: parseFloat(stddev), unit: 'Β±' };
|
| 1356 |
+
}
|
| 1357 |
+
}
|
| 1358 |
+
async function runBench() {
|
| 1359 |
+
if (benchRunning || busy) return; benchRunning = true; switchTab('bench');
|
| 1360 |
+
const btn = document.getElementById('btnbench'), scroll = document.getElementById('bench-scroll');
|
| 1361 |
+
btn.disabled = true; btn.textContent = 'Runningβ¦';
|
| 1362 |
+
const empty = document.getElementById('bench-empty'); if (empty) empty.remove();
|
| 1363 |
+
scroll.innerHTML = ''; coldSessId = crypto.randomUUID(); let summaryData = {};
|
| 1364 |
+
for (const phase of PHASES) {
|
| 1365 |
+
const card = mkPhaseCard(phase); scroll.appendChild(card); scroll.scrollTop = scroll.scrollHeight;
|
| 1366 |
+
const bar = document.getElementById('ph-bar-' + phase.id), results = [];
|
| 1367 |
+
try {
|
| 1368 |
+
for (let i = 0; i < phase.prompts.length; i++) {
|
| 1369 |
+
const sid = phase.reuseSession ? coldSessId : crypto.randomUUID();
|
| 1370 |
+
if (phase.id === 'cold_ttft') coldSessId = sid;
|
| 1371 |
+
bar.style.width = ((i / phase.prompts.length) * 80) + '%';
|
| 1372 |
+
const r = await runSinglePrompt(phase.prompts[i], phase.maxNew, phase.temp, sid);
|
| 1373 |
+
results.push(r);
|
| 1374 |
+
}
|
| 1375 |
+
summaryData[phase.id] = setPhaseResult(phase, results);
|
| 1376 |
+
} catch (e) {
|
| 1377 |
+
document.getElementById('ph-st-' + phase.id).innerHTML = `<span style="color:var(--red)">β ${e.message}</span>`;
|
| 1378 |
+
bar.style.background = 'var(--red)'; bar.style.width = '100%';
|
| 1379 |
+
}
|
| 1380 |
}
|
| 1381 |
+
const p3 = summaryData['throughput'], p1 = summaryData['cold_ttft'], p2 = summaryData['warm_ttft'];
|
| 1382 |
+
const avgTps = p3 ? p3.value.toFixed(1) : 'β', coldTtft = p1 ? p1.value.toFixed(0) : 'β', warmTtft = p2 ? p2.value.toFixed(0) : 'β', cacheGain = (p1 && p2) ? ((p1.value - p2.value) / p1.value * 100).toFixed(0) : 'β';
|
| 1383 |
+
const verdict = p3 && p3.value > 35 ? `<div class="verdict good">β Throughput target met β ${avgTps} tok/s exceeds 35 tok/s baseline</div>` : `<div class="verdict mid">β³ Throughput at ${avgTps} tok/s β within expected range</div>`;
|
| 1384 |
+
const summary = document.createElement('div');
|
| 1385 |
+
summary.innerHTML = `${verdict}<div class="b-grid"><div class="b-stat"><div class="bv">${avgTps}</div><div class="bk">Avg tok/s</div></div><div class="b-stat"><div class="bv">${coldTtft}ms</div><div class="bk">Cold TTFT</div></div><div class="b-stat"><div class="bv">${warmTtft}ms</div><div class="bk">Warm TTFT</div></div><div class="b-stat"><div class="bv">${cacheGain}%</div><div class="bk">Cache Speedup</div></div></div>`;
|
| 1386 |
+
scroll.insertBefore(summary, scroll.firstChild);
|
| 1387 |
+
btn.textContent = 'βΊ Run Again'; btn.disabled = false; benchRunning = false;
|
| 1388 |
+
}
|
| 1389 |
+
</script>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1390 |
</body>
|
| 1391 |
+
|
| 1392 |
</html>
|