Repository navigation
Expand file tree
/
Copy pathindex.html
More file actions
2179 lines (2037 loc) · 132 KB
/
Copy pathindex.html
File metadata and controls
2179 lines (2037 loc) · 132 KB
1
2
3
4
5
6
7
8
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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
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
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
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
430
431
432
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
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Local Bench · Companion Intelligence</title>
<meta name="description" content="Local Bench — a Companion Intelligence app for benchmarking local LLMs and comparing model intelligence.">
<link rel="icon" type="image/svg+xml" href="assets/ci-icon.svg">
<meta name="color-scheme" content="light dark">
<!-- Theme: apply the saved or system colour scheme before first paint (no flash). -->
<script>
(function () {
try {
var t = localStorage.getItem('lb-theme');
if (t !== 'light' && t !== 'dark') {
t = matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light';
}
document.documentElement.dataset.theme = t;
} catch (e) { document.documentElement.dataset.theme = 'light'; }
})();
</script>
<!-- Companion Intelligence brand font (matches Hub & Portal). Loaded with display=swap
and a full system fallback, so the dashboard still renders offline (local-first). -->
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;600;700;800&display=swap" rel="stylesheet">
<!-- Chart.js is vendored locally so the dashboard works fully offline (local-first).
If it fails to load, the UI falls back to CSS bar charts automatically. -->
<script src="assets/chart.umd.min.js"></script>
<script src="assets/jspdf.umd.min.js"></script>
<style>
:root {
/* Companion Intelligence — Hub/Portal design system, light colorway.
Body content is dark ink on light surfaces; every coloured ("muted")
surface — buttons, chips, banners — carries white text at AA contrast. */
--bg: #f3fafb; /* Hub/Portal light background */
--bg-deep: #e9f4f7;
--surface: #ffffff;
--surface-2: #f5fafc;
--ink: #12212a; /* primary text */
--ink-2: #344b56; /* soft text */
/* Measured on the four light surfaces (#fff, #f5fafc, #f3fafb, #e9f4f7).
The previous trio cleared AA on none of them: --muted 4.18, --muted-2
2.77, --muted-soft 2.56 at their worst. Darkened to the lightest
value that clears 4.5:1 on ALL four, so the hierarchy survives. */
--muted: #5c717d; /* muted text — worst case 4.55 */
--muted-2: #627078; /* worst case 4.57 */
--muted-soft: #657076; /* card <p> — worst case 4.54 */
--surface-disabled: #eef3f5; /* de-emphasised card fill */
--iq-line: rgba(16,78,92,.30);
--iq-ink: #0f6f78; /* 5.27 on --surface-disabled */
--border: rgba(16,78,92,.14);
--border-strong: rgba(16,78,92,.26);
/* Accent / brand teal — the "muted" background colour behind white text */
--accent: #0f6f78;
--accent-2: #0b8790;
--accent-strong: #095e66;
--accent-ink: #ffffff;
--brand: #0f6f78; /* links & focus */
--brand-strong: #095e66;
--success: #0c7a43; /* white text clears AA on this green */
--installed-line: #2ea9b3; /* "Installed" chip — brand light teal outline */
--installed-text: #238088; /* ~20% darker brand teal; clears AA (4.65) on white */
--danger: #b42318;
--warn: #a36400;
--radius: 14px;
--radius-sm: 10px;
--shadow: 0 2px 4px rgba(6,108,128,.08), 0 12px 30px rgba(6,108,128,.10);
--shadow-sm: 0 1px 2px rgba(6,108,128,.10);
--sans: 'Manrope', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
--mono: ui-monospace, 'SF Mono', SFMono-Regular, 'Cascadia Code', 'Roboto Mono', Menlo, Consolas, monospace;
color-scheme: light;
}
/* ---- Dark mode — Companion Hub dark colorway. Only the surface/text/accent
tokens flip; chip colours (white-on-muted) and contrast rules carry over. ---- */
[data-theme="dark"] {
color-scheme: dark;
--bg: #041620;
--bg-deep: #07202b;
--surface: #0a222e;
--surface-2: #0e2c39;
--ink: #e8f1f2;
--ink-2: #b7cbcd;
--muted: #93a9ab;
--muted-2: #7e9397; /* was #6e868a — 3.79 on the footer band */
--muted-soft: #b3c3c4; /* card <p> — ~30% lighter than dark --muted */
--surface-disabled: #08202b; /* de-emphasised card fill */
--iq-line: rgba(120,205,210,.35);
--iq-ink: #8fd3d8; /* 9.97 on --surface-disabled */
--installed-line: #5fd0d8; /* brand light teal outline (dark) */
--installed-text: #7fe0e6; /* bright teal text, legible on dark cards */
--border: rgba(120,205,210,.16);
--border-strong: rgba(120,205,210,.30);
--accent: #0f7b83;
--accent-2: #16a3ad;
--accent-strong: #0a5a61;
--brand: #5fd0d8;
--brand-strong: #8fe3e8;
--shadow: 0 2px 4px rgba(0,0,0,.45), 0 14px 34px rgba(0,0,0,.5);
--shadow-sm: 0 1px 2px rgba(0,0,0,.5);
}
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
font-family: var(--sans);
color: var(--ink);
background:
radial-gradient(1200px 600px at 12% -8%, #ffffff 0%, rgba(255,255,255,0) 55%),
radial-gradient(1000px 520px at 100% 0%, #e9f4f7 0%, rgba(233,244,247,0) 50%),
var(--bg);
min-height: 100vh;
-webkit-font-smoothing: antialiased;
line-height: 1.5;
}
[data-theme="dark"] body {
background:
radial-gradient(1200px 600px at 12% -8%, #07202b 0%, rgba(7,32,43,0) 55%),
radial-gradient(1000px 520px at 100% 0%, #0c2c39 0%, rgba(12,44,57,0) 50%),
var(--bg);
}
[data-theme="dark"] .topbar { background: rgba(8,28,38,.82); }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 24px; }
@media (max-width: 768px) { .wrap { padding: 0 14px; } }
/* ---- Top bar ---- */
.topbar {
position: sticky; top: 0; z-index: 20;
backdrop-filter: saturate(180%) blur(10px);
background: rgba(255,255,255,.82);
border-bottom: 1px solid var(--border);
}
.topbar-inner {
position: relative;
display: flex; align-items: center; justify-content: space-between;
gap: 16px; padding: 14px 20px;
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand-logo { height: 40px; width: auto; flex: 0 0 auto; display: block; }
/* Centered wordmark — all caps, 400 weight, cap-height matched to the
logo icon's outer coloured edge (~28.7px → ~41px Manrope). */
.brand-app {
position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
margin: 0; font-size: 34px; line-height: 1; font-weight: 400;
text-transform: uppercase; letter-spacing: .04em; color: var(--ink);
white-space: nowrap; pointer-events: none;
}
@media (max-width: 640px) { .brand-logo { height: 26px; } .brand-app { display: none; } }
.brand-logo-dark { display: none; }
[data-theme="dark"] .brand-logo-light { display: none; }
[data-theme="dark"] .brand-logo-dark { display: block; }
.topbar-meta { display: flex; align-items: center; gap: 10px; }
.theme-toggle {
display: inline-flex; align-items: center; justify-content: center;
width: 36px; height: 36px; flex: 0 0 auto; padding: 0;
background: var(--surface); border: 1px solid var(--border); color: var(--ink-2);
border-radius: 999px; cursor: pointer; box-shadow: var(--shadow-sm);
transition: background .12s ease, color .12s ease;
}
.theme-toggle:hover { background: var(--surface-2); color: var(--ink); }
.theme-toggle svg { width: 18px; height: 18px; display: block; }
.theme-toggle .icon-dark { display: none; }
[data-theme="dark"] .theme-toggle .icon-light { display: none; }
[data-theme="dark"] .theme-toggle .icon-dark { display: block; }
.nav-link {
display: inline-flex; align-items: center; height: 36px; padding: 0 14px;
font-size: .82rem; font-weight: 600; color: var(--ink-2); text-decoration: none;
background: var(--surface); border: 1px solid var(--border); border-radius: 999px;
box-shadow: var(--shadow-sm); transition: background .12s ease, color .12s ease, border-color .12s ease;
}
.nav-link:hover { background: var(--surface-2); color: var(--ink); }
.nav-link.active { background: var(--accent); color: #fff; border-color: var(--accent-strong); }
.pill {
display: inline-flex; align-items: center; gap: 7px;
font-size: .78rem; font-weight: 600; color: var(--ink-2);
background: var(--surface); border: 1px solid var(--border);
padding: 7px 12px; border-radius: 999px; box-shadow: var(--shadow-sm);
}
.pill .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted-2); }
.pill .dot.ok { background: var(--success); }
/* Amber "Ollama unavailable" indicator — slow, calm breathing glow. */
.pill .dot.warn {
background: #c98a00;
animation: ollama-breathe 3.4s ease-in-out infinite;
}
@keyframes ollama-breathe {
0%, 100% { box-shadow: 0 0 0 0 rgba(201,138,0,0); opacity: .7; transform: scale(1); }
50% { box-shadow: 0 0 9px 2px rgba(201,138,0,.7); opacity: 1; transform: scale(1.15); }
}
@media (prefers-reduced-motion: reduce) { .pill .dot.warn { animation: none; } }
@media (max-width: 640px) { .topbar-meta .pill.hide-sm { display: none; } }
/* ---- Hero ---- */
.hero { padding: 46px 0 8px; }
.hero h1 {
font-size: 1.68rem; font-weight: 800; letter-spacing: -.025em;
line-height: 1.08; max-width: 24ch;
}
.hero p.lede { margin-top: 14px; color: var(--muted); font-size: 1.08rem; max-width: 62ch; }
@media (max-width: 768px) { .hero { padding: 30px 0 4px; } .hero h1 { font-size: 1.19rem; } }
.summary {
display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-top: 28px;
}
@media (max-width: 900px) { .summary { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px) { .summary { grid-template-columns: 1fr; } }
.summary-card {
background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
padding: 18px 18px 16px; box-shadow: var(--shadow-sm);
}
.summary-card .k { font-size: .74rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 600; }
.summary-card .v { font-size: 1.7rem; font-weight: 800; letter-spacing: -.02em; margin-top: 8px; }
.summary-card .v small { font-size: .9rem; font-weight: 600; color: var(--muted); letter-spacing: 0; }
.summary-card .sub { font-size: .82rem; color: var(--muted); margin-top: 4px; }
/* ---- Sections / cards ---- */
main { padding: 30px 0 60px; }
.section { margin-top: 30px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 14px; margin-bottom: 14px; }
.section-head h2 { font-size: 1.18rem; font-weight: 700; letter-spacing: -.01em; }
.section-head .hint { font-size: .85rem; color: var(--muted); }
.section-head-right { display: flex; align-items: center; gap: 10px; align-self: center; }
.collapse-toggle {
display: inline-flex; align-items: center; justify-content: center;
width: 28px; height: 28px; flex: 0 0 auto; padding: 0;
background: var(--surface); border: 1px solid var(--border); color: var(--ink-2);
border-radius: 8px; cursor: pointer; box-shadow: var(--shadow-sm);
transition: background .12s ease, color .12s ease;
}
.collapse-toggle:hover { background: var(--surface-2); color: var(--ink); }
.collapse-toggle svg { width: 16px; height: 16px; display: block; transition: transform .2s ease; }
/* Chevron points up when expanded; flips to point down when collapsed. */
.section.collapsed .collapse-toggle svg { transform: rotate(180deg); }
.section.collapsed > .card { display: none; }
.card {
background: var(--surface); border: 1px solid var(--border);
border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px;
}
@media (max-width: 768px) { .card { padding: 16px; } }
.note {
border: 1px solid var(--border); background: var(--surface-2);
border-radius: var(--radius-sm); padding: 14px 16px; color: var(--ink-2); font-size: .92rem;
}
/* CLASS-NAME COLLISION, and it was visible in the product. `.brand` is the
TOPBAR LOGO's layout rule (`display:flex; gap:12px`, further up), but `brand`
is also used here as a colour variant — so `<div class="note brand">` became a
flex row, its leading <strong> became a flex item in its own column, and the
first-run banner rendered as "Welcome to Local-" / "Bench." stacked beside the
body copy. Reset the layout back to prose. The real fix is to rename one of
the two `brand` classes; this is the safe half of it. */
.note.brand { background: var(--accent); border-color: var(--accent-strong); color: #fff; display: block; gap: 0; }
.note.warn { background: var(--warn); border-color: #855200; color: #fff; }
.note.error { background: var(--danger); border-color: #8f1b12; color: #fff; }
.note.brand strong, .note.warn strong, .note.error strong { color: #fff; }
.note.brand a { color: #fff; text-decoration: underline; }
/* Inline command chip — click to copy (e.g. `ollama serve`). */
code.cmd {
font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
font-size: .9em; background: var(--surface-2); border: 1px solid var(--border);
border-radius: 6px; padding: 1px 7px; color: var(--ink);
cursor: pointer; white-space: nowrap; transition: background .12s ease;
}
code.cmd:hover { background: var(--surface); }
code.cmd.copied { color: var(--success); border-color: var(--success); }
/* Darken the chip instead of lightening it. `ollama serve` is the one
thing this banner asks the user to DO, and a white-on-white-tint chip
measured 3.47:1 against the amber — the least legible string in the
banner was the actionable one. Black at 30% takes it to 8.1:1. */
.note.warn code.cmd { background: rgba(0,0,0,.30); border-color: rgba(255,255,255,.45); color: #fff; }
.note.warn code.cmd.copied { color: #fff; border-color: #fff; }
/* ---- Target banner: direct Ollama vs. a CI-Hub pool proxy (GET /api/target) ---- */
.target-banner {
display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px;
margin-bottom: 18px; padding: 12px 16px;
border: 1px solid var(--border); border-left: 3px solid var(--brand);
background: var(--surface); border-radius: var(--radius-sm); box-shadow: var(--shadow-sm);
font-size: .9rem; color: var(--ink-2);
}
.target-banner strong { color: var(--ink); }
.target-banner code { font-family: var(--mono); font-size: .84em; color: var(--ink); word-break: break-all; }
.target-banner .tags { margin-left: auto; }
@media (max-width: 640px) { .target-banner .tags { margin-left: 0; } }
/* ---- Run options: concurrency + streaming (sent in the POST body) ---- */
.run-options { display: flex; flex-wrap: wrap; gap: 14px 32px; align-items: flex-start; margin-top: 20px; }
.run-option { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.run-option .field-label { margin-bottom: 0; }
.run-option select.input { width: auto; min-width: 190px; }
.run-option .hint-sm { font-size: .8rem; color: var(--muted); max-width: 44ch; }
.switch {
display: inline-flex; align-items: center; gap: 10px; min-height: 42px;
font-size: .92rem; color: var(--ink-2); cursor: pointer;
}
.switch input { width: 18px; height: 18px; accent-color: var(--brand); margin: 0; flex: 0 0 auto; }
/* ---- Aggregate throughput (concurrent batches, pool routing) ---- */
.agg-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(240px, 1fr); gap: 24px; }
@media (max-width: 860px) { .agg-grid { grid-template-columns: 1fr; } }
.agg-side + .agg-side { margin-top: 20px; }
.agg-side h3 { font-size: .74rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 600; margin-bottom: 10px; }
.dist-list { display: flex; flex-direction: column; gap: 9px; }
.dist-row { display: grid; grid-template-columns: minmax(80px, 150px) 1fr auto; gap: 10px; align-items: center; font-size: .88rem; }
.dist-row .nm { font-weight: 600; word-break: break-word; }
.dist-row .bar { height: 10px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 999px; overflow: hidden; }
.dist-row .bar > span { display: block; height: 100%; background: linear-gradient(90deg, var(--accent-strong), var(--accent-2)); border-radius: 999px; }
.dist-row .n { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.dist-empty { font-size: .86rem; color: var(--muted); }
/* ---- Tags / chips ---- */
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag {
display: inline-flex; align-items: center; gap: 5px;
font-size: .75rem; font-weight: 600; color: var(--ink-2);
background: var(--surface-2); border: 1px solid var(--border);
padding: 3px 9px; border-radius: 999px;
}
.tag.ok { background: transparent; border-color: var(--installed-line); color: var(--installed-text); }
.tag.muted { color: var(--muted); }
.tag.brand { background: var(--accent); border-color: var(--accent-strong); color: #fff; }
/* ---- Buttons ---- */
.btn {
display: inline-flex; align-items: center; justify-content: center; gap: 8px;
font-family: inherit; font-size: .95rem; font-weight: 600;
padding: 11px 18px; border-radius: 10px; border: 1px solid transparent;
cursor: pointer; transition: transform .12s ease, box-shadow .12s ease, background .12s ease;
}
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary { background: linear-gradient(180deg, #0f7b83, #095e66); color: var(--accent-ink); border-color: var(--accent-strong); }
.btn-primary:hover:not(:disabled) { box-shadow: 0 6px 18px rgba(9,94,102,.28); }
.btn-ghost { background: var(--surface); color: var(--ink-2); border-color: var(--border-strong); }
.btn-ghost:hover:not(:disabled) { background: var(--surface-2); }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 18px; }
@media (max-width: 560px) { .btn-row { flex-direction: column; } .btn { width: 100%; } }
/* ---- Model selector ---- */
.field-label { display: block; font-weight: 600; font-size: .9rem; margin-bottom: 10px; color: var(--ink-2); }
/* 420px is not a whole number of card rows, so the scroll port ended partway
through the third row: the bottom cards were sliced clean through their own IQ
pills, with no scrollbar visible on macOS. In a still frame — a store
screenshot, a video still — that reads as broken cards, not as "more below".
Rows are a uniform minimum height now, and when the list really does overflow
the port fades out over its last 28px so the cut is legibly a scroll edge.
`.is-scrollable` is set from renderModelList: a short list that fits gets no
fade, because nothing is being hidden. */
.model-grid {
display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
grid-auto-rows: minmax(128px, max-content); gap: 12px;
max-height: 440px; overflow-y: auto; padding: 2px;
}
.model-grid.is-scrollable {
padding-bottom: 22px;
-webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 28px), transparent 100%);
mask-image: linear-gradient(to bottom, #000 calc(100% - 28px), transparent 100%);
}
.model-opt {
position: relative; display: block; cursor: pointer;
border: 1px solid var(--border); border-radius: 12px; padding: 14px;
background: var(--surface); transition: border-color .12s ease, box-shadow .12s ease;
}
.model-opt:hover { border-color: var(--border-strong); box-shadow: var(--shadow-sm); }
/* Disabled cards are de-emphasised with explicit colours, NOT `opacity`.
Opacity fades the text toward the card fill, and every one of these
cards still carries the product's real content — model name, size,
context window, intelligence score. At the old `opacity: .6` the meta
line measured 3.27:1 and the IQ badge 2.83:1 against their own
backdrops, both below the 4.5:1 AA floor for text this size, and the
whole grid read as muddy on camera. Recolouring instead keeps the
"not pulled" signal (dimmer fill, softer border, the explicit
"Not installed" tag and the disabled checkbox) while every string
stays legible. */
.model-opt.disabled {
cursor: not-allowed;
background: var(--surface-disabled); border-color: var(--border);
}
.model-opt.disabled .name { color: var(--ink-2); }
.model-opt.disabled .meta { color: var(--muted); }
.model-opt.disabled .tag.muted { color: var(--muted); border-color: var(--border-strong); }
/* Outline rather than filled: white-on-faded-teal was the worst offender
in the grid, and an outline badge reads as inactive more plainly. */
.model-opt.disabled .iq {
background: transparent; border-color: var(--iq-line); color: var(--iq-ink);
}
.model-opt input { position: absolute; top: 14px; right: 14px; width: 16px; height: 16px; accent-color: var(--brand); }
.model-opt .name { font-weight: 700; font-size: .96rem; padding-right: 26px; word-break: break-word; }
.model-opt .meta { margin-top: 6px; color: var(--muted); font-size: .82rem; }
.model-opt .tags { margin-top: 10px; }
.iq {
display: inline-flex; align-items: baseline; gap: 4px;
font-weight: 700; color: #fff;
background: var(--accent); border: 1px solid var(--accent-strong);
border-radius: 999px; padding: 2px 9px; font-size: .76rem;
}
.iq .n { font-size: .86rem; }
.iq.na { color: var(--muted); background: var(--surface-2); border-color: var(--border); }
.catalog-summary { margin-top: 14px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
/* ---- Prompt selector ---- */
select.input, textarea.input {
width: 100%; font-family: inherit; font-size: .95rem; color: var(--ink);
background: var(--surface); border: 1px solid var(--border-strong);
border-radius: 10px; padding: 11px 12px;
}
select.input:focus, textarea.input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(15,111,120,.18); }
textarea.input { min-height: 84px; resize: vertical; }
.prompt-desc { margin-top: 8px; font-size: .86rem; color: var(--muted); }
.prompt-preview {
margin-top: 12px; padding: 12px 14px; background: var(--surface-2);
border: 1px solid var(--border); border-left: 3px solid var(--brand);
border-radius: 8px; font-size: .9rem; color: var(--ink-2);
}
.prompt-preview .lbl { font-weight: 600; font-size: .76rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-bottom: 6px; }
.prompt-editor-hint { font-weight: 400; color: var(--muted); font-size: .8rem; }
.prompt-library { margin-top: 12px; display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 10px; }
.prompt-card {
position: relative; padding: 13px; border: 1px solid var(--border); border-radius: 12px;
background: var(--surface-2); cursor: pointer;
transition: border-color .12s ease, box-shadow .12s ease, background .12s ease;
}
.prompt-card:hover { border-color: var(--border-strong); box-shadow: var(--shadow-sm); }
.prompt-card.selected { border-color: var(--accent-strong); box-shadow: 0 0 0 2px rgba(15,111,120,.20); background: var(--surface); }
/* The expand chevron is position:absolute at top:10px right:10px. `h3` already
reserved room for it; the tag row above it did not, so a two-word type tag
("Instruction Following", "Logical Reasoning") ran straight under the button
on the library grid. Same reservation, same reason. */
.prompt-card .tags { padding-right: 28px; }
.prompt-card h3 { font-size: .92rem; margin: 8px 0 6px; padding-right: 28px; }
.prompt-card p { font-size: .84rem; color: var(--muted-soft); }
.prompt-card-toggle {
position: absolute; top: 10px; right: 10px; width: 24px; height: 24px; padding: 0;
display: inline-flex; align-items: center; justify-content: center;
background: var(--surface); border: 1px solid var(--border); color: var(--ink-2);
border-radius: 7px; cursor: pointer; transition: background .12s ease, color .12s ease;
}
.prompt-card-toggle:hover { background: var(--surface-2); color: var(--ink); }
.prompt-card-toggle svg { width: 13px; height: 13px; display: block; transition: transform .2s ease; }
.prompt-card.expanded .prompt-card-toggle svg { transform: rotate(180deg); }
.prompt-card-text {
margin-top: 10px; padding: 10px; font-size: .82rem; color: var(--ink-2);
background: var(--surface); border: 1px solid var(--border); border-radius: 8px; white-space: pre-wrap;
}
/* ---- Response comparison ---- */
.compare-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 14px; }
@media (max-width: 760px) { .compare-grid { grid-template-columns: 1fr; } }
.compare-col { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.compare-meta { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 14px; font-size: .82rem; color: var(--muted); }
.compare-meta .lead { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .95rem; font-weight: 700; color: var(--ink); }
.compare-meta .unit { font-weight: 600; color: var(--muted); }
.response-box {
white-space: pre-wrap; word-break: break-word;
font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
font-size: .85rem; line-height: 1.5; color: var(--ink);
background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px;
padding: 14px; max-height: 460px; overflow-y: auto;
}
.response-empty { color: var(--danger); font-style: italic; font-family: inherit; }
/* ---- Progress ---- */
.progress { margin-top: 16px; display: none; }
.progress.active { display: block; }
.progress-track { height: 12px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 999px; overflow: hidden; }
.progress-fill { height: 100%; width: 0; background: linear-gradient(90deg, var(--brand), var(--brand-strong)); transition: width .3s ease; }
.progress-status { margin-top: 8px; font-size: .85rem; color: var(--muted); }
/* ---- Intelligence ranking ---- */
.iq-source { font-size: .82rem; color: var(--muted); }
.iq-list { display: flex; flex-direction: column; }
.iq-row {
display: grid; grid-template-columns: 26px minmax(150px, 230px) 1fr auto;
gap: 14px; align-items: center; padding: 11px 4px; border-top: 1px solid var(--border);
}
.iq-row:first-child { border-top: none; }
/* --muted-2 put the rank numbers at 4.25:1, just under the AA floor. */
.iq-rank { font-variant-numeric: tabular-nums; color: var(--muted); font-weight: 700; font-size: .85rem; text-align: right; }
.iq-model { min-width: 0; }
.iq-model .nm { font-weight: 700; font-size: .94rem; word-break: break-word; }
.iq-model .sub { font-size: .78rem; color: var(--muted); margin-top: 2px; }
.iq-bar { height: 10px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 999px; overflow: hidden; }
.iq-bar > span { display: block; height: 100%; background: linear-gradient(90deg, var(--accent-strong), var(--accent-2)); border-radius: 999px; }
.iq-score { font-weight: 800; font-variant-numeric: tabular-nums; min-width: 40px; text-align: right; }
.iq-score.na { color: var(--muted-2); font-weight: 600; }
@media (max-width: 640px) {
.iq-row { grid-template-columns: 22px 1fr auto; }
.iq-bar { display: none; }
}
.iq-foot { margin-top: 14px; font-size: .82rem; color: var(--muted); }
/* ---- Stats grid ---- */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
@media (max-width: 900px) { .stats { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px) { .stats { grid-template-columns: 1fr; } }
.stat {
border: 1px solid var(--border); border-radius: var(--radius); padding: 18px;
background: var(--surface-2);
}
.stat .k { font-size: .74rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 600; }
.stat .v { font-size: 1.7rem; font-weight: 800; letter-spacing: -.02em; margin-top: 8px; }
.stat .v small { font-size: .85rem; color: var(--muted); font-weight: 600; }
/* ---- Chart ---- */
.chart-box { position: relative; min-height: 380px; }
.chart-fallback { display: none; flex-direction: column; gap: 10px; }
.chart-fallback.active { display: flex; }
.fb-row { display: grid; grid-template-columns: minmax(120px, 200px) 1fr auto; gap: 12px; align-items: center; }
.fb-label { font-weight: 600; font-size: .9rem; word-break: break-word; }
.fb-bar { height: 22px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); overflow: hidden; }
.fb-fill { height: 100%; background: linear-gradient(90deg, var(--accent-strong), var(--accent-2)); }
.fb-val { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.chart-insights { margin-top: 14px; }
/* ---- System specs ---- */
.specs-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px 24px; }
.spec-item { font-size: .92rem; }
.spec-item .k { font-size: .74rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 600; }
.spec-item .v { font-weight: 600; color: var(--ink-2); margin-top: 2px; word-break: break-word; }
.spec-gpus { margin-top: 4px; padding-left: 18px; color: var(--ink-2); font-weight: 600; }
/* ---- Table ---- */
.table-scroll { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); }
table { width: 100%; border-collapse: collapse; font-size: .92rem; }
thead th {
text-align: left; font-size: .72rem; text-transform: uppercase; letter-spacing: .06em;
color: var(--muted); font-weight: 700; padding: 13px 16px; background: var(--surface-2);
border-bottom: 1px solid var(--border); white-space: nowrap;
}
tbody td { padding: 13px 16px; border-bottom: 1px solid var(--border); white-space: nowrap; }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: var(--surface-2); }
td.num { font-variant-numeric: tabular-nums; }
.badge { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; font-size: .82rem; }
.badge.ok { color: var(--success); }
.badge.fail { color: var(--danger); }
.badge .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
footer { border-top: 1px solid var(--border); padding: 24px 0 40px; color: var(--muted); font-size: .85rem; }
footer .row { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
footer .conf { font-size: .76rem; color: var(--muted-2); }
footer .footer-links { display: inline-flex; gap: 16px; flex-wrap: wrap; }
footer .footer-links a { color: var(--ink-2); text-decoration: none; font-weight: 600; }
footer .footer-links a:hover { color: var(--accent-2); text-decoration: underline; }
/* ---- In-app docs (sidebar + content, one tab per topic) ---- */
.docs { padding: 18px 0 60px; }
.docs-layout {
/* Was calc(100vh - 240px), which held the panel open to nearly a full
viewport no matter how short the topic was — the Overview topic left
roughly 40% of the card empty, and that is what the product video
filmed. 420px still gives the sidebar its full-height rail look; past
that the card sizes to its content. */
display: flex; min-height: 420px;
border: 1px solid var(--border); border-radius: var(--radius);
overflow: hidden; background: var(--surface); box-shadow: var(--shadow-sm);
}
.docs-sidebar {
width: 250px; flex-shrink: 0; padding: 18px 14px;
border-right: 1px solid var(--border); background: var(--surface-2); overflow-y: auto;
}
.docs-sidebar h2 { margin: 0 0 14px; font-size: .95rem; font-weight: 700; color: var(--ink); }
.docs-category { margin-bottom: 18px; }
.docs-category h3 { font-size: .7rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 0 0 8px; font-weight: 600; }
.docs-category ul { list-style: none; padding: 0; margin: 0; }
.docs-category li { margin-bottom: 2px; }
.docs-tab {
width: 100%; text-align: left; padding: 8px 10px; border: none; background: transparent;
cursor: pointer; font-family: inherit; font-size: .88rem; font-weight: 500; color: var(--ink-2);
border-radius: 7px; transition: background .12s ease, color .12s ease;
}
.docs-tab:hover { background: var(--surface); color: var(--ink); }
.docs-tab.active { background: var(--surface); color: var(--accent-2); font-weight: 700; box-shadow: inset 2px 0 0 var(--accent); }
.docs-content { flex: 1; min-width: 0; padding: 24px 28px; overflow-y: auto; }
.docs-back { display: inline-flex; align-items: center; gap: 6px; margin-bottom: 18px; font-size: .82rem; font-weight: 600; color: var(--muted); text-decoration: none; }
.docs-back:hover { color: var(--ink); }
.docs-topic { max-width: 780px; }
.docs-topic h1 { font-size: 1.55rem; font-weight: 800; letter-spacing: -.02em; line-height: 1.2; margin: 0 0 12px; padding-bottom: 10px; border-bottom: 1px solid var(--border); }
.docs-topic h2 { font-size: 1.12rem; font-weight: 700; letter-spacing: -.01em; margin: 26px 0 0; }
.docs-topic p { color: var(--ink-2); line-height: 1.7; margin-top: 12px; }
.docs-topic ul { margin: 12px 0 0; padding-left: 22px; color: var(--ink-2); line-height: 1.6; }
.docs-topic li { margin-top: 9px; }
.docs-topic li strong { color: var(--ink); }
.docs-topic a { color: var(--accent-2); text-decoration: none; font-weight: 600; }
.docs-topic a:hover { text-decoration: underline; }
.docs-links { list-style: none; padding-left: 0; }
.docs-links li { margin-top: 10px; }
@media (max-width: 760px) {
.docs-layout { flex-direction: column; min-height: 0; }
.docs-sidebar { width: 100%; border-right: none; border-bottom: 1px solid var(--border); }
}
</style>
</head>
<body>
<div class="topbar">
<div class="wrap topbar-inner">
<div class="brand">
<img class="brand-logo brand-logo-light" src="assets/2024_CI__Logo_Banner_Color_small-lightmode.svg" alt="Companion Intelligence" width="109" height="30" />
<img class="brand-logo brand-logo-dark" src="assets/2024_CI__Logo_Banner_Color_small-darkmode.svg" alt="Companion Intelligence" width="109" height="30" />
</div>
<span class="brand-app">Local Bench</span>
<div class="topbar-meta">
<a class="nav-link" id="docsNav" href="#docs">Docs</a>
<span class="pill hide-sm" id="ollamaStatus"><span class="dot" id="ollamaDot"></span><span id="ollamaLabel">Connecting…</span></span>
<button class="theme-toggle" id="themeToggle" type="button" aria-label="Toggle light or dark theme" title="Toggle theme">
<svg class="icon-light" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z"/></svg>
<svg class="icon-dark" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><circle cx="12" cy="12" r="4"/><path d="M12 2v2M12 20v2M4.93 4.93l1.41 1.41M17.66 17.66l1.41 1.41M2 12h2M20 12h2M6.34 17.66l-1.41 1.41M19.07 4.93l-1.41 1.41"/></svg>
</button>
</div>
</div>
</div>
<div class="wrap" id="heroWrap">
<section class="hero">
<h1>Local LLM benchmark<br />& intelligence catalog</h1>
<p class="lede">Measure throughput for the models you run locally via Ollama, and compare their skills at various tasks. Run Ollama with <code class="cmd" title="Click to copy">ollama serve</code> in a terminal application.</p>
<div class="summary" id="summary">
<div class="summary-card"><div class="k">Catalog models</div><div class="v" id="sumCatalog">—</div><div class="sub" id="sumCatalogSub">Curated Companion catalog</div></div>
<div class="summary-card"><div class="k">Installed locally</div><div class="v" id="sumInstalled">—</div><div class="sub" id="sumInstalledSub">Detected via Ollama</div></div>
<div class="summary-card"><div class="k">Top intelligence</div><div class="v" id="sumTopIq">—</div><div class="sub" id="sumTopIqSub">By intelligence index</div></div>
<div class="summary-card"><div class="k">Fastest measured</div><div class="v" id="sumFastest">—</div><div class="sub" id="sumFastestSub">Run a benchmark to populate</div></div>
</div>
</section>
</div>
<main class="wrap" id="dashboardMain">
<div id="errorContainer"></div>
<!-- Where requests go: a direct Ollama daemon, or a CI-Hub pool proxy that
routes each request to a node. Filled from GET /api/target. -->
<div class="target-banner" id="targetBanner" hidden></div>
<!-- Run benchmarks -->
<section class="section">
<div class="section-head">
<h2>Run a benchmark</h2>
<span class="hint">Select installed models, choose a prompt, and measure tokens/second.</span>
</div>
<div class="card">
<div id="benchmarkAlert"></div>
<label class="field-label">Models</label>
<div class="model-grid" id="modelList"><p style="color:var(--muted)">Loading available models…</p></div>
<div class="catalog-summary" id="modelCatalogSummary"></div>
<div style="margin-top:22px">
<label class="field-label" for="promptSelect">Test prompt</label>
<select class="input" id="promptSelect" onchange="handlePromptChange()">
<option value="">Loading prompts…</option>
</select>
<div class="prompt-desc" id="promptDescription"></div>
<label class="field-label" style="margin-top:14px" for="activePrompt">Current prompt <span class="prompt-editor-hint">— editable; this exact text is sent to the model</span></label>
<textarea class="input" id="activePrompt" placeholder="Select a prompt below or type your own…"></textarea>
<label class="field-label" style="margin-top:18px">Prompt library <span class="prompt-editor-hint">— click a card to use it, expand to preview the prompt</span></label>
<div class="prompt-library" id="promptLibrary"></div>
</div>
<div class="run-options">
<div class="run-option">
<label class="field-label" for="concurrencySelect">Concurrency</label>
<select class="input" id="concurrencySelect">
<option value="1" selected>1 — one request at a time</option>
<option value="2">2 concurrent requests</option>
<option value="4">4 concurrent requests</option>
<option value="8">8 concurrent requests</option>
<option value="16">16 concurrent requests</option>
</select>
<span class="hint-sm">Requests sent to each model at once. Through a pool they spread across nodes; the aggregate panel shows the combined rate.</span>
</div>
<div class="run-option">
<span class="field-label">Streaming</span>
<label class="switch" for="streamToggle"><input type="checkbox" id="streamToggle" checked> Stream tokens</label>
<span class="hint-sm">Streaming records time to first token. Turn it off to measure a single blocking response.</span>
</div>
</div>
<div class="btn-row">
<button class="btn btn-primary" id="runBenchmarkBtn" onclick="runBenchmark()">Run benchmark</button>
<button class="btn btn-ghost" onclick="selectAllModels()">Select all installed</button>
<button class="btn btn-ghost" onclick="deselectAllModels()">Clear selection</button>
</div>
<div class="progress" id="progressContainer">
<div class="progress-track"><div class="progress-fill" id="progressFill"></div></div>
<div class="progress-status" id="progressStatus">Preparing…</div>
</div>
</div>
</section>
<!-- Model intelligence -->
<section class="section" id="intelligenceSection">
<div class="section-head">
<h2>Model intelligence</h2>
<div class="section-head-right">
<span class="hint" id="iqSourceHint">Artificial Analysis Intelligence Index</span>
<button class="collapse-toggle" id="intelligenceToggle" type="button" aria-expanded="true" aria-controls="intelligenceBody" aria-label="Collapse section" onclick="toggleIntelligence()">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M18 15l-6-6-6 6"/></svg>
</button>
</div>
</div>
<div class="card" id="intelligenceBody">
<div class="iq-list" id="intelligenceList"><p style="color:var(--muted)">Loading curated catalog…</p></div>
<div class="iq-foot" id="intelligenceFoot"></div>
</div>
</section>
<!-- System specs -->
<section class="section">
<div class="section-head">
<h2>System specifications</h2>
<span class="hint">Captured with each benchmark run</span>
</div>
<div class="card"><div id="systemSpecs" class="note">Loading system specifications…</div></div>
</section>
<!-- Statistics -->
<section class="section">
<div class="section-head"><h2>Statistics</h2></div>
<div class="card"><div class="stats" id="statsGrid"></div></div>
</section>
<!-- Performance chart -->
<section class="section">
<div class="section-head">
<h2>Throughput comparison</h2>
<span class="hint">Tokens per second, higher is faster</span>
</div>
<div class="card">
<div class="chart-box">
<canvas id="benchmarkChart"></canvas>
<div class="chart-fallback" id="chartFallback"></div>
</div>
<div class="chart-insights" id="chartInsights"></div>
</div>
</section>
<!-- Aggregate throughput: one bar per model × concurrency from the batch
aggregates (POST response + GET /api/aggregates), plus where the pool
sent the requests. Hidden until a batch aggregate exists. -->
<section class="section" id="aggregateSection" hidden>
<div class="section-head">
<h2>Aggregate throughput</h2>
<span class="hint">Combined tokens per second per model × concurrency, and where each request was served</span>
</div>
<div class="card">
<div class="agg-grid">
<div class="chart-box" style="min-height:320px">
<canvas id="aggregateChart"></canvas>
<div class="chart-fallback" id="aggregateFallback"></div>
</div>
<div>
<div class="agg-side"><h3>Served by</h3><div class="dist-list" id="servedByList"></div></div>
<div class="agg-side"><h3>Backends</h3><div class="tags" id="backendList"></div></div>
</div>
</div>
<div class="chart-insights" id="aggregateInsights"></div>
</div>
</section>
<!-- Detailed results -->
<section class="section">
<div class="section-head">
<h2>Detailed results</h2>
<div style="display:flex; gap:8px; align-items:center">
<button class="btn btn-primary" id="exportPdfBtn" onclick="exportResultsPdf()" hidden>Export PDF</button>
<button class="btn btn-ghost" onclick="loadResults()">Refresh</button>
</div>
</div>
<div class="card" style="padding:0; overflow:hidden">
<div class="table-scroll">
<table>
<thead>
<tr>
<th>Model</th>
<th>Intelligence</th>
<th>Tokens/s</th>
<!-- data-col columns come from pool / streaming runs and stay
hidden while every row lacks them (see displayResults). -->
<th data-col="decodeTokensPerSecond" hidden>Decode tok/s</th>
<th data-col="ttftMs" hidden>TTFT</th>
<th data-col="loadMs" hidden>Load</th>
<th>Total tokens</th>
<th>Duration</th>
<th data-col="servedBy" hidden>Served by</th>
<th data-col="backend" hidden>Backend</th>
<th>Timestamp</th>
<th>Status</th>
</tr>
</thead>
<tbody id="resultsBody"></tbody>
</table>
</div>
</div>
</section>
<!-- Response comparison (two models at a time from the last run) -->
<section class="section" id="responseSection" hidden>
<div class="section-head">
<h2>Response comparison</h2>
<span class="hint">Two models side by side from your last run</span>
</div>
<div class="card">
<div class="prompt-preview" style="margin-top:0">
<div class="lbl">Prompt</div>
<div id="responsePrompt"></div>
</div>
<div class="compare-grid">
<!-- The measurement belongs next to the text it explains. Local Bench
is a throughput tool, and this screen — the one that actually gets
looked at — used to show two paragraphs and no numbers at all, so
"which of these is faster" was unanswerable on the comparison
page. Rendered only when the run recorded timing; a run without it
shows nothing rather than a zero. -->
<div class="compare-col">
<select class="input" id="compareLeft" onchange="renderCompareSides()" aria-label="Model on the left"></select>
<div class="compare-meta" id="responseLeftMeta" hidden></div>
<div class="response-box" id="responseLeft"></div>
</div>
<div class="compare-col">
<select class="input" id="compareRight" onchange="renderCompareSides()" aria-label="Model on the right"></select>
<div class="compare-meta" id="responseRightMeta" hidden></div>
<div class="response-box" id="responseRight"></div>
</div>
</div>
</div>
</section>
</main>
<!-- In-app documentation (CI-Import-Tools style: sidebar + content, one tab per topic) -->
<main class="wrap docs" id="docsView" hidden>
<div class="docs-layout">
<aside class="docs-sidebar">
<h2>Documentation</h2>
<div class="docs-category">
<h3>Local Bench</h3>
<ul>
<li><button class="docs-tab active" data-topic="overview" onclick="selectDocTopic('overview')">Overview</button></li>
<li><button class="docs-tab" data-topic="what-it-shows" onclick="selectDocTopic('what-it-shows')">What it shows, and why</button></li>
<li><button class="docs-tab" data-topic="prompts" onclick="selectDocTopic('prompts')">Types of prompts</button></li>
<li><button class="docs-tab" data-topic="multi-agent" onclick="selectDocTopic('multi-agent')">Building multi-agent systems</button></li>
<li><button class="docs-tab" data-topic="learn-more" onclick="selectDocTopic('learn-more')">Learn more</button></li>
</ul>
</div>
</aside>
<div class="docs-content">
<a class="docs-back" href="#" onclick="location.hash=''; return false;">← Back to dashboard</a>
<section class="docs-topic" id="topic-overview">
<h1>Local Bench</h1>
<p>Local Bench is a companion app that benchmarks local language models on your own hardware. It runs a set of prompts through models served by Ollama, measures how each one performs, and saves the results so you can compare them over time.</p>
<p>Everything runs locally. Your prompts and the model responses stay on your machine. Use the tabs on the left to learn what Local Bench shows, the kinds of prompts it runs, and how it helps you plan multi-agent systems.</p>
</section>
<section class="docs-topic" id="topic-what-it-shows" hidden>
<h1>What it shows, and why</h1>
<p>Local Bench shows how a model actually behaves on your machine:</p>
<ul>
<li><strong>Throughput and timing</strong> for each model (how quickly it produces tokens).</li>
<li><strong>Your system specs</strong> recorded next to every run, so a number always has context.</li>
<li><strong>A history of runs</strong>, stored to disk, so you can compare before and after a change such as a new GPU, a different quantization, or a newer model.</li>
</ul>
<p><strong>Why it matters:</strong> a model that is fast on someone else's hardware may be too slow on yours. Before you build anything on top of a local model, Local Bench tells you what to expect, in real numbers, on the hardware you own.</p>
</section>
<section class="docs-topic" id="topic-prompts" hidden>
<h1>Types of prompts</h1>
<p>Local Bench runs a set of benchmark prompts rather than a single one, because different workloads stress a model in different ways. These categories map to how you will actually use a model:</p>
<ul>
<li><strong>Short prompts with short answers.</strong> Closest to quick, high-frequency calls. Latency matters most here.</li>
<li><strong>Long-context prompts.</strong> Large inputs such as documents, transcripts, or chat history test how a model handles a full context window.</li>
<li><strong>Reasoning or multi-step prompts.</strong> Longer generations where steady throughput and stability matter.</li>
</ul>
<p>Pick the prompt types that match your real use case and weigh the results accordingly.</p>
</section>
<section class="docs-topic" id="topic-multi-agent" hidden>
<h1>Building multi-agent systems</h1>
<p>A multi-agent system runs several models, or several copies of a model, working together: one plans, others carry out steps, another reviews. On local hardware they all share the same GPU and memory, so performance is a budget you spend.</p>
<p>Local Bench helps you plan that budget:</p>
<ul>
<li><strong>Match models to roles.</strong> Put a small, fast model on high-frequency agents (routing, simple tool calls) and reserve a larger, slower model for the few steps that need deeper reasoning.</li>
<li><strong>Know your ceiling.</strong> Throughput figures tell you roughly how many agents can run at once before the system slows down.</li>
<li><strong>Re-test after changes.</strong> When you swap a model or change hardware, run the benchmark again so your agent design still fits the numbers.</li>
<li><strong>Start small.</strong> Benchmark the one or two models you plan to use, confirm they are fast enough for the busiest agent in your system, then add more agents from there.</li>
</ul>
</section>
<section class="docs-topic" id="topic-learn-more" hidden>
<h1>Learn more</h1>
<ul class="docs-links">
<li><a href="https://docs.ci.computer/" target="_blank" rel="noopener">Local Bench on the Companion Intelligence docs</a></li>
<li><a href="https://github.com/companionintelligence/Local-Bench" target="_blank" rel="noopener">Local Bench on GitHub</a></li>
</ul>
</section>
</div>
</div>
</main>
<footer>
<div class="wrap row">
<span>Local Bench, a Companion Intelligence app for benchmarking local LLMs.</span>
<span class="footer-links">
<a href="https://ci.computer/" target="_blank" rel="noopener">Ecosystem</a>
<a href="https://discord.com/invite/yQp9hwpzAa" target="_blank" rel="noopener">Discord</a>
</span>
<span class="conf">Free for noncommercial use under the PolyForm Noncommercial License 1.0.0.</span>
</div>
</footer>
<script>
let chart = null;
let availablePrompts = [];
let availableModels = [];
let modelIndexByName = {};
let lastResults = [];
let lastRun = [];
let latestSpecs = null;
let intelligenceAutoCollapsed = false;
let ollamaReachable = null;
let intelligenceMeta = { source: 'Artificial Analysis Intelligence Index', url: 'https://artificialanalysis.ai/', asOf: '' };
// Pool / concurrency additions. targetInfo is GET /api/target; lastAggregates
// is the last POST response's aggregates, storedAggregates is GET /api/aggregates.
let targetInfo = null;
let lastAggregates = [];
let storedAggregates = [];
let aggChart = null;
// Columns that only exist for pool-routed or streamed runs. Each is shown in
// the results table (and the PDF) only when at least one row carries a value.
const POOL_COLUMNS = ['decodeTokensPerSecond', 'ttftMs', 'loadMs', 'servedBy', 'backend'];
function escapeHtml(value) {
return String(value ?? '')
.replace(/&/g, '&').replace(/</g, '<').replace(/>/g, '>')
.replace(/"/g, '"').replace(/'/g, ''');
}
// First present value among several spellings (the API is camelCase, but a
// raw DB row may come back snake_case; null/'' count as absent).
function pick(obj, ...keys) {
for (const k of keys) {
const v = obj?.[k];
if (v !== undefined && v !== null && v !== '') return v;
}
return undefined;
}
function numOrUndef(v) {
if (v === undefined || v === null || v === '') return undefined;
const n = Number(v);
return Number.isFinite(n) ? n : undefined;
}
function fmtMs(v) { return Number.isFinite(v) ? Math.round(v).toLocaleString() + ' ms' : '—'; }
function fmtTps(v) { return Number.isFinite(v) ? v.toFixed(2) : '—'; }
function hasValue(v) { return v !== undefined && v !== null && v !== '' && !(typeof v === 'number' && !Number.isFinite(v)); }
function normalizeResult(result) {
const normalizedStatus = typeof result.status === 'string' ? result.status.toLowerCase() : '';
const success = typeof result.success === 'boolean' ? result.success : normalizedStatus === 'success';
const duration = Number(result.duration ?? result.durationSeconds ?? result.duration_seconds ?? 0);
return {
model: result.model,
tokensPerSecond: Number(result.tokensPerSecond || 0),
totalTokens: Number(result.totalTokens || 0),
duration,
durationSeconds: duration,
timestamp: result.timestamp,
status: success ? 'Success' : 'Failed',
success,
error: result.error,
prompt: result.prompt,
response: result.response,
// Pool / streaming fields — optional on every row.
transport: pick(result, 'transport'),
path: pick(result, 'path'),
targetUrl: pick(result, 'targetUrl', 'target_url'),
servedBy: pick(result, 'servedBy', 'served_by'),
backend: pick(result, 'backend'),
requestId: pick(result, 'requestId', 'request_id'),
ttftMs: numOrUndef(pick(result, 'ttftMs', 'ttft_ms')),
promptTokens: numOrUndef(pick(result, 'promptTokens', 'prompt_tokens')),
loadMs: numOrUndef(pick(result, 'loadMs', 'load_ms')),
promptEvalMs: numOrUndef(pick(result, 'promptEvalMs', 'prompt_eval_ms')),
evalMs: numOrUndef(pick(result, 'evalMs', 'eval_ms')),
decodeTokensPerSecond: numOrUndef(pick(result, 'decodeTokensPerSecond', 'decode_tokens_per_second')),
concurrency: numOrUndef(pick(result, 'concurrency')),
batchId: pick(result, 'batchId', 'batch_id')
};
}