Repository navigation
Expand file tree
/
Copy pathindex.html
More file actions
1225 lines (1113 loc) · 62.1 KB
/
Copy pathindex.html
File metadata and controls
1225 lines (1113 loc) · 62.1 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>Cloudera Model Hub</title>
<link rel="icon" href="https://www.cloudera.com/etc.clientlibs/www/clientlibs/clientlib-siteroot/resources/css/assets/icons/favicon/favicon.ico">
<script src="https://cdn.jsdelivr.net/npm/js-yaml@4.1.0/dist/js-yaml.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/marked@12.0.0/marked.min.js"></script>
<style>
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
:root {
--bg: #f4f6f8;
--surface: #ffffff;
--border: #dde1e6;
--text-primary: #1b2329;
--text-secondary: #5a6472;
--text-muted: #8a95a2;
--accent: #0066cc;
--header-bg: #1a2639;
--gpu-bg: #f0faf4;
--gpu-text: #1a7340;
--gpu-border: #b7e2c8;
--radius: 8px;
--shadow: 0 1px 3px rgba(0,0,0,.10), 0 1px 2px rgba(0,0,0,.06);
--shadow-lg: 0 10px 25px rgba(0,0,0,.15), 0 4px 10px rgba(0,0,0,.08);
}
body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; background: var(--bg); color: var(--text-primary); min-height: 100vh; }
/* ── Header ── */
header { background: var(--header-bg); color: #fff; padding: 0 24px; height: 56px; display: flex; align-items: center; gap: 12px; position: sticky; top: 0; z-index: 100; box-shadow: 0 2px 8px rgba(0,0,0,.3); }
.header-logo { width: 28px; height: 28px; flex-shrink: 0; }
header h1 { font-size: 17px; font-weight: 600; letter-spacing: .3px; }
header .header-sub { font-size: 13px; color: rgba(255,255,255,.55); margin-left: 4px; }
.header-spacer { flex: 1; }
.header-count { font-size: 13px; color: rgba(255,255,255,.65); }
/* ── Toolbar ── */
.toolbar { background: var(--surface); border-bottom: 1px solid var(--border); padding: 10px 5%; display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.search-wrap { position: relative; flex: 0 0 280px; }
.search-wrap svg { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--text-muted); pointer-events: none; }
#search { width: 100%; padding: 7px 10px 7px 34px; border: 1px solid var(--border); border-radius: var(--radius); font-size: 13px; color: var(--text-primary); background: var(--bg); outline: none; transition: border-color .15s; }
#search:focus { border-color: var(--accent); background: #fff; }
.filter-group { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.filter-label { font-size: 12px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: .5px; white-space: nowrap; }
.toolbar-sep { width: 1px; height: 20px; background: var(--border); flex-shrink: 0; }
.pill { padding: 4px 12px; border-radius: 20px; border: 1px solid var(--border); font-size: 12px; font-weight: 500; cursor: pointer; background: var(--surface); color: var(--text-secondary); transition: all .15s; white-space: nowrap; user-select: none; }
.pill:hover { border-color: var(--accent); color: var(--accent); }
.pill.active { background: var(--accent); color: #fff; border-color: var(--accent); }
/* ── View toggle ── */
.view-toggle { display: flex; gap: 0; margin-left: auto; border: 1px solid var(--border); border-radius: 6px; overflow: hidden; flex-shrink: 0; }
.view-btn { padding: 5px 12px; border: none; border-radius: 0; background: var(--surface); color: var(--text-muted); cursor: pointer; display: flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 500; transition: all .15s; white-space: nowrap; }
.view-btn + .view-btn { border-left: 1px solid var(--border); }
.view-btn:hover { background: var(--bg); color: var(--text-primary); }
.view-btn.active { background: var(--accent); color: #fff; }
/* ── Row-view filter bar ── */
.row-filterbar { background: var(--surface); border-bottom: 1px solid var(--border); padding: 10px 5%; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.results-bar { font-size: 13px; color: var(--text-muted); }
.results-bar strong { color: var(--text-primary); }
/* ── Grid ── */
.content { padding: 14px 5% 24px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.grid .state-center { grid-column: 1 / -1; }
/* ── Card ── */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; cursor: pointer; transition: box-shadow .15s, transform .15s, border-color .15s; display: flex; flex-direction: column; gap: 10px; box-shadow: var(--shadow); }
.card:hover { box-shadow: var(--shadow-lg); border-color: #b8c8e8; transform: translateY(-1px); }
.card-header { display: flex; align-items: flex-start; gap: 10px; }
.card-title-wrap { flex: 1; min-width: 0; }
.card-name { font-size: 14px; font-weight: 600; color: var(--text-primary); line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-category { font-size: 11px; color: var(--text-muted); margin-top: 2px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.card-sizes { font-size: 11px; font-weight: 600; color: var(--text-muted); letter-spacing: .2px; }
.card-desc { font-size: 13px; color: var(--text-secondary); line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; flex: 1; }
.card-footer { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 2px; }
/* ── Chips ── */
.gpu-chip { font-size: 11px; font-weight: 500; background: var(--gpu-bg); color: var(--gpu-text); border: 1px solid var(--gpu-border); border-radius: 4px; padding: 2px 7px; }
.precision-chip { font-size: 11px; font-weight: 500; background: #f3f0ff; color: #5b21b6; border: 1px solid #ddd6fe; border-radius: 4px; padding: 2px 7px; }
.profile-chip { font-size: 11px; font-weight: 500; background: #fff8e6; color: #92500a; border: 1px solid #fcd87e; border-radius: 4px; padding: 2px 7px; }
/* ── Recommended ── */
.rec-banner { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .8px; color: #fff; background: #FF550D; padding: 3px 14px; margin: -14px -14px 0; border-radius: 6px 6px 0 0; display: block; }
.card.recommended { border-color: #FF550D; box-shadow: 0 0 0 1px #FF550D22, var(--shadow); }
.card.recommended:hover { box-shadow: 0 0 0 1px #FF550D44, var(--shadow-lg); }
/* ── Category badges ── */
.cat-badge { display: inline-block; font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 4px; letter-spacing: .2px; border: 1px solid transparent; line-height: 1.4; }
.cat-language { background: #e8f0fe; color: #1558d6; }
.cat-code { background: #f3e8ff; color: #7c3aed; }
.cat-retrieval { background: #fff3e0; color: #c45c00; }
.cat-speech { background: #e6f4ea; color: #1a7340; }
.cat-science { background: #e0f7fa; color: #00696f; }
.cat-vision { background: #fce4ec; color: #b71c5a; }
.cat-default { background: #f1f3f4; color: #555e6a; }
/* ── Source icon ── */
.source-icon { width: 20px; height: 20px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 800; flex-shrink: 0; line-height: 1; position: relative; cursor: default; }
.source-icon-nim { background: #76b900; color: #fff; }
.source-icon-hf { background: #FFD21E; color: #1a1a1a; font-size: 13px; }
.source-icon::after { content: attr(data-tooltip); position: absolute; bottom: calc(100% + 6px); right: 0; background: #1b2329; color: #fff; font-size: 11px; font-weight: 500; white-space: nowrap; padding: 4px 8px; border-radius: 4px; pointer-events: none; opacity: 0; transition: opacity .15s; }
.source-icon:hover::after { opacity: 1; }
.source-badge-inline { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 600; padding: 2px 7px; border-radius: 4px; }
/* ── Artificial Analysis intelligence score ── */
.aa-score { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 700; padding: 2px 7px; border-radius: 4px; background: #f1f3f4; color: #555e6a; white-space: nowrap; text-decoration: none; cursor: pointer; font-family: inherit; line-height: 1.4; border: 1px solid transparent; }
.aa-score:hover { filter: brightness(.92); }
.aa-attribution { font-size: 11px; color: var(--text-muted); }
.aa-attribution a { color: var(--text-muted); text-decoration: underline; text-decoration-color: transparent; text-underline-offset: 2px; transition: color .15s, text-decoration-color .15s; }
.aa-attribution a:hover { color: var(--accent); text-decoration-color: var(--accent); }
/* ── Empty / Loading ── */
.state-center { text-align: center; padding: 60px 20px; color: var(--text-muted); }
.state-center .spinner { width: 36px; height: 36px; border: 3px solid var(--border); border-top-color: var(--accent); border-radius: 50%; animation: spin .7s linear infinite; margin: 0 auto 16px; }
@keyframes spin { to { transform: rotate(360deg); } }
.state-center h3 { font-size: 17px; font-weight: 600; color: var(--text-secondary); margin-bottom: 8px; }
.state-center p { font-size: 14px; }
/* ── Fit table (row view) ── */
.table-wrap { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); overflow-x: auto; }
.fit-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.fit-table thead th { background: var(--bg); padding: 10px 14px; text-align: left; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; color: var(--text-muted); border-bottom: 2px solid var(--border); white-space: nowrap; cursor: pointer; user-select: none; transition: color .15s; }
.fit-table thead th:hover { color: var(--accent); }
.fit-table thead th.sort-asc::after { content: ' ▲'; color: var(--accent); }
.fit-table thead th.sort-desc::after { content: ' ▼'; color: var(--accent); }
.fit-table thead th.no-sort { cursor: default; width: 44px; padding: 10px 8px; text-align: center; }
.fit-table thead th.no-sort:hover { color: var(--text-muted); }
.fit-table tbody tr { cursor: pointer; transition: background .1s; }
.fit-table tbody tr:hover td { background: #f0f4ff; }
.fit-table td { padding: 10px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; color: var(--text-secondary); }
.fit-table tbody tr:last-child td { border-bottom: none; }
.fit-table td.col-icon { padding: 10px 8px; text-align: center; width: 44px; }
.fit-table tbody tr.recommended td:first-child { border-left: 3px solid #FF550D; }
.fit-table tbody tr.recommended td { background: #fffaf8; }
.fit-table tbody tr.recommended:hover td { background: #fff0ea; }
.col-model-name { font-size: 13px; font-weight: 600; color: var(--text-primary); white-space: nowrap; }
.col-model-cat { margin-top: 3px; }
.col-size { font-size: 12px; font-weight: 600; color: var(--text-muted); white-space: nowrap; }
.col-empty { color: var(--text-muted); }
/* ── Modal ── */
.overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 200; align-items: center; justify-content: center; padding: 16px; }
.overlay.open { display: flex; }
.modal { background: var(--surface); border-radius: 10px; width: 100%; max-width: 860px; max-height: 90vh; display: flex; flex-direction: column; box-shadow: var(--shadow-lg); overflow: hidden; }
.modal-header { padding: 20px 24px 16px; border-bottom: 1px solid var(--border); display: flex; align-items: flex-start; gap: 16px; }
.modal-title-wrap { flex: 1; min-width: 0; }
.modal-title { font-size: 18px; font-weight: 700; color: var(--text-primary); line-height: 1.3; }
.modal-meta { font-size: 12px; color: var(--text-muted); margin-top: 4px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.modal-meta a { color: var(--accent); text-decoration: none; display: flex; align-items: center; gap: 3px; }
.modal-meta a:hover { text-decoration: underline; }
.modal-close { width: 32px; height: 32px; border: 1px solid var(--border); border-radius: 6px; background: none; cursor: pointer; font-size: 18px; display: flex; align-items: center; justify-content: center; color: var(--text-secondary); flex-shrink: 0; transition: all .15s; }
.modal-close:hover { background: var(--bg); color: var(--text-primary); }
.modal-body { overflow-y: auto; flex: 1; padding: 0; }
.modal-tabs { display: flex; border-bottom: 1px solid var(--border); padding: 0 24px; background: var(--surface); position: sticky; top: 0; z-index: 10; }
.tab-btn { padding: 12px 16px; font-size: 13px; font-weight: 500; color: var(--text-secondary); cursor: pointer; border: none; background: none; border-bottom: 2px solid transparent; margin-bottom: -1px; transition: all .15s; }
.tab-btn:hover { color: var(--accent); }
.tab-btn.active { color: var(--accent); border-bottom-color: var(--accent); }
.tab-panel { display: none; padding: 20px 24px; }
.tab-panel.active { display: block; }
.overview-section { margin-bottom: 20px; }
.section-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .7px; color: var(--text-muted); margin-bottom: 8px; }
.overview-desc { font-size: 14px; color: var(--text-secondary); line-height: 1.6; }
.profiles-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.profiles-table th { text-align: left; padding: 8px 12px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; color: var(--text-muted); background: var(--bg); border-bottom: 1px solid var(--border); }
.profiles-table td { padding: 9px 12px; border-bottom: 1px solid var(--border); color: var(--text-secondary); vertical-align: middle; }
.profiles-table tr:last-child td { border-bottom: none; }
.profiles-table tr:hover td { background: var(--bg); }
.profiles-table tr.match td { background: #f0faf4; }
.profiles-table tr.match td:first-child { border-left: 3px solid var(--gpu-text); padding-left: 9px; }
.profile-name { color: var(--text-primary); font-weight: 500; }
.model-card-content { font-size: 13.5px; line-height: 1.7; color: var(--text-secondary); }
.model-card-content h1, .model-card-content h2 { font-size: 16px; font-weight: 700; color: var(--text-primary); margin: 20px 0 8px; padding-bottom: 4px; border-bottom: 1px solid var(--border); }
.model-card-content h3 { font-size: 14px; font-weight: 600; color: var(--text-primary); margin: 14px 0 6px; }
.model-card-content p { margin-bottom: 10px; }
.model-card-content ul, .model-card-content ol { margin: 6px 0 10px 20px; }
.model-card-content li { margin-bottom: 3px; }
.model-card-content code { font-family: "SFMono-Regular", Consolas, monospace; font-size: 12px; background: var(--bg); border: 1px solid var(--border); border-radius: 3px; padding: 1px 5px; }
.model-card-content pre { background: #1e2732; color: #e6edf3; border-radius: 6px; padding: 14px 16px; overflow-x: auto; margin: 10px 0; }
.model-card-content pre code { background: none; border: none; padding: 0; color: inherit; font-size: 12px; }
.model-card-content table { width: 100%; border-collapse: collapse; font-size: 12px; margin: 10px 0; }
.model-card-content th, .model-card-content td { padding: 6px 10px; border: 1px solid var(--border); text-align: left; }
.model-card-content th { background: var(--bg); font-weight: 600; }
.model-card-content a { color: var(--accent); }
.model-card-content img { max-width: 100%; height: auto; border-radius: 4px; }
/* ── Hero ── */
.hero { background: linear-gradient(135deg, #1a2639 0%, #0d3259 60%, #0a4a7a 100%); color: #fff; padding: 28px 5% 24px; display: flex; flex-direction: row; align-items: center; gap: 24px; }
.hero-text { flex: 0 0 42%; }
.hero-eyebrow { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 1.2px; color: #FF550D; margin-bottom: 6px; }
.hero h2 { font-size: 22px; font-weight: 700; line-height: 1.25; margin-bottom: 8px; letter-spacing: -.2px; }
.hero p { font-size: 13.5px; line-height: 1.6; color: rgba(255,255,255,.75); max-width: 640px; }
.hero-steps { display: flex; flex-direction: row; gap: 8px; flex: 1; }
.hero-step { display: flex; align-items: flex-start; gap: 10px; padding: 10px 14px; background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.12); border-radius: var(--radius); flex: 1; }
.step-num { width: 20px; height: 20px; border-radius: 50%; background: #FF550D; color: #fff; font-size: 10px; font-weight: 700; display: flex; align-items: center; justify-content: center; flex-shrink: 0; margin-top: 1px; }
.step-body strong { display: block; font-size: 12px; font-weight: 600; color: #fff; margin-bottom: 2px; }
.step-body span { font-size: 11.5px; color: rgba(255,255,255,.6); line-height: 1.4; }
/* ── Responsive ── */
@media (max-width: 600px) {
header { padding: 0 16px; }
.toolbar { padding: 10px 16px; }
.row-filterbar { padding: 10px 16px; }
.content { padding: 14px 16px 24px; }
.modal-header { padding: 16px; }
.tab-panel { padding: 16px; }
.search-wrap { flex: 1; }
.hero { padding: 20px 16px 18px; flex-direction: column; gap: 14px; }
.hero-text { max-width: 100%; }
.hero-steps { flex-wrap: wrap; }
.hero-step { min-width: 140px; }
.hero h2 { font-size: 18px; }
}
</style>
</head>
<body>
<header>
<img class="header-logo" src="https://www.cloudera.com/etc.clientlibs/www/clientlibs/clientlib-siteroot/resources/css/assets/icons/favicon/apple-touch-icon-57x57.png" alt="Cloudera">
<h1>Model Hub</h1>
<span class="header-sub">Cloudera Catalog</span>
<div class="header-spacer"></div>
<span class="header-count" id="header-count"></span>
</header>
<div class="hero">
<div class="hero-text">
<div class="hero-eyebrow">Cloudera AI</div>
<h2>Production-ready AI models,<br>one click from deployment</h2>
<p>
Jumpstart your AI with Model Hub’s curated catalog of NVIDIA NIMs and Hugging Face
models. Benefit from the turnkey, peak performance of fully optimized NIMs, or
import any Hugging Face model for total flexibility. Once in the <strong style="color:#fff">Cloudera AI Registry</strong>,
our <a href="https://www.cloudera.com/products/machine-learning/ai-inference-service.html" target="_blank" rel="noopener" style="color:#fff;text-decoration:underline;text-underline-offset:2px;text-decoration-color:rgba(255,255,255,.4)">Inference Service</a>
takes over—deploying your models with a few clicks for immediate results.
</p>
</div>
<div class="hero-steps">
<div class="hero-step">
<div class="step-num">1</div>
<div class="step-body">
<strong>Discover & Fit</strong>
<span>Find the right model for your use case and GPU configuration</span>
</div>
</div>
<div class="hero-step">
<div class="step-num">2</div>
<div class="step-body">
<strong>Import to AI Registry</strong>
<span>Single click — no manual configuration</span>
</div>
</div>
<div class="hero-step">
<div class="step-num">3</div>
<div class="step-body">
<strong>Deploy & serve</strong>
<span>Cloudera AI Inference Service handles the rest</span>
</div>
</div>
</div>
</div>
<div class="toolbar">
<div class="search-wrap">
<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<circle cx="11" cy="11" r="8"/><path d="m21 21-4.35-4.35"/>
</svg>
<input type="text" id="search" placeholder="Search models…" autocomplete="off">
</div>
<div class="toolbar-sep"></div>
<span class="filter-label">Category</span>
<div id="category-filters" class="filter-group"></div>
<div class="toolbar-sep"></div>
<span class="filter-label">Source</span>
<div id="source-filters" class="filter-group"></div>
<!-- View toggle -->
<div class="view-toggle">
<button class="view-btn" id="btn-tile">
<svg width="13" height="13" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><rect x="3" y="3" width="7" height="7"/><rect x="14" y="3" width="7" height="7"/><rect x="3" y="14" width="7" height="7"/><rect x="14" y="14" width="7" height="7"/></svg>
Discover
</button>
<button class="view-btn" id="btn-row">
<svg width="13" height="13" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><line x1="3" y1="6" x2="21" y2="6"/><line x1="3" y1="12" x2="21" y2="12"/><line x1="3" y1="18" x2="21" y2="18"/></svg>
Fit Finder
</button>
</div>
</div>
<!-- Row-view filter bar -->
<div class="row-filterbar" id="row-filterbar" style="display:none">
<span class="filter-label">GPU</span>
<div id="gpu-selector" class="filter-group"></div>
<div class="toolbar-sep"></div>
<span class="filter-label">Count (up to)</span>
<div id="count-selector" class="filter-group"></div>
<span class="results-bar" id="row-results-bar" style="margin-left:auto"></span>
</div>
<div class="content">
<!-- Tile view -->
<div id="tile-view">
<div class="grid" id="grid">
<div class="state-center">
<div class="spinner"></div>
<p>Loading models…</p>
</div>
</div>
<div style="margin-top:12px">
<span class="results-bar" id="results-bar"></span>
</div>
</div>
<!-- Row view -->
<div id="row-view" style="display:none">
<!-- Hint: shown when no GPU/count filter applied -->
<div id="fit-hint-b" style="display:none;margin-bottom:12px;padding:10px 16px;background:#e8f0fe;border:1px solid #aac4f5;border-radius:var(--radius);align-items:center;gap:10px">
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="#1558d6" stroke-width="2" style="flex-shrink:0"><circle cx="12" cy="12" r="10"/><line x1="12" y1="8" x2="12" y2="12"/><line x1="12" y1="16" x2="12.01" y2="16"/></svg>
<span style="font-size:13px;color:#1558d6;line-height:1.5">Each row is one optimization profile. Select a <strong>GPU</strong> and <strong>Count</strong> above to show only what fits your deployment.</span>
</div>
<div class="table-wrap">
<div class="state-center" id="row-state">
<div class="spinner"></div>
<p>Loading models…</p>
</div>
<table class="fit-table" id="fit-table" style="display:none">
<thead>
<tr>
<th class="no-sort"></th>
<th data-col="model">Model</th>
<th data-col="size">Size</th>
<th data-col="profile">Profile</th>
<th data-col="precision">Precision</th>
<th data-col="count">GPUs</th>
<th data-col="intelligence">Intelligence</th>
<th data-col="download">Download Size</th>
</tr>
</thead>
<tbody id="table-body"></tbody>
</table>
</div>
</div>
</div>
<!-- Detail modal -->
<div class="overlay" id="overlay" role="dialog" aria-modal="true">
<div class="modal">
<div class="modal-header">
<div class="modal-title-wrap">
<div class="modal-title" id="modal-title"></div>
<div class="modal-meta" id="modal-meta"></div>
</div>
<button class="modal-close" id="modal-close" aria-label="Close">✕</button>
</div>
<div class="modal-tabs">
<button class="tab-btn active" data-tab="overview">Overview</button>
<button class="tab-btn" data-tab="profiles">Profiles</button>
<button class="tab-btn" data-tab="evaluations">Evaluations</button>
<button class="tab-btn" data-tab="model-card">Model Card</button>
</div>
<div class="modal-body">
<div class="tab-panel active" id="tab-overview"></div>
<div class="tab-panel" id="tab-profiles"></div>
<div class="tab-panel" id="tab-evaluations"></div>
<div class="tab-panel" id="tab-model-card"></div>
</div>
</div>
</div>
<script>
(() => {
// ── State ──────────────────────────────────────────────────────────────────
let allModels = [];
let viewMode = 'tile';
// Shared
let activeCategory = 'All';
let searchQuery = '';
// Tile-only
let activeSource = 'All';
// Row-only
let flatRows = [];
let selectedGPU = null;
let selectedCount = null;
let sortKey = 'model';
let sortDir = 'asc';
let explicitSort = false;
const RECOMMENDED = new Set([
'Nemotron 3 Super 120B',
]);
const CATEGORY_META = {
'Language': { cls: 'cat-language' },
'Code': { cls: 'cat-code' },
'Retrieval': { cls: 'cat-retrieval' },
'Speech': { cls: 'cat-speech' },
'Science': { cls: 'cat-science' },
'Vision & Multimodal': { cls: 'cat-vision' },
};
const catMeta = c => CATEGORY_META[c] || { cls: 'cat-default' };
const CATEGORY_ORDER = ['Language', 'Code', 'Retrieval', 'Speech', 'Science', 'Vision & Multimodal'];
const GPU_ORDER = ['H200', 'H100', 'A100', 'L40S', 'A10G'];
const PRECISION_ORDER = ['FP32', 'BF16', 'FP16', 'FP8', 'INT8', 'INT4', 'MXFP4', 'FP4', 'INT3', 'INT2'];
// ── URL state ──────────────────────────────────────────────────────────────
function pushState() {
const params = new URLSearchParams();
if (viewMode === 'row') params.set('view', 'row');
if (selectedGPU) params.set('gpu', selectedGPU);
if (selectedCount !== null) params.set('count', selectedCount);
history.replaceState(null, '', location.pathname + (params.size ? '?' + params : ''));
}
function readState() {
const params = new URLSearchParams(location.search);
if (params.get('view') === 'row') viewMode = 'row';
selectedGPU = params.get('gpu') || null;
selectedCount = params.has('count') ? Number(params.get('count')) : null;
}
// ── Data loading ───────────────────────────────────────────────────────────
async function fetchYaml(path) {
const r = await fetch(path);
if (!r.ok) throw new Error(`${r.status} ${path}`);
return jsyaml.load(await r.text());
}
async function loadModels() {
const mergeOrder = await fetchYaml('models-order/public/merge-order.yaml');
const results = await Promise.allSettled(
mergeOrder.merge_order.map(f => fetchYaml(`models/public/${f}`))
);
const models = [];
results.forEach((r, i) => {
if (r.status === 'rejected') { console.warn(`Failed to load ${mergeOrder.merge_order[i]}:`, r.reason); return; }
(r.value.models || []).forEach(m => processModel(m).forEach(entry => models.push(entry)));
});
return models;
}
// Returns one model object per variant so each size gets its own tile/row
// and can be matched independently to AA intelligence scores.
function processModel(m) {
const rawVariants = m.modelVariants || [];
const multiVariant = rawVariants.length > 1;
return rawVariants.map(v => {
const gpus = new Set();
const precisions = new Set();
const optProfiles = new Set();
let modelId = '';
let sourceURL = v.source?.URL || '';
let modelCardMarkdown = '';
try { modelCardMarkdown = JSON.parse(atob(v.modelCard || '')).description || ''; } catch (_) {}
const variantProfiles = [];
(v.optimizationProfiles || []).forEach(p => {
const spec = Object.fromEntries((p.spec || []).map(s => [s.key, s.value]));
if (spec.GPU) gpus.add(spec.GPU);
if (spec.PRECISION) precisions.add(spec.PRECISION.toUpperCase());
if (spec.PROFILE) optProfiles.add(spec.PROFILE.toUpperCase());
if (!modelId && p.ngcMetadata) {
const firstMeta = Object.values(p.ngcMetadata)[0];
if (firstMeta?.model) modelId = firstMeta.model;
}
variantProfiles.push({ displayName: p.displayName || '', framework: p.framework || '', modelFormat: p.modelFormat || '', spec });
});
const variant = { id: v.variantId || '', profiles: variantProfiles };
const sizeMatch = variant.id.match(/\d+(\.\d+)?[BMKT](?=\b)/i);
const sizeLabels = sizeMatch ? [sizeMatch[0].toUpperCase()] : [];
// For multi-variant YAMLs use the variantId as displayName so 120B and 20B
// get separate tiles with correct names; single-variant keeps the model-level name.
const displayName = multiVariant ? (v.variantId || m.displayName || m.name || '') : (m.displayName || m.name || '');
return {
displayName, modelId,
recommended: RECOMMENDED.has(displayName),
category: m.category || '',
modelType: m.type || 'NGC',
description: m.description || '',
sourceURL, modelCardMarkdown,
variants: [variant],
sizeLabels,
availableGPUs: [...gpus].sort(),
precisions: [...precisions].sort(),
optProfiles: [...optProfiles].sort(),
};
});
}
// ── Tile view ──────────────────────────────────────────────────────────────
function filteredModels() {
const q = searchQuery.toLowerCase();
return allModels.filter(m => {
if (activeSource !== 'All' && m.modelType !== activeSource) return false;
if (activeCategory !== 'All' && m.category !== activeCategory) return false;
if (q && !m.displayName.toLowerCase().includes(q) &&
!m.description.toLowerCase().includes(q) &&
!m.category.toLowerCase().includes(q)) return false;
return true;
}).sort((a, b) => (b.recommended ? 1 : 0) - (a.recommended ? 1 : 0));
}
function h(tag, attrs, ...children) {
const el = document.createElement(tag);
Object.entries(attrs || {}).forEach(([k, v]) => {
if (k === 'class') el.className = v;
else if (k === 'html') el.innerHTML = v;
else el.setAttribute(k, v);
});
children.forEach(c => {
if (typeof c === 'string') el.insertAdjacentText('beforeend', c);
else if (c) el.appendChild(c);
});
return el;
}
function buildSourceIcon(modelType) {
const isHF = modelType === 'HF';
const icon = h('span', {
class: `source-icon ${isHF ? 'source-icon-hf' : 'source-icon-nim'}`,
'data-tooltip': isHF ? 'Hugging Face' : 'NVIDIA NIM',
});
icon.textContent = isHF ? '🤗' : 'N';
return icon;
}
function buildCard(model) {
const { cls } = catMeta(model.category);
const card = h('div', { class: `card${model.recommended ? ' recommended' : ''}` });
card.addEventListener('click', e => {
const tab = e.target.closest('.aa-badge-btn') ? 'evaluations' : null;
if (tab) e.stopPropagation();
openModal(model, null, tab);
});
const header = h('div', { class: 'card-header' });
const tw = h('div', { class: 'card-title-wrap' });
tw.appendChild(h('div', { class: 'card-name', title: model.displayName }, model.displayName));
if (model.recommended)
card.appendChild(h('span', { class: 'rec-banner' }, '★ Recommended'));
const catBadge = h('div', { class: 'card-category' });
catBadge.appendChild(h('span', { class: `cat-badge ${cls}` }, model.category || 'NVIDIA NIM'));
const aaBadgeHtml = aaScoreBadge(model.displayName, model.modelId);
if (aaBadgeHtml) catBadge.appendChild(h('span', { html: aaBadgeHtml }));
if (model.sizeLabels.length > 1)
catBadge.appendChild(h('span', { class: 'card-sizes' }, model.sizeLabels.join(' · ')));
tw.appendChild(catBadge);
header.appendChild(tw);
header.appendChild(buildSourceIcon(model.modelType));
card.appendChild(header);
card.appendChild(h('p', { class: 'card-desc' }, model.description));
const footer = h('div', { class: 'card-footer' });
model.availableGPUs.slice(0, 5).forEach(g =>
footer.appendChild(h('span', { class: 'gpu-chip' }, g))
);
if (model.availableGPUs.length > 5)
footer.appendChild(h('span', { class: 'gpu-chip' }, `+${model.availableGPUs.length - 5}`));
model.precisions.forEach(p =>
footer.appendChild(h('span', { class: 'precision-chip' }, p))
);
model.optProfiles.forEach(p =>
footer.appendChild(h('span', { class: 'profile-chip' }, p))
);
card.appendChild(footer);
return card;
}
function renderGrid() {
const models = filteredModels();
const grid = document.getElementById('grid');
grid.innerHTML = '';
document.getElementById('results-bar').innerHTML =
`Showing <strong>${models.length}</strong> of <strong>${allModels.length}</strong> models`;
if (models.length === 0) {
grid.appendChild(h('div', { class: 'state-center' },
h('p', {}, 'No models match your filters.')));
return;
}
models.forEach(m => grid.appendChild(buildCard(m)));
}
// ── Row view ───────────────────────────────────────────────────────────────
function allGPUs() {
const gpus = new Set();
let hasAgnostic = false;
allModels.forEach(m => {
m.availableGPUs.forEach(g => gpus.add(g));
m.variants.forEach(v => v.profiles.forEach(p => { if (!p.spec['GPU']) hasAgnostic = true; }));
});
const list = [...GPU_ORDER.filter(g => gpus.has(g)), ...[...gpus].filter(g => !GPU_ORDER.includes(g)).sort()];
if (hasAgnostic) list.push('Other');
return list;
}
function availableCounts() {
const counts = new Set();
allModels.forEach(model => {
model.variants.forEach(variant => {
variant.profiles.forEach(profile => {
const pGPU = profile.spec['GPU'];
if (selectedGPU === null ||
pGPU === undefined ||
(selectedGPU === 'Other' ? !pGPU : pGPU === selectedGPU))
counts.add(profile.spec['COUNT'] !== undefined ? Number(profile.spec['COUNT']) : 1);
});
});
});
return [...counts].sort((a, b) => a - b);
}
function parseDownloadMB(str) {
const m = String(str || '').match(/^([\d.]+)\s*(TB|GB|MB)/i);
if (!m) return 0;
const n = parseFloat(m[1]);
return m[2].toUpperCase() === 'TB' ? n * 1e6 : m[2].toUpperCase() === 'GB' ? n * 1e3 : n;
}
function buildFlatRows() {
const rows = [];
allModels.forEach(model => {
model.variants.forEach(variant => {
const sizeLabel = variant.id.match(/\d+(\.\d+)?[BMKT](?=\b)/i)?.[0]?.toUpperCase() || '';
variant.profiles.forEach(profile => {
const pGPU = profile.spec['GPU'];
const pCount = profile.spec['COUNT'] !== undefined ? Number(profile.spec['COUNT']) : 1;
if (selectedGPU !== null && pGPU !== undefined) {
if (selectedGPU === 'Other' ? pGPU !== undefined : pGPU !== selectedGPU) return;
}
if (selectedCount !== null && pCount > selectedCount) return;
rows.push({ model, sizeLabel, profile,
gpuCount: pCount, gpuAgnostic: pGPU === undefined, gpuType: pGPU || null,
downloadMB: parseDownloadMB(profile.spec['DOWNLOAD SIZE'] || '') });
});
});
});
return rows;
}
function precisionRank(p) {
const idx = PRECISION_ORDER.indexOf((p || '').toUpperCase());
return idx === -1 ? 99 : idx;
}
function parseSizeMagnitude(label) {
if (!label) return -1;
const m = label.match(/^([\d.]+)([BMKT])$/i);
if (!m) return -1;
const n = parseFloat(m[1]);
switch (m[2].toUpperCase()) {
case 'T': return n * 1e12;
case 'B': return n * 1e9;
case 'M': return n * 1e6;
case 'K': return n * 1e3;
default: return n;
}
}
function sortRows(rows) {
const dir = sortDir === 'asc' ? 1 : -1;
return [...rows].sort((a, b) => {
if (!explicitSort) {
const recDiff = (b.model.recommended ? 1 : 0) - (a.model.recommended ? 1 : 0);
if (recDiff !== 0) return recDiff;
}
switch (sortKey) {
case 'model': return dir * a.model.displayName.localeCompare(b.model.displayName);
case 'size': return dir * (parseSizeMagnitude(a.sizeLabel) - parseSizeMagnitude(b.sizeLabel));
case 'profile': return dir * String(a.profile.spec['PROFILE'] || '').localeCompare(String(b.profile.spec['PROFILE'] || ''));
case 'precision': return dir * (precisionRank(a.profile.spec['PRECISION']) - precisionRank(b.profile.spec['PRECISION']));
case 'count': return dir * (a.gpuCount - b.gpuCount);
case 'intelligence': {
const sa = aaMatch(a.model.displayName, a.model.modelId)?.score ?? -1;
const sb = aaMatch(b.model.displayName, b.model.modelId)?.score ?? -1;
return dir * (sa - sb);
}
case 'download': return dir * (a.downloadMB - b.downloadMB);
default: return 0;
}
});
}
function getDisplayedRows() {
let rows = flatRows;
if (activeCategory !== 'All')
rows = rows.filter(r => r.model.category === activeCategory);
if (activeSource !== 'All')
rows = rows.filter(r => r.model.modelType === activeSource);
if (searchQuery) {
const q = searchQuery.toLowerCase();
rows = rows.filter(r => r.model.displayName.toLowerCase().includes(q) ||
r.profile.displayName.toLowerCase().includes(q));
}
return sortRows(rows);
}
function renderGPUSelector() {
const c = document.getElementById('gpu-selector');
c.innerHTML = '';
allGPUs().forEach(gpu => {
const pill = h('button', { class: `pill${gpu === selectedGPU ? ' active' : ''}` }, gpu);
pill.addEventListener('click', () => {
selectedGPU = selectedGPU === gpu ? null : gpu;
selectedCount = null;
pushState();
renderGPUSelector();
renderCountSelector();
rebuildRows();
});
c.appendChild(pill);
});
}
function renderCountSelector() {
const c = document.getElementById('count-selector');
c.innerHTML = '';
availableCounts().forEach(count => {
const pill = h('button', { class: `pill${count === selectedCount ? ' active' : ''}` }, `${count}×`);
pill.addEventListener('click', () => {
selectedCount = selectedCount === count ? null : count;
pushState();
renderCountSelector();
rebuildRows();
});
c.appendChild(pill);
});
}
function rebuildRows() {
flatRows = buildFlatRows();
explicitSort = false;
renderRowTable();
}
function renderRowTable() {
const state = document.getElementById('row-state');
const table = document.getElementById('fit-table');
const tbody = document.getElementById('table-body');
const resultsBar = document.getElementById('row-results-bar');
const rows = getDisplayedRows();
if (rows.length === 0) {
table.style.display = 'none';
state.style.display = '';
state.innerHTML = `<h3>No profiles found</h3><p>Try a different GPU, count, or filter.</p>`;
resultsBar.innerHTML = '';
return;
}
state.style.display = 'none';
table.style.display = '';
document.getElementById('fit-hint-b').style.display = (!selectedGPU && !selectedCount) ? 'flex' : 'none';
let label = `<strong>${rows.length}</strong> profile${rows.length !== 1 ? 's' : ''}`;
if (selectedGPU) label += selectedCount ? ` · up to ${selectedCount}× ${selectedGPU}` : ` · ${selectedGPU}`;
if (selectedCount && !selectedGPU) label += ` · up to ${selectedCount}×`;
resultsBar.innerHTML = label;
tbody.innerHTML = '';
rows.forEach(row => tbody.appendChild(buildTableRow(row)));
updateSortIndicators();
}
function buildTableRow(row) {
const { model, sizeLabel, profile, gpuCount, gpuAgnostic, gpuType } = row;
const { cls } = catMeta(model.category);
const isHF = model.modelType === 'HF';
const mode = profile.spec['PROFILE'] || '';
const precision = profile.spec['PRECISION'] || '';
const dlSize = profile.spec['DOWNLOAD SIZE'] || '';
const gpuSubLabel = gpuAgnostic ? 'any GPU' : escapeHtml(gpuType);
const gpuCell = `<div style="line-height:1.3">${escapeHtml(String(gpuCount))}</div><div style="font-size:10px;color:var(--text-muted)">${gpuSubLabel}</div>`;
const tr = document.createElement('tr');
if (model.recommended) tr.classList.add('recommended');
tr.innerHTML = `
<td class="col-icon">
<span class="source-icon ${isHF ? 'source-icon-hf' : 'source-icon-nim'}" data-tooltip="${isHF ? 'Hugging Face' : 'NVIDIA NIM'}">${isHF ? '🤗' : 'N'}</span>
</td>
<td>
<div class="col-model-name">${escapeHtml(model.displayName)}</div>
<div class="col-model-cat"><span class="cat-badge ${cls}">${escapeHtml(model.category || 'NIM')}</span></div>
</td>
<td class="col-size">${sizeLabel ? escapeHtml(sizeLabel) : '<span class="col-empty">—</span>'}</td>
<td>${mode ? escapeHtml(mode) : '<span class="col-empty">—</span>'}</td>
<td>${precision ? escapeHtml(precision) : '<span class="col-empty">—</span>'}</td>
<td>${gpuCell}</td>
<td>${aaScoreBadge(model.displayName, model.modelId) || '<span class="col-empty">—</span>'}</td>
<td>${dlSize ? escapeHtml(dlSize) : '<span class="col-empty">—</span>'}</td>
`;
tr.addEventListener('click', e => {
const tab = e.target.closest('.aa-badge-btn') ? 'evaluations' : null;
openModal(model, profile, tab);
});
return tr;
}
function updateSortIndicators() {
document.querySelectorAll('.fit-table thead th[data-col]').forEach(th => {
th.classList.remove('sort-asc', 'sort-desc');
if (th.dataset.col === sortKey) th.classList.add(sortDir === 'asc' ? 'sort-asc' : 'sort-desc');
});
}
// ── View management ────────────────────────────────────────────────────────
function setViewMode(mode) {
viewMode = mode;
selectedGPU = null;
selectedCount = null;
pushState();
const isRow = mode === 'row';
document.querySelectorAll('.tile-only').forEach(el => el.style.display = isRow ? 'none' : '');
document.getElementById('row-filterbar').style.display = isRow ? '' : 'none';
document.getElementById('tile-view').style.display = isRow ? 'none' : '';
document.getElementById('row-view').style.display = isRow ? '' : 'none';
document.getElementById('btn-tile').classList.toggle('active', !isRow);
document.getElementById('btn-row').classList.toggle('active', isRow);
if (isRow) {
renderGPUSelector();
renderCountSelector();
rebuildRows();
} else {
renderGrid();
}
}
// ── Filters ────────────────────────────────────────────────────────────────
function buildFilters() {
// Category (shared)
const catSet = new Set(allModels.map(m => m.category).filter(Boolean));
const cats = ['All', ...CATEGORY_ORDER.filter(c => catSet.has(c)), ...[...catSet].filter(c => !CATEGORY_ORDER.includes(c)).sort()];
const catContainer = document.getElementById('category-filters');
cats.forEach(cat => {
const pill = h('button', { class: `pill${cat === activeCategory ? ' active' : ''}` }, cat);
pill.addEventListener('click', () => {
activeCategory = cat;
catContainer.querySelectorAll('.pill').forEach(p => p.classList.toggle('active', p.textContent === cat));
if (viewMode === 'row') renderRowTable();
else renderGrid();
});
catContainer.appendChild(pill);
});
// Source (shared)
const sourceContainer = document.getElementById('source-filters');
[{ value: 'All', label: 'All' }, { value: 'NGC', label: 'NVIDIA NIM' }, { value: 'HF', label: 'Hugging Face' }]
.forEach(({ value, label }) => {
const pill = h('button', { class: `pill${value === activeSource ? ' active' : ''}` }, label);
pill.addEventListener('click', () => {
activeSource = value;
sourceContainer.querySelectorAll('.pill').forEach(p => p.classList.toggle('active', p.textContent === label));
if (viewMode === 'row') renderRowTable();
else renderGrid();
});
sourceContainer.appendChild(pill);
});
}
// ── Modal ──────────────────────────────────────────────────────────────────
function openModal(model, clickedProfile = null, openTab = null) {
document.getElementById('modal-title').textContent = model.displayName;
const meta = document.getElementById('modal-meta');
meta.innerHTML = '';
const { cls } = catMeta(model.category);
meta.appendChild(h('span', { class: `cat-badge ${cls}` }, model.category));
const isHF = model.modelType === 'HF';
const srcLabel = h('span', { class: `source-badge-inline ${isHF ? 'source-icon-hf' : 'source-icon-nim'}` });
srcLabel.textContent = isHF ? '🤗 Hugging Face' : 'NVIDIA NIM';
meta.appendChild(srcLabel);
if (model.sourceURL) {
const a = h('a', { href: model.sourceURL, target: '_blank', rel: 'noopener' });
a.innerHTML = `<svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5"><path d="M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"/><polyline points="15 3 21 3 21 9"/><line x1="10" y1="14" x2="21" y2="3"/></svg> ${isHF ? 'View on Hugging Face' : 'View on NGC'}`;
meta.appendChild(a);
}
// Overview tab
const profileSection = clickedProfile ? (() => {
const preferredOrder = ['GPU', 'COUNT', 'PRECISION', 'PROFILE', 'DOWNLOAD SIZE', 'NIM VERSION'];
const specKeys = Object.keys(clickedProfile.spec);
const orderedKeys = [...preferredOrder.filter(k => specKeys.includes(k)), ...specKeys.filter(k => !preferredOrder.includes(k))];
const rows = orderedKeys.map(k => `
<tr>
<td style="padding:6px 12px 6px 0;font-size:12px;font-weight:600;color:var(--text-muted);white-space:nowrap;vertical-align:top">${escapeHtml(k)}</td>
<td style="padding:6px 0;font-size:13px;color:var(--text-primary)">${escapeHtml(String(clickedProfile.spec[k]))}</td>
</tr>`).join('');
return `
<div class="overview-section">
<div class="section-label">Selected Profile · ${escapeHtml(clickedProfile.displayName)}</div>
<table style="border-collapse:collapse;margin-top:4px">${rows}</table>
</div>`;
})() : '';
const gpuPrecisionSections = clickedProfile ? '' : `
<div class="overview-section">
<div class="section-label">Available GPUs</div>
<div style="display:flex;flex-wrap:wrap;gap:6px;margin-top:4px">
${model.availableGPUs.map(g => `<span class="gpu-chip">${escapeHtml(g)}</span>`).join('') || '<span style="color:var(--text-muted);font-size:13px">—</span>'}
</div>
</div>
<div class="overview-section">
<div class="section-label">Precision</div>
<div style="display:flex;flex-wrap:wrap;gap:6px;margin-top:4px">
${model.precisions.map(p => `<span class="precision-chip">${escapeHtml(p)}</span>`).join('') || '<span style="color:var(--text-muted);font-size:13px">—</span>'}
</div>
</div>
${model.optProfiles.length ? `
<div class="overview-section">
<div class="section-label">Optimization Profiles</div>
<div style="display:flex;flex-wrap:wrap;gap:6px;margin-top:4px">
${model.optProfiles.map(p => `<span class="profile-chip">${escapeHtml(p)}</span>`).join('')}
</div>
</div>` : ''}`;
const aaEntry = aaMatch(model.displayName, model.modelId);
document.getElementById('tab-overview').innerHTML = `
<div class="overview-section">
<div class="section-label">Description</div>
<p class="overview-desc">${escapeHtml(model.description)}</p>
</div>
${profileSection}
${gpuPrecisionSections}
`;
// Profiles tab
const tabProfiles = document.getElementById('tab-profiles');
tabProfiles.innerHTML = '';
const allVariants = model.variants.filter(v => v.profiles.length > 0);
if (allVariants.length === 0) {
tabProfiles.innerHTML = '<p style="color:var(--text-muted);font-size:13px">No optimization profiles available.</p>';
} else {
const selectorWrap = document.createElement('div');
selectorWrap.style.cssText = 'display:flex;gap:6px;flex-wrap:wrap;margin-bottom:16px';
const tableWrap = document.createElement('div');
tableWrap.style.overflowX = 'auto';
function renderVariantTable(idx) {
selectorWrap.querySelectorAll('.variant-btn').forEach((b, i) =>
b.classList.toggle('active', i === idx));
const profiles = allVariants[idx].profiles;
const specKeys = [...new Set(profiles.flatMap(p => Object.keys(p.spec)))];
const preferredOrder = ['GPU', 'COUNT', 'PRECISION', 'PROFILE', 'DOWNLOAD SIZE', 'NIM VERSION'];
const orderedKeys = [...preferredOrder.filter(k => specKeys.includes(k)), ...specKeys.filter(k => !preferredOrder.includes(k))];
let html = `<table class="profiles-table"><thead><tr><th>Profile</th><th>Framework</th>${orderedKeys.map(k => `<th>${escapeHtml(k)}</th>`).join('')}</tr></thead><tbody>`;
profiles.forEach(p => {
const isSelected = clickedProfile && p.displayName === clickedProfile.displayName;
html += `<tr${isSelected ? ' class="match"' : ''}><td class="profile-name">${escapeHtml(p.displayName)}</td><td>${escapeHtml(p.framework)}</td>${orderedKeys.map(k => `<td>${escapeHtml(p.spec[k] !== undefined ? String(p.spec[k]) : '—')}</td>`).join('')}</tr>`;
});
tableWrap.innerHTML = html + '</tbody></table>';
}
if (allVariants.length > 1) {
allVariants.forEach((v, i) => {
const label = v.id.match(/\d+(\.\d+)?[BMKT](?=\b)/i)?.[0]?.toUpperCase() || v.id;
const btn = h('button', { class: `pill variant-btn${i === 0 ? ' active' : ''}` }, label);
btn.addEventListener('click', () => renderVariantTable(i));
selectorWrap.appendChild(btn);
});
tabProfiles.appendChild(selectorWrap);
}
tabProfiles.appendChild(tableWrap);
renderVariantTable(0);
}
// Model card tab
if (model.modelCardMarkdown) {
document.getElementById('tab-model-card').innerHTML =
`<div class="model-card-content">${marked.parse(model.modelCardMarkdown)}</div>`;
} else {
document.getElementById('tab-model-card').innerHTML =
'<p style="color:var(--text-muted);font-size:13px">No model card available.</p>';
}
// Evaluations tab
const tabEval = document.getElementById('tab-evaluations');
if (aaEntry) {
const aaUrl = aaEntry.slug
? `https://artificialanalysis.ai/models/${aaEntry.slug}`
: 'https://artificialanalysis.ai/';
const mainScore = Math.round(aaEntry.score);
const mainCls = mainScore >= 45 ? 'aa-high' : mainScore < 30 ? 'aa-low' : '';
const evals = aaEntry.evaluations || {};
const evalRows = Object.entries(evals)
.filter(([k]) => k !== 'artificial_analysis_intelligence_index')