File size: 43,403 Bytes
9462420
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Forge - AI Hub</title>
    <script src="https://cdn.tailwindcss.com"></script>
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
    <style>
        :root {
            --bg-primary: #0A0A0A;
            --bg-secondary: #101010;
            --bg-tertiary: #151515;
            --text-primary: #E0E0E0;
            --text-secondary: #A0A0A0;
            --text-accent: #C62828;
            --border-color: #1E1E1E;
            --success: #388E3C;
            --warning: #FFA000;
        }

        body {
            background-color: var(--bg-primary);
            color: var(--text-primary);
            font-family: 'Roboto', 'Helvetica Neue', Arial, sans-serif;
            height: 100vh;
            overflow: hidden;
            line-height: 1.5;
        }

        .loading-container {
            background-color: var(--bg-primary);
            display: flex;
            justify-content: center;
            align-items: center;
            height: 100vh;
            width: 100vw;
            position: fixed;
            top: 0;
            left: 0;
            z-index: 9999;
            transition: opacity 0.3s ease;
        }

        .loading-logo {
            width: 100px;
            opacity: 0.9;
            filter: drop-shadow(0 0 8px rgba(198, 40, 40, 0.3));
        }

        .loading-text {
            margin-top: 20px;
            letter-spacing: 0.1em;
            font-weight: 300;
            font-size: 0.9rem;
            color: var(--text-secondary);
        }

        .tab-button {
            transition: all 0.3s ease;
            border-bottom: 2px solid transparent;
        }

        .tab-button.active {
            border-bottom: 2px solid var(--primary-accent);
            color: var(--primary-accent);
        }

        .card {
            background-color: var(--bg-tertiary);
            border: 1px solid var(--border-color);
            transition: all 0.2s ease-out;
        }

        .card:hover {
            border-color: var(--text-accent);
            box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
        }

        .status-connected {
            background-color: var(--success);
        }

        .status-disconnected {
            background-color: var(--quaternary-accent);
        }

        .message-user {
            background-color: var(--bg-secondary);
            border-left: 3px solid var(--border-color);
        }

        .message-ai {
            background-color: var(--bg-tertiary);
            border-left: 3px solid var(--text-accent);
        }

        .modal {
            background-color: rgba(0, 0, 0, 0.9);
            backdrop-filter: blur(5px);
        }

        .tag {
            font-size: 0.75rem;
            padding: 0.2rem 0.5rem;
            border-radius: 4px;
            display: inline-block;
            margin-right: 0.3rem;
            margin-bottom: 0.3rem;
        }

        .tag-purpose {
            background-color: rgba(185, 28, 28, 0.3);
            color: #F9A825;
        }

        .tag-finetuned {
            background-color: rgba(249, 168, 37, 0.2);
            color: #FB8C00;
        }

        .tag-original {
            background-color: rgba(241, 81, 30, 0.2);
            color: #F4511E;
        }

        .tag-parameters {
            background-color: rgba(229, 57, 53, 0.2);
            color: #E53935;
        }

        .tag-distilled {
            background-color: rgba(118, 224, 80, 0.2);
            color: #76E050;
        }

        .code-block {
            background-color: #1E1E1E;
            font-family: 'Courier New', Courier, monospace;
            border-radius: 4px;
            padding: 1rem;
            overflow-x: auto;
        }

        .code-keyword { color: #569CD6; }
        .code-function { color: #DCDCAA; }
        .code-string { color: #CE9178; }
        .code-number { color: #B5CEA8; }
        .code-comment { color: #6A9955; }
        .code-operator { color: #D4D4D4; }

        .typing-indicator {
            display: flex;
            align-items: center;
        }

        .typing-dot {
            width: 8px;
            height: 8px;
            background-color: var(--primary-accent);
            border-radius: 50%;
            margin: 0 2px;
            animation: typingAnimation 1.4s infinite ease-in-out;
        }

        .typing-dot:nth-child(1) { animation-delay: 0s; }
        .typing-dot:nth-child(2) { animation-delay: 0.2s; }
        .typing-dot:nth-child(3) { animation-delay: 0.4s; }

        @keyframes typingAnimation {
            0%, 60%, 100% { transform: translateY(0); }
            30% { transform: translateY(-5px); }
        }

        .parameter-slider::-webkit-slider-thumb {
            background: var(--primary-accent);
        }

        .parameter-slider::-moz-range-thumb {
            background: var(--primary-accent);
        }

        ::-webkit-scrollbar {
            width: 6px;
        }

        ::-webkit-scrollbar-track {
            background: rgba(255, 255, 255, 0.05);
        }

        ::-webkit-scrollbar-thumb {
            background: var(--primary-accent);
            border-radius: 3px;
        }

        ::-webkit-scrollbar-thumb:hover {
            background: var(--secondary-accent);
        }
    </style>
</head>
<body class="h-full flex flex-col">
    <!-- Loading Screen -->
    <div id="loadingScreen" class="loading-container">
        <div class="text-center">
            <img src="logo_black_icon.png" alt="Prometheus Logo" class="loading-logo mb-4 mx-auto">
            <h1 class="text-4xl font-bold text-[#D32F2F] mb-2">PROMETHEUS</h1>
            <p class="text-[#F7FAFC]">Initializing Forge...</p>
        </div>
    </div>

    <!-- Main Application (hidden until loaded) -->
    <div id="appContainer" class="h-full flex flex-col hidden">
        <!-- Header -->
        <header class="bg-black border-b border-[#1E1E1E] py-3 px-4 flex items-center justify-between">
            <div class="flex items-center space-x-3">
                <img src="logo_black_icon.png" alt="Forge Logo" class="h-7 opacity-90">
                <h1 class="text-lg font-medium tracking-wider">FORGE</h1>
            </div>
            <div class="flex items-center space-x-4">
                <div class="flex items-center space-x-2">
                    <span class="text-sm">Active Model:</span>
                    <span class="font-medium text-[#F9A825]" id="activeModelIndicator">None</span>
                </div>
                <button class="text-sm bg-[#1E1E1E] hover:bg-[#2E2E2E] px-3 py-1 rounded" id="modelChangeBtn">
                    Change
                </button>
            </div>
        </header>

        <!-- Main Content Area -->
        <div class="flex flex-1 overflow-hidden">
            <!-- Sidebar -->
            <div class="w-16 bg-[#0E0E0E] flex flex-col items-center py-4 border-r border-[#1E1E1E]">
                <button class="tab-button active mb-6 p-2 rounded-lg flex flex-col items-center" data-tab="settings">
                    <i class="fas fa-cog text-xl mb-1"></i>
                    <span class="text-xs">Settings</span>
                </button>
                <button class="tab-button mb-6 p-2 rounded-lg flex flex-col items-center" data-tab="models">
                    <i class="fas fa-brain text-xl mb-1"></i>
                    <span class="text-xs">Models</span>
                </button>
                <button class="tab-button mb-6 p-2 rounded-lg flex flex-col items-center" data-tab="prompts">
                    <i class="fas fa-comment-alt text-xl mb-1"></i>
                    <span class="text-xs">Prompts</span>
                </button>
                <button class="tab-button mb-6 p-2 rounded-lg flex flex-col items-center" data-tab="chat">
                    <i class="fas fa-comments text-xl mb-1"></i>
                    <span class="text-xs">Chat</span>
                </button>
            </div>

            <!-- Tab Content -->
            <div class="flex-1 flex flex-col overflow-hidden">
                <!-- Settings Tab -->
                <div id="settingsTab" class="tab-content p-4 flex-1 overflow-y-auto">
                    <h2 class="text-xl font-bold mb-6 text-[#F9A825]">AI Service Configuration</h2>
                    <p class="text-sm text-[#A0A0A0] mb-6">Configure your connections to various AI services. Keys can be set via environment variables or entered directly below.</p>
                    
                    <div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4">
                        <!-- Gemini Card -->
                        <div class="card rounded-lg p-4 cursor-pointer" data-service="gemini">
                            <div class="flex items-center mb-3">
                                <div class="w-10 h-10 rounded bg-[#1E1E1E] flex items-center justify-center mr-3">
                                    <i class="fas fa-robot text-[#FB8C00]"></i>
                                </div>
                                <h3 class="font-bold">Gemini</h3>
                            </div>
                            <div class="text-xs mb-2 text-[#A0A0A0]">API Endpoint:</div>
                            <div class="text-xs mb-4 truncate" id="geminiEndpoint">Not configured</div>
                            <div class="flex items-center">
                                <span class="status-indicator w-3 h-3 rounded-full mr-2" id="geminiStatus"></span>
                                <span class="text-xs" id="geminiStatusText">Not configured</span>
                            </div>
                        </div>

                        <!-- OpenAI Card -->
                        <div class="card rounded-lg p-4 cursor-pointer" data-service="openai">
                            <div class="flex items-center mb-3">
                                <div class="w-10 h-10 rounded bg-[#1E1E1E] flex items-center justify-center mr-3">
                                    <i class="fas fa-bolt text-[#F4511E]"></i>
                                </div>
                                <h3 class="font-bold">OpenAI</h3>
                            </div>
                            <div class="text-xs mb-2 text-[#A0A0A0]">API Endpoint:</div>
                            <div class="text-xs mb-4 truncate" id="openaiEndpoint">Not configured</div>
                            <div class="flex items-center">
                                <span class="status-indicator w-3 h-3 rounded-full mr-2" id="openaiStatus"></span>
                                <span class="text-xs" id="openaiStatusText">Not configured</span>
                            </div>
                        </div>

                        <!-- Ollama Card -->
                        <div class="card rounded-lg p-4 cursor-pointer" data-service="ollama">
                            <div class="flex items-center mb-3">
                                <div class="w-10 h-10 rounded bg-[#1E1E1E] flex items-center justify-center mr-3">
                                    <i class="fas fa-server text-[#76E050]"></i>
                                </div>
                                <h3 class="font-bold">Ollama</h3>
                            </div>
                            <div class="text-xs mb-2 text-[#A0A0A0]">Local Endpoint:</div>
                            <div class="text-xs mb-4 truncate" id="ollamaEndpoint">Not configured</div>
                            <div class="flex items-center">
                                <span class="status-indicator w-3 h-3 rounded-full mr-2" id="ollamaStatus"></span>
                                <span class="text-xs" id="ollamaStatusText">Not configured</span>
                            </div>
                        </div>

                        <!-- Hugging Face Card -->
                        <div class="card rounded-lg p-4 cursor-pointer" data-service="huggingface">
                            <div class="flex items-center mb-3">
                                <div class="w-10 h-10 rounded bg-[#1E1E1E] flex items-center justify-center mr-3">
                                    <i class="fas fa-heart text-[#E53935]"></i>
                                </div>
                                <h3 class="font-bold">Hugging Face</h3>
                            </div>
                            <div class="text-xs mb-2 text-[#A0A0A0]">API Endpoint:</div>
                            <div class="text-xs mb-4 truncate" id="huggingfaceEndpoint">Not configured</div>
                            <div class="flex items-center">
                                <span class="status-indicator w-3 h-3 rounded-full mr-2" id="huggingfaceStatus"></span>
                                <span class="text-xs" id="huggingfaceStatusText">Not configured</span>
                            </div>
                        </div>

                        <!-- ComfyUI Card -->
                        <div class="card rounded-lg p-4 cursor-pointer" data-service="comfyui">
                            <div class="flex items-center mb-3">
                                <div class="w-10 h-10 rounded bg-[#1E1E1E] flex items-center justify-center mr-3">
                                    <i class="fas fa-image text-[#D32F2F]"></i>
                                </div>
                                <h3 class="font-bold">ComfyUI</h3>
                            </div>
                            <div class="text-xs mb-2 text-[#A0A0A0]">Local Endpoint:</div>
                            <div class="text-xs mb-4 truncate" id="comfyuiEndpoint">Not configured</div>
                            <div class="flex items-center">
                                <span class="status-indicator w-3 h-3 rounded-full mr-2" id="comfyuiStatus"></span>
                                <span class="text-xs" id="comfyuiStatusText">Not configured</span>
                            </div>
                        </div>
                    </div>
                </div>

                <!-- Models Tab -->
                <div id="modelsTab" class="tab-content p-4 flex-1 overflow-y-auto hidden">
                    <div class="flex justify-between items-center mb-6">
                        <h2 class="text-xl font-bold text-[#F9A825]">AI Models</h2>
                        <button id="filterBtn" class="bg-[#1E1E1E] hover:bg-[#2E2E2E] px-4 py-2 rounded flex items-center">
                            <i class="fas fa-filter mr-2"></i>
                            <span>Filters</span>
                        </button>
                    </div>

                    <div class="grid grid-cols-1 gap-4">
                        <!-- Example Model Cards -->
                        <div class="card rounded-lg p-4">
                            <div class="flex justify-between items-start mb-2">
                                <h3 class="font-bold">gemini-1.5-flash</h3>
                                <button class="bg-[#1E1E1E] hover:bg-[#2E2E2E] px-3 py-1 rounded text-sm">
                                    Select
                                </button>
                            </div>
                            <p class="text-sm text-[#A0A0A0] mb-3">Lightweight version of Gemini 1.5 optimized for speed with minimal quality loss.</p>
                            <div class="flex flex-wrap mb-3">
                                <span class="tag tag-purpose">Text & Code</span>
                                <span class="tag tag-original">Google</span>
                                <span class="tag tag-parameters">32K context</span>
                                <span class="tag tag-distilled">Distilled</span>
                            </div>
                            <div class="flex justify-between text-xs text-[#A0A0A0]">
                                <span>API Only</span>
                                <span>~1.5GB</span>
                            </div>
                        </div>

                        <div class="card rounded-lg p-4">
                            <div class="flex justify-between items-start mb-2">
                                <h3 class="font-bold">gpt-4o-mini</h3>
                                <button class="bg-[#1E1E1E] hover:bg-[#2E2E2E] px-3 py-1 rounded text-sm">
                                    Select
                                </button>
                            </div>
                            <p class="text-sm text-[#A0A0A0] mb-3">Smaller, efficient version of GPT-4 optimized for common tasks.</p>
                            <div class="flex flex-wrap mb-3">
                                <span class="tag tag-purpose">Chat</span>
                                <span class="tag tag-original">OpenAI</span>
                                <span class="tag tag-parameters">8K context</span>
                            </div>
                            <div class="flex justify-between text-xs text-[#A0A0A0]">
                                <span>API Only</span>
                                <span>~2.1GB</span>
                            </div>
                        </div>

                        <div class="card rounded-lg p-4">
                            <div class="flex justify-between items-start mb-2">
                                <h3 class="font-bold">llama3-8b</h3>
                                <button class="bg-[#1E1E1E] hover:bg-[#2E2E2E] px-3 py-1 rounded text-sm">
                                    Select
                                </button>
                            </div>
                            <p class="text-sm text-[#A0A0A0] mb-3">Meta's 8 billion parameter model, general purpose.</p>
                            <div class="flex flex-wrap mb-3">
                                <span class="tag tag-purpose">Text</span>
                                <span class="tag tag-original">Meta</span>
                                <span class="tag tag-parameters">8K context</span>
                            </div>
                            <div class="flex justify-between text-xs text-[#A0A0A0]">
                                <span>Local/API</span>
                                <span>4.1GB</span>
                            </div>
                        </div>
                    </div>
                </div>

                <!-- Prompts Tab -->
                <div id="promptsTab" class="tab-content p-4 flex-1 overflow-y-auto hidden">
                    <div class="flex justify-between items-center mb-6">
                        <h2 class="text-xl font-bold text-[#F9A825]">System Prompts</h2>
                        <button id="addPromptBtn" class="bg-[#1E1E1E] hover:bg-[#2E2E2E] px-4 py-2 rounded flex items-center">
                            <i class="fas fa-plus mr-2"></i>
                            <span>Add Prompt</span>
                        </button>
                    </div>

                    <div class="grid grid-cols-1 md:grid-cols-2 gap-4">
                        <!-- Example Prompt Cards -->
                        <div class="card rounded-lg p-4">
                            <div class="flex justify-between items-start mb-3">
                                <h3 class="font-bold">General Assistant</h3>
                                <div class="flex space-x-2">
                                    <button class="text-xs bg-[#1E1E1E] hover:bg-[#2E2E2E] px-2 py-1 rounded">
                                        Edit
                                    </button>
                                    <button class="text-xs bg-[#1E1E1E] hover:bg-[#2E2E2E] px-2 py-1 rounded">
                                        Select
                                    </button>
                                </div>
                            </div>
                            <p class="text-sm text-[#A0A0A0] mb-2 truncate">You are a helpful, harmless, and honest AI assistant. Provide concise answers and ask for clarification when needed.</p>
                        </div>

                        <div class="card rounded-lg p-4">
                            <div class="flex justify-between items-start mb-3">
                                <h3 class="font-bold">Code Expert</h3>
                                <div class="flex space-x-2">
                                    <button class="text-xs bg-[#1E1E1E] hover:bg-[#2E2E2E] px-2 py-1 rounded">
                                        Edit
                                    </button>
                                    <button class="text-xs bg-[#1E1E1E] hover:bg-[#2E2E2E] px-2 py-1 rounded">
                                        Select
                                    </button>
                                </div>
                            </div>
                            <p class="text-sm text-[#A0A0A0] mb-2 truncate">You are an expert programmer in all languages. Provide high-quality, efficient code with explanations. Format code properly.</p>
                        </div>

                        <div class="card rounded-lg p-4">
                            <div class="flex justify-between items-start mb-3">
                                <h3 class="font-bold">Creative Writer</h3>
                                <div class="flex space-x-2">
                                    <button class="text-xs bg-[#1E1E1E] hover:bg-[#2E2E2E] px-2 py-1 rounded">
                                        Edit
                                    </button>
                                    <button class="text-xs bg-[#1E1E1E] hover:bg-[#2E2E2E] px-2 py-1 rounded">
                                        Select
                                    </button>
                                </div>
                            </div>
                            <p class="text-sm text-[#A0A0A0] mb-2 truncate">You are a creative writer with a distinctive voice. Generate engaging, original content with rich vocabulary and stylistic flair.</p>
                        </div>
                    </div>
                </div>

                <!-- Chat Tab -->
                <div id="chatTab" class="tab-content flex-1 flex flex-col overflow-hidden hidden">
                    <!-- Chat Header -->
                    <div class="border-b border-[#1E1E1E] p-3 flex justify-between items-center">
                        <div class="flex items-center space-x-2">
                            <span class="text-sm">System Prompt:</span>
                            <span class="font-medium text-[#F9A825]" id="activePromptIndicator">General Assistant</span>
                        </div>
                        <button id="promptSelectBtn" class="text-sm bg-[#1E1E1E] hover:bg-[#2E2E2E] px-3 py-1 rounded">
                            Change
                        </button>
                    </div>

                    <!-- Chat Messages Area -->
                    <div id="chatMessages" class="flex-1 overflow-y-auto p-4 space-y-4">
                        <!-- Example messages -->
                        <div class="message-user rounded p-4">
                            <div class="flex items-center mb-2">
                                <div class="w-6 h-6 rounded-full bg-[#F9A825] flex items-center justify-center text-xs font-bold mr-2">U</div>
                                <span class="text-sm font-medium">User</span>
                            </div>
                            <p class="text-sm">Explain quantum computing in simple terms.</p>
                        </div>

                        <div class="message-ai rounded p-4">
                            <div class="flex items-center mb-2">
                                <div class="w-6 h-6 rounded-full bg-[#F4511E] flex items-center justify-center text-xs font-bold mr-2">AI</div>
                                <span class="text-sm font-medium">Gemini-1.5-flash</span>
                            </div>
                            <p class="text-sm">Quantum computing is an area of computing focused on developing computer technologies centered around quantum theory principles. Unlike classical computers that use bits (0s or 1s), quantum computers use quantum bits or qubits that can represent and store information in both 0 and 1 simultaneously (superposition).</p>
                        </div>
                    </div>

                    <!-- Chat Input Area -->
                    <div class="border-t border-[#1E1E1E] p-3">
                        <div class="flex items-end space-x-2">
                            <div class="flex-1 bg-[#1E1E1E] rounded-lg p-2">
                                <textarea id="chatInput" class="w-full bg-transparent outline-none resize-none text-sm" rows="2" placeholder="Type your message here..."></textarea>
                            </div>
                            <button id="sendMessageBtn" class="h-10 w-10 rounded-lg bg-[#D32F2F] hover:bg-[#E53935] flex items-center justify-center">
                                <i class="fas fa-paper-plane"></i>
                            </button>
                        </div>
                        <div class="flex items-center justify-between mt-2">
                            <div class="flex space-x-2">
                                <button class="text-xs bg-[#1E1E1E] hover:bg-[#2E2E2E] px-2 py-1 rounded flex items-center">
                                    <i class="fas fa-paperclip mr-1"></i>
                                    <span>Attach</span>
                                </button>
                                <button class="text-xs bg-[#1E1E1E] hover:bg-[#2E2E2E] px-2 py-1 rounded">
                                    <i class="fas fa-lock"></i>
                                </button>
                            </div>
                            <div class="flex space-x-2">
                                <button class="text-xs bg-[#1E1E1E] hover:bg-[#2E2E2E] px-2 py-1 rounded flex items-center">
                                    <i class="fas fa-search mr-1"></i>
                                    <span>Web</span>
                                </button>
                                <button class="text-xs bg-[#1E1E1E] hover:bg-[#2E2E2E] px-2 py-1 rounded flex items-center">
                                    <i class="fas fa-code mr-1"></i>
                                    <span>Code</span>
                                </button>
                                <button class="text-xs bg-[#1E1E1E] hover:bg-[#2E2E2E] px-2 py-1 rounded flex items-center">
                                    <i class="fas fa-cog mr-1"></i>
                                    <span>Params</span>
                                </button>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>

    <!-- Modals -->
    <!-- Service Configuration Modal -->
    <div id="serviceConfigModal" class="modal fixed inset-0 z-50 items-center justify-center hidden">
        <div class="bg-[#121212] border border-[#1E1E1E] rounded-lg w-full max-w-md p-6 mx-4">
            <div class="flex justify-between items-center mb-4">
                <h3 class="text-lg font-bold" id="serviceConfigTitle">Configure Service</h3>
                <button id="closeServiceConfigModal" class="text-xl">&times;</button>
            </div>
            
            <div class="mb-4">
                <label class="block text-sm mb-2">API Key Configuration</label>
                <div class="bg-[#1E1E1E] rounded-lg p-4 mb-3">
                    <p class="text-xs mb-3">Recommended: Set as environment variable</p>
                    <div class="bg-black rounded p-3 font-mono text-xs overflow-x-auto">
                        <p id="envVarExample">setx SERVICE_API_KEY "your_api_key_here"</p>
                    </div>
                </div>
                <div class="flex items-center mb-4">
                    <input type="checkbox" id="toggleKeyInput" class="mr-2">
                    <label for="toggleKeyInput" class="text-sm">Enter API key directly</label>
                </div>
                <div id="keyInputContainer" class="hidden">
                    <input type="password" id="apiKeyInput" class="w-full bg-[#1E1E1E] rounded p-2 text-sm mb-2" placeholder="Enter API key">
                    <p class="text-xs text-[#A0A0A0]">Note: This will be stored in your browser's local storage</p>
                </div>
            </div>
            
            <div class="mb-6">
                <label for="endpointInput" class="block text-sm mb-2">API Endpoint URL</label>
                <input type="text" id="endpointInput" class="w-full bg-[#1E1E1E] rounded p-2 text-sm" placeholder="https://api.example.com">
            </div>
            
            <div class="flex justify-end space-x-3">
                <button id="testConnectionBtn" class="px-4 py-2 rounded bg-[#1E1E1E] hover:bg-[#2E2E2E] text-sm">
                    Test Connection
                </button>
                <button id="saveServiceConfigBtn" class="px-4 py-2 rounded bg-[#D32F2F] hover:bg-[#E53935] text-sm">
                    Save Configuration
                </button>
            </div>
        </div>
    </div>

    <!-- Model Parameters Modal -->
    <div id="paramsModal" class="modal fixed inset-0 z-50 items-center justify-center hidden">
        <div class="bg-[#121212] border border-[#1E1E1E] rounded-lg w-full max-w-md p-6 mx-4">
            <div class="flex justify-between items-center mb-4">
                <h3 class="text-lg font-bold">Model Parameters</h3>
                <button id="closeParamsModal" class="text-xl">&times;</button>
            </div>
            
            <div class="space-y-4">
                <div>
                    <label class="block text-sm mb-2">Temperature: <span id="tempValue">0.7</span></label>
                    <input type="range" id="tempSlider" min="0" max="1" step="0.1" value="0.7" class="w-full parameter-slider">
                    <div class="flex justify-between text-xs text-[#A0A0A0]">
                        <span>Precise</span>
                        <span>Balanced</span>
                        <span>Creative</span>
                    </div>
                </div>
                
                <div>
                    <label class="block text-sm mb-2">Max Tokens: <span id="tokensValue">2048</span></label>
                    <input type="range" id="tokensSlider" min="256" max="16384" step="256" value="2048" class="w-full parameter-slider">
                    <div class="flex justify-between text-xs text-[#A0A0A0]">
                        <span>256</span>
                        <span>2048</span>
                        <span>8192</span>
                        <span>16384</span>
                    </div>
                </div>
                
                <div>
                    <label class="block text-sm mb-2">Context Window: <span id="contextValue">Full (8192)</span></label>
                    <input type="range" id="contextSlider" min="1024" max="8192" step="1024" value="8192" class="w-full parameter-slider">
                </div>
                
                <div class="flex items-center">
                    <input type="checkbox" id="streamToggle" class="mr-2" checked>
                    <label for="streamToggle" class="text-sm">Stream Responses</label>
                </div>
            </div>
            
            <div class="mt-6 flex justify-end">
                <button id="saveParamsBtn" class="px-4 py-2 rounded bg-[#D32F2F] hover:bg-[#E53935] text-sm">
                    Apply Settings
                </button>
            </div>
        </div>
    </div>

    <!-- System Prompt Editor Modal -->
    <div id="promptEditorModal" class="modal fixed inset-0 z-50 items-center justify-center hidden">
        <div class="bg-[#121212] border border-[#1E1E1E] rounded-lg w-full max-w-2xl p-6 mx-4">
            <div class="flex justify-between items-center mb-4">
                <h3 class="text-lg font-bold">Edit System Prompt</h3>
                <button id="closePromptEditorModal" class="text-xl">&times;</button>
            </div>
            
            <div class="mb-4">
                <label for="promptNameInput" class="block text-sm mb-2">Prompt Name</label>
                <input type="text" id="promptNameInput" class="w-full bg-[#1E1E1E] rounded p-2 text-sm" placeholder="Creative Writer">
            </div>
            
            <div class="mb-4">
                <label for="promptContentInput" class="block text-sm mb-2">Prompt Content</label>
                <textarea id="promptContentInput" class="w-full bg-[#1E1E1E] rounded p-3 text-sm h-40" placeholder="You are an expert creative writer..."></textarea>
            </div>
            
            <div class="flex justify-end space-x-3">
                <button id="cancelPromptBtn" class="px-4 py-2 rounded bg-[#1E1E1E] hover:bg-[#2E2E2E] text-sm">
                    Cancel
                </button>
                <button id="savePromptBtn" class="px-4 py-2 rounded bg-[#D32F2F] hover:bg-[#E53935] text-sm">
                    Save Prompt
                </button>
            </div>
        </div>
    </div>

    <!-- Typing Indicator -->
    <div id="typingIndicator" class="fixed bottom-24 left-1/2 transform -translate-x-1/2 bg-[#1E1E1E] rounded-full px-4 py-2 hidden">
        <div class="typing-indicator">
            <div class="typing-dot"></div>
            <div class="typing-dot"></div>
            <div class="typing-dot"></div>
            <span class="ml-2 text-sm">AI is thinking...</span>
        </div>
    </div>

    <script>
        // Simulate loading
        setTimeout(() => {
            document.getElementById('loadingScreen').style.opacity = '0';
            setTimeout(() => {
                document.getElementById('loadingScreen').style.display = 'none';
                document.getElementById('appContainer').classList.remove('hidden');
            }, 500);
        }, 2000);

        // Tab switching
        const tabButtons = document.querySelectorAll('.tab-button');
        const tabContents = document.querySelectorAll('.tab-content');
        
        tabButtons.forEach(button => {
            button.addEventListener('click', () => {
                // Update active tab button
                tabButtons.forEach(btn => btn.classList.remove('active'));
                button.classList.add('active');
                
                // Show corresponding content
                const tabName = button.getAttribute('data-tab');
                tabContents.forEach(content => {
                    content.classList.add('hidden');
                    if (content.id === `${tabName}Tab`) {
                        content.classList.remove('hidden');
                    }
                });
            });
        });

        // Service configuration
        const serviceCards = document.querySelectorAll('[data-service]');
        const serviceConfigModal = document.getElementById('serviceConfigModal');
        const closeServiceConfigModal = document.getElementById('closeServiceConfigModal');
        const toggleKeyInput = document.getElementById('toggleKeyInput');
        const keyInputContainer = document.getElementById('keyInputContainer');
        
        serviceCards.forEach(card => {
            card.addEventListener('click', () => {
                const service = card.getAttribute('data-service');
                document.getElementById('serviceConfigTitle').textContent = `Configure ${service.charAt(0).toUpperCase() + service.slice(1)}`;
                
                // Update environment variable example based on service
                const serviceVar = service.toUpperCase() + '_API_KEY';
                document.getElementById('envVarExample').textContent = `setx ${serviceVar} "your_api_key_here"`;
                
                serviceConfigModal.classList.remove('hidden');
            });
        });
        
        closeServiceConfigModal.addEventListener('click', () => {
            serviceConfigModal.classList.add('hidden');
        });
        
        toggleKeyInput.addEventListener('change', () => {
            keyInputContainer.classList.toggle('hidden', !toggleKeyInput.checked);
        });

        // Model parameters
        const paramsModal = document.getElementById('paramsModal');
        const closeParamsModal = document.getElementById('closeParamsModal');
        const tempSlider = document.getElementById('tempSlider');
        const tempValue = document.getElementById('tempValue');
        const tokensSlider = document.getElementById('tokensSlider');
        const tokensValue = document.getElementById('tokensValue');
        
        document.addEventListener('click', (e) => {
            if (e.target && e.target.textContent === 'Params') {
                paramsModal.classList.remove('hidden');
            }
        });
        
        closeParamsModal.addEventListener('click', () => {
            paramsModal.classList.add('hidden');
        });
        
        tempSlider.addEventListener('input', () => {
            tempValue.textContent = tempSlider.value;
        });
        
        tokensSlider.addEventListener('input', () => {
            tokensValue.textContent = tokensSlider.value;
        });

        // System prompt editor
        const promptEditorModal = document.getElementById('promptEditorModal');
        const closePromptEditorModal = document.getElementById('closePromptEditorModal');
        const addPromptBtn = document.getElementById('addPromptBtn');
        
        addPromptBtn.addEventListener('click', () => {
            promptEditorModal.classList.remove('hidden');
        });
        
        closePromptEditorModal.addEventListener('click', () => {
            promptEditorModal.classList.add('hidden');
        });

        // Chat functionality
        const chatInput = document.getElementById('chatInput');
        const sendMessageBtn = document.getElementById('sendMessageBtn');
        const chatMessages = document.getElementById('chatMessages');
        const typingIndicator = document.getElementById('typingIndicator');
        
        sendMessageBtn.addEventListener('click', sendMessage);
        
        chatInput.addEventListener('keydown', (e) => {
            if (e.key === 'Enter' && !e.shiftKey) {
                e.preventDefault();
                sendMessage();
            }
        });
        
        function sendMessage() {
            const message = chatInput.value.trim();
            if (message) {
                // Add user message
                const userMessage = document.createElement('div');
                userMessage.className = 'message-user rounded p-4';
                userMessage.innerHTML = `
                    <div class="flex items-center mb-2">
                        <div class="w-6 h-6 rounded-full bg-[#F9A825] flex items-center justify-center text-xs font-bold mr-2">U</div>
                        <span class="text-sm font-medium">User</span>
                    </div>
                    <p class="text-sm">${message}</p>
                `;
                chatMessages.appendChild(userMessage);
                
                // Clear input
                chatInput.value = '';
                
                // Show typing indicator
                typingIndicator.classList.remove('hidden');
                
                // Simulate AI response after delay
                setTimeout(() => {
                    typingIndicator.classList.add('hidden');
                    
                    // Add AI response
                    const aiMessage = document.createElement('div');
                    aiMessage.className = 'message-ai rounded p-4';
                    aiMessage.innerHTML = `
                        <div class="flex items-center mb-2">
                            <div class="w-6 h-6 rounded-full bg-[#F4511E] flex items-center justify-center text-xs font-bold mr-2">AI</div>
                            <span class="text-sm font-medium" id="activeModelIndicator">Gemini-1.5-flash</span>
                        </div>
                        <p class="text-sm">${getDummyResponse(message)}</p>
                    `;
                    chatMessages.appendChild(aiMessage);
                    
                    // Scroll to bottom
                    chatMessages.scrollTop = chatMessages.scrollHeight;
                }, 1500);
            }
        }
        
        function getDummyResponse(message) {
            const responses = [
                "I'm analyzing your request about '" + message + "'. Here's what I can tell you...",
                "That's an interesting question regarding '" + message + "'. From my knowledge...",
                "Regarding '" + message + "', the key points to consider are...",
                "Thanks for asking about '" + message + "'. Here's a summary...",
                "The topic '" + message + "' is complex, but I'll break it down simply..."
            ];
            return responses[Math.floor(Math.random() * responses.length)];
        }

        // Close modals when clicking outside
        document.addEventListener('click', (e) => {
            const modals = ['serviceConfigModal', 'paramsModal', 'promptEditorModal'];
            
            modals.forEach(modalId => {
                const modal = document.getElementById(modalId);
                if (modal && !modal.contains(e.target) && !e.target.closest(`[data-target="${modalId}"]`) && !modal.classList.contains('hidden')) {
                    modal.classList.add('hidden');
                }
            });
        });

        // Initialize status indicators
        function initStatusIndicators() {
            const services = ['gemini', 'openai', 'ollama', 'huggingface', 'comfyui'];
            services.forEach(service => {
                document.getElementById(`${service}Status`).classList.add('status-disconnected');
            });
        }

        // Initialize on load
        window.addEventListener('DOMContentLoaded', () => {
            initStatusIndicators();
            document.getElementById('activeModelIndicator').textContent = 'None';
            document.getElementById('activePromptIndicator').textContent = 'General Assistant';
        });
    </script>
<p style="border-radius: 8px; text-align: center; font-size: 12px; color: #fff; margin-top: 16px;position: fixed; left: 8px; bottom: 8px; z-index: 10; background: rgba(0, 0, 0, 0.8); padding: 4px 8px;">Made with <img src="https://enzostvs-deepsite.hf.space/logo.svg" alt="DeepSite Logo" style="width: 16px; height: 16px; vertical-align: middle;display:inline-block;margin-right:3px;filter:brightness(0) invert(1);"><a href="https://enzostvs-deepsite.hf.space" style="color: #fff;text-decoration: underline;" target="_blank" >DeepSite</a> - 🧬 <a href="https://enzostvs-deepsite.hf.space?remix=PrometheusGroup/prometheus-forge-ai-hub" style="color: #fff;text-decoration: underline;" target="_blank" >Remix</a></p></body>
</html>