forked from micytao/vllm-playground
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
786 lines (719 loc) · 48.7 KB
/
index.html
File metadata and controls
786 lines (719 loc) · 48.7 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>vLLM Playground - Server Management & Chat Interface</title>
<link rel="icon" type="image/jpeg" href="/assets/vllm.jpeg">
<link rel="stylesheet" href="/static/css/style.css">
</head>
<body>
<div class="container">
<!-- Header -->
<header class="header">
<div class="header-content">
<div class="logo-container">
<img src="/assets/vllm.png" alt="vLLM" class="logo" onerror="this.style.display='none'">
<h1><span class="logo-text">vLLM</span> Playground</h1>
</div>
<div class="status-indicator">
<span id="status-dot" class="status-dot"></span>
<span id="status-text">Disconnected</span>
<span id="uptime" class="uptime"></span>
</div>
</div>
</header>
<!-- Main Content -->
<div class="main-content">
<!-- Left Sidebar - Configuration -->
<aside class="sidebar resizable" id="config-panel">
<div class="panel">
<h2>⚙️ Server Configuration</h2>
<!-- Model Source Toggle -->
<div class="form-group mode-toggle-group">
<label>Model Source</label>
<div class="mode-toggle-buttons">
<label class="mode-button active" id="model-source-hub-label">
<input type="radio" name="model-source" id="model-source-hub" value="hub" checked>
<span>🤗 HuggingFace</span>
</label>
<label class="mode-button" id="model-source-local-label">
<input type="radio" name="model-source" id="model-source-local" value="local">
<span>📁 Local</span>
</label>
</div>
<small class="form-help" id="model-source-help-text">Select model from HuggingFace or local directory</small>
</div>
<!-- HuggingFace Hub Model Selection (default visible) -->
<div id="hub-model-section" class="form-group">
<label for="model-select">Model</label>
<select id="model-select" class="form-control">
<!-- CPU-Optimized Models (Recommended for macOS) -->
<optgroup label="🖥️ CPU-Friendly Models">
<option value="TinyLlama/TinyLlama-1.1B-Chat-v1.0" selected>TinyLlama 1.1B Chat (Fast, No token)</option>
<option value="meta-llama/Llama-3.2-1B">Llama 3.2 1B (Gated, needs HF token)</option>
</optgroup>
<!-- Larger Models (Slower on CPU) -->
<optgroup label="🎮 GPU-Optimized Models (Slow on CPU)">
<option value="mistralai/Mistral-7B-Instruct-v0.2">Mistral 7B Instruct</option>
<option value="RedHatAI/Llama-3.2-1B-Instruct-FP8">Llama 3.2 1B Instruct FP8 (Gated, needs HF token)</option>
<option value="RedHatAI/Llama-3.1-8B-Instruct">Llama 3.1 8B Instruct (Gated, needs HF token)</option>
</optgroup>
</select>
<small class="form-help">All models support chat interface. Gated models require HF token below.</small>
<input type="text" id="custom-model" class="form-control" placeholder="Or enter custom model name">
</div>
<!-- Local Model Path Section (hidden by default) -->
<div id="local-model-section" class="form-group" style="display: none;">
<label for="local-model-path">Local Model Directory Path</label>
<input type="text" id="local-model-path" class="form-control" placeholder="~/models/my-model or /absolute/path/to/model">
<div class="local-path-buttons">
<button id="browse-folder-btn" class="btn btn-secondary btn-sm" title="Browse for folder">
📁 Browse
</button>
<button id="validate-path-btn" class="btn btn-secondary btn-sm" title="Validate path">
Validate
</button>
</div>
<small class="form-help">Enter absolute path to directory containing model files (config.json, weights, etc.). Supports ~ for home directory.</small>
<!-- Validation Status -->
<div id="local-model-validation" class="validation-status" style="display: none; margin-top: 8px;">
<span id="validation-icon"></span>
<span id="validation-message"></span>
</div>
<!-- Model Info Display -->
<div id="local-model-info" class="model-info-box" style="display: none; margin-top: 10px; padding: 10px; background: #1e293b; border-radius: 6px; border-left: 3px solid #10b981;">
<div class="info-row">
<span class="info-label">Model Name:</span>
<span id="info-model-name" class="info-value">-</span>
</div>
<div class="info-row">
<span class="info-label">Model Type:</span>
<span id="info-model-type" class="info-value">-</span>
</div>
<div class="info-row">
<span class="info-label">Size:</span>
<span id="info-model-size" class="info-value">-</span>
</div>
<div class="info-row">
<span class="info-label">Has Tokenizer:</span>
<span id="info-has-tokenizer" class="info-value">-</span>
</div>
</div>
</div>
<!-- HuggingFace Token for Gated Models -->
<div class="form-group">
<label for="hf-token">HuggingFace Token (Optional)</label>
<input type="password" id="hf-token" class="form-control" placeholder="hf_xxxxxxxxxxxxx">
<small class="form-help">Required for gated models (Llama 3.1, Llama 3.2). Get token from <a href="https://huggingface.co/settings/tokens" target="_blank">HuggingFace Settings</a></small>
</div>
<!-- CPU/GPU Mode Toggle -->
<div class="form-group mode-toggle-group">
<label>Compute Mode</label>
<div class="mode-toggle-buttons">
<label class="mode-button active" id="mode-cpu-label">
<input type="radio" name="compute-mode" id="mode-cpu" value="cpu" checked>
<span>🖥️ CPU</span>
</label>
<label class="mode-button" id="mode-gpu-label">
<input type="radio" name="compute-mode" id="mode-gpu" value="gpu">
<span>🎮 GPU</span>
</label>
</div>
<small class="form-help" id="mode-help-text">CPU mode is recommended for macOS</small>
</div>
<div class="form-row">
<div class="form-group">
<label for="host">Host</label>
<input type="text" id="host" class="form-control" value="0.0.0.0">
</div>
<div class="form-group">
<label for="port">Port</label>
<input type="number" id="port" class="form-control" value="8000">
</div>
</div>
<!-- GPU-specific settings (hidden in CPU mode) -->
<div id="gpu-settings">
<div class="form-row">
<div class="form-group">
<label for="tensor-parallel">Tensor Parallel Size</label>
<input type="number" id="tensor-parallel" class="form-control" value="1" min="1">
</div>
<div class="form-group">
<label for="gpu-memory">GPU Memory (%)</label>
<input type="number" id="gpu-memory" class="form-control" value="90" min="10" max="100" step="5">
</div>
</div>
</div>
<!-- CPU-specific settings (shown in CPU mode) -->
<div id="cpu-settings" style="display: block;">
<div class="form-row">
<div class="form-group">
<label for="cpu-kvcache">CPU KV Cache Space (GB)</label>
<input type="number" id="cpu-kvcache" class="form-control" value="4" min="1" max="200">
<small class="form-help">Memory allocated for KV cache (start with 4GB)</small>
</div>
<div class="form-group">
<label for="cpu-threads">CPU Thread Binding</label>
<select id="cpu-threads" class="form-control">
<option value="auto">Auto (Recommended)</option>
<option value="cores">Cores</option>
<option value="none">None</option>
</select>
</div>
</div>
</div>
<div class="form-group">
<label for="dtype">Data Type</label>
<select id="dtype" class="form-control">
<option value="auto">Auto</option>
<option value="float16">Float16</option>
<option value="bfloat16" selected>BFloat16</option>
<option value="float32">Float32</option>
</select>
<small class="form-help" id="dtype-help-text">BFloat16 recommended for CPU</small>
</div>
<div class="form-group">
<label for="max-model-len">Max Model Length (optional)</label>
<input type="number" id="max-model-len" class="form-control" placeholder="2048 (CPU) / 8192 (GPU)">
<small class="form-help">Leave empty to use safe defaults: 2048 (CPU) or 8192 (GPU)</small>
</div>
<!-- Advanced: Chat Template Settings -->
<div class="template-settings-section">
<div class="template-settings-header" id="template-settings-toggle">
<h3>Chat Template Reference (Advanced)</h3>
<span class="toggle-icon">▼</span>
</div>
<div class="template-settings-content" id="template-settings-content" style="display: none;">
<div class="info-box" style="background: #1e40af20; border-left: 3px solid #1e40af; padding: 10px; margin-bottom: 15px; border-radius: 4px;">
<strong>ℹ️ Note:</strong> vLLM automatically loads chat templates and stop tokens from each model's tokenizer config. The fields below show reference templates for documentation purposes only. Modern models (2023+) all have built-in templates that work correctly.
</div>
<div class="form-group">
<label for="chat-template">Chat Template (Jinja2) <span style="color: #10b981; font-size: 0.85em;">🔄 Reference Only</span></label>
<textarea id="chat-template" class="form-control template-textarea" rows="4" spellcheck="false" placeholder="Will be loaded from model's tokenizer config..." readonly></textarea>
<small class="form-help">vLLM automatically uses the model's chat template from tokenizer config. Shown for reference only.</small>
</div>
<div class="form-group">
<label for="stop-tokens">Stop Tokens (comma-separated) <span style="color: #10b981; font-size: 0.85em;">🔄 Reference Only</span></label>
<input type="text" id="stop-tokens" class="form-control" placeholder="Will be loaded from model's tokenizer config..." readonly>
<small class="form-help">vLLM automatically handles stop tokens via chat template. Shown for reference only. Use 'custom_stop_tokens' in server config to override.</small>
</div>
</div>
</div>
<div class="form-group checkbox-group">
<label>
<input type="checkbox" id="trust-remote-code">
<span>Trust Remote Code</span>
</label>
</div>
<div class="form-group checkbox-group">
<label>
<input type="checkbox" id="enable-prefix-caching">
<span>Enable Prefix Caching</span>
</label>
</div>
<div class="form-group checkbox-group">
<label>
<input type="checkbox" id="disable-log-stats">
<span>Disable Log Stats</span>
</label>
</div>
<!-- Command Preview Section -->
<div class="command-preview-section">
<div class="command-preview-header">
<h3>Command Preview</h3>
<button id="copy-command-btn" class="btn btn-secondary btn-sm" title="Copy command">Copy</button>
</div>
<textarea id="command-text" class="command-preview-textarea" rows="8" spellcheck="false">python -m vllm.entrypoints.openai.api_server --model facebook/opt-125m</textarea>
<small class="command-help">Edit the command directly or use the form above. Your edits will be used when starting the server.</small>
</div>
<div class="button-group">
<button id="start-btn" class="btn btn-primary">Start Server</button>
<button id="stop-btn" class="btn btn-danger" disabled>Stop Server</button>
</div>
</div>
<div class="resize-handle resize-handle-vertical" data-direction="horizontal"></div>
</aside>
<!-- Center - Chat Interface -->
<main class="chat-section resizable" id="chat-panel">
<div class="panel">
<div class="panel-header">
<h2>💬 Chat Interface</h2>
<button id="clear-chat-btn" class="btn btn-secondary btn-sm" style="min-width: 80px; padding: 6px 16px;">Clear</button>
</div>
<div id="chat-container" class="chat-container">
<div class="chat-message system">
<div class="message-content">
<strong>System:</strong> Start the vLLM server and begin chatting with your model.
</div>
</div>
</div>
<div class="chat-input-area">
<!-- System Prompt -->
<div class="system-prompt-section">
<div class="system-prompt-header">
<label for="system-prompt">System Prompt:</label>
<button id="clear-system-prompt-btn" class="btn btn-secondary btn-sm" style="min-width: 80px; padding: 6px 16px;" title="Clear system prompt">Clear</button>
</div>
<textarea id="system-prompt" class="system-prompt-input" rows="2" placeholder="Set system prompt (e.g., 'You are a helpful coding assistant')">You are a helpful assistant.</textarea>
<small class="form-help">💡 System prompt is sent with every message. Clear or simplify for small models (TinyLlama) if responses are poor.</small>
</div>
<div class="generation-params">
<div class="param-group">
<label for="temperature">Temperature: <span id="temp-value">0.7</span></label>
<input type="range" id="temperature" min="0" max="1" step="0.05" value="0.7">
</div>
<div class="param-group">
<label for="max-tokens">Max Tokens: <span id="tokens-value">256</span></label>
<input type="range" id="max-tokens" min="1" max="4096" step="1" value="256">
</div>
</div>
<div class="input-group">
<div class="input-with-templates">
<textarea id="chat-input" class="chat-input" placeholder="Type your message here..." rows="1"></textarea>
<select id="message-templates" class="message-templates">
<option value="">Quick messages...</option>
<option value="Hello!">Hello!</option>
<option value="Hi, how are you?">Hi, how are you?</option>
<option value="Can you help me with something?">Can you help me with something?</option>
<option value="Thank you!">Thank you!</option>
<option value="What can you do?">What can you do?</option>
<option value="Tell me more about this.">Tell me more about this.</option>
</select>
</div>
<button id="send-btn" class="btn btn-primary" disabled>Send</button>
</div>
</div>
</div>
<!-- Chat Performance Metrics Section -->
<div class="chat-metrics-below">
<div class="panel-header">
<h3>Last Response Metrics</h3>
</div>
<div id="chat-metrics" class="chat-metrics-grid">
<div class="chat-metric-item">
<span class="metric-label">Prompt Tokens:</span>
<span class="metric-value" id="metric-prompt-tokens">-</span>
</div>
<div class="chat-metric-item">
<span class="metric-label">Completion Tokens:</span>
<span class="metric-value" id="metric-completion-tokens">-</span>
</div>
<div class="chat-metric-item">
<span class="metric-label">Total Tokens:</span>
<span class="metric-value" id="metric-total-tokens">-</span>
</div>
<div class="chat-metric-item">
<span class="metric-label">Time Taken:</span>
<span class="metric-value" id="metric-time-taken">-</span>
</div>
<div class="chat-metric-item">
<span class="metric-label">Tokens/sec:</span>
<span class="metric-value" id="metric-tokens-per-sec">-</span>
</div>
<div class="chat-metric-item">
<span class="metric-label">Avg Prompt Throughput:</span>
<span class="metric-value" id="metric-prompt-throughput">-</span>
</div>
<div class="chat-metric-item">
<span class="metric-label">Avg Generation Throughput:</span>
<span class="metric-value" id="metric-generation-throughput">-</span>
</div>
<div class="chat-metric-item">
<span class="metric-label">GPU KV Cache Usage:</span>
<span class="metric-value" id="metric-kv-cache-usage">-</span>
</div>
<div class="chat-metric-item">
<span class="metric-label">Prefix Cache Hit Rate:</span>
<span class="metric-value" id="metric-prefix-cache-hit">-</span>
</div>
</div>
</div>
<div class="resize-handle resize-handle-vertical" data-direction="horizontal"></div>
</main>
<!-- Right Panel - Logs -->
<aside class="logs-section resizable" id="logs-panel">
<div class="panel">
<div class="panel-header">
<h2>📋 Server Logs</h2>
<button id="clear-logs-btn" class="btn btn-secondary btn-sm" style="min-width: 80px; padding: 6px 16px;">Clear</button>
</div>
<div id="logs-container" class="logs-container">
<div class="log-entry info">Waiting for connection...</div>
</div>
<div class="logs-footer">
<label>
<input type="checkbox" id="auto-scroll" checked>
<span>Auto-scroll</span>
</label>
</div>
</div>
</aside>
</div>
<!-- Horizontal Resize Handle for Compression Section -->
<div class="resize-handle resize-handle-horizontal" id="compression-resize-handle" data-direction="vertical"></div>
<!-- Model Compression Section (LLM-Compressor) -->
<section class="compression-section resizable" id="compression-panel">
<div class="panel">
<div class="panel-header">
<div style="display: flex; align-items: center; gap: 10px;">
<button id="toggle-compression-section-btn" class="btn btn-secondary btn-sm section-toggle-btn" title="Show/Hide section">▼</button>
<h2>🔧 Model Compression (LLM-Compressor)</h2>
</div>
<div class="compression-controls">
<button id="run-compression-btn" class="btn btn-primary btn-sm">Compress Model</button>
<button id="stop-compression-btn" class="btn btn-danger btn-sm" disabled style="display: none;">Stop</button>
</div>
</div>
<div id="compression-section-content">
<!-- Two-Column Layout -->
<div class="compression-content-layout">
<!-- Left Column: Presets and Info -->
<div class="compression-left-column">
<!-- Compression Presets -->
<div class="compression-presets" id="compression-presets">
<h3>Quick Start Presets</h3>
<div class="presets-grid" id="presets-container">
<!-- Presets will be loaded dynamically -->
<div class="preset-loading">Loading presets...</div>
</div>
</div>
<!-- Command Preview Section -->
<div class="compression-command-preview">
<div class="command-preview-header">
<h3>Command Preview</h3>
<button id="copy-compress-command-btn" class="btn btn-secondary btn-sm" title="Copy command">Copy</button>
</div>
<textarea id="compress-command-text" class="command-preview-textarea" rows="8" spellcheck="false" readonly>python -m llmcompressor.oneshot ...</textarea>
</div>
</div>
<!-- Right Column: Configuration and Status -->
<div class="compression-right-column">
<!-- Compression Configuration -->
<div class="compression-config">
<h3>Configuration</h3>
<div class="config-grid">
<div class="config-item">
<label for="compress-model-select">Model:</label>
<select id="compress-model-select" class="form-control-sm">
<!-- CPU-Friendly Models -->
<optgroup label="🖥️ CPU-Friendly Models">
<option value="TinyLlama/TinyLlama-1.1B-Chat-v1.0" selected>TinyLlama 1.1B Chat</option>
<option value="meta-llama/Llama-3.2-1B">Llama 3.2 1B (Gated)</option>
</optgroup>
<!-- GPU-Optimized Models -->
<optgroup label="🎮 GPU-Optimized Models">
<option value="mistralai/Mistral-7B-Instruct-v0.2">Mistral 7B Instruct</option>
<option value="RedHatAI/Llama-3.2-1B-Instruct-FP8">Llama 3.2 1B Instruct FP8 (Gated)</option>
<option value="RedHatAI/Llama-3.1-8B-Instruct">Red Hat AI Llama 3.1 8B Instruct (Gated)</option>
<option value="meta-llama/Llama-3.1-8B-Instruct">Llama 3.1 8B Instruct (Gated)</option>
</optgroup>
</select>
<input type="text" id="compress-custom-model" class="form-control-sm" placeholder="Or enter custom HuggingFace model" style="margin-top: 8px;">
<small class="form-help">Select from list or enter custom HuggingFace model path</small>
</div>
<div class="config-item">
<label for="compress-hf-token">HuggingFace Token (for gated models):</label>
<input type="password" id="compress-hf-token" class="form-control-sm" placeholder="hf_...">
<small class="form-help">Required for gated models like Llama. Token is not stored.</small>
</div>
<div class="config-item">
<label for="compress-format">Quantization Format:</label>
<select id="compress-format" class="form-control-sm">
<option value="W8A8_INT8">W8A8 INT8 (Balanced)</option>
<option value="W8A8_FP8">W8A8 FP8 (Fast)</option>
<option value="W4A16">W4A16 (Compact)</option>
<option value="W4A16_ASYM">W4A16 Asymmetric (Better Quality)</option>
<option value="FP4_W4A16">FP4 W4A16 (NVFP4A16)</option>
<option value="FP4_W4A4">FP4 W4A4 (Maximum - NVFP4)</option>
</select>
</div>
<div class="config-item">
<label for="compress-algorithm">Algorithm:</label>
<select id="compress-algorithm" class="form-control-sm">
<option value="GPTQ" selected>GPTQ (Recommended)</option>
<option value="AWQ">AWQ</option>
<option value="SmoothQuant">SmoothQuant</option>
<option value="PTQ">Simple PTQ</option>
<option value="SparseGPT">SparseGPT</option>
</select>
</div>
<div class="config-item">
<label for="compress-dataset">Calibration Dataset:</label>
<select id="compress-dataset" class="form-control-sm">
<option value="open_platypus" selected>Open Platypus</option>
<option value="c4">C4</option>
<option value="wikitext2">WikiText2</option>
<option value="ptb">Penn TreeBank</option>
</select>
</div>
<div class="config-item">
<label for="compress-samples">Calibration Samples:</label>
<input type="number" id="compress-samples" class="form-control-sm" value="512" min="128" max="2048" step="128">
</div>
<div class="config-item">
<label for="compress-seq-length">Max Sequence Length:</label>
<input type="number" id="compress-seq-length" class="form-control-sm" value="2048" min="512" max="8192" step="512">
</div>
</div>
<!-- Advanced Options (Collapsible) -->
<div class="advanced-options">
<div class="advanced-header" id="advanced-toggle">
<h4>Advanced Options</h4>
<span class="toggle-icon">▼</span>
</div>
<div class="advanced-content" id="advanced-content" style="display: none;">
<div class="advanced-grid">
<div class="config-item">
<label for="compress-target-layers">Target Layers:</label>
<input type="text" id="compress-target-layers" class="form-control-sm" value="Linear" placeholder="e.g., Linear, self_attn">
</div>
<div class="config-item">
<label for="compress-ignore-layers">Ignore Layers:</label>
<input type="text" id="compress-ignore-layers" class="form-control-sm" value="lm_head" placeholder="e.g., lm_head">
</div>
<div class="config-item">
<label for="compress-smoothing">Smoothing Strength (SmoothQuant):</label>
<input type="number" id="compress-smoothing" class="form-control-sm" value="0.8" min="0" max="1" step="0.1">
</div>
</div>
</div>
</div>
</div>
<!-- Compression Status Display (Always Visible) -->
<div id="compression-status-display" class="compression-status-display">
<div class="status-header">
<h3>Compression Progress</h3>
<span id="compression-stage-badge" class="stage-badge stage-idle">Idle</span>
</div>
<!-- Progress Bar -->
<div class="progress-container">
<div class="progress-bar">
<div id="compression-progress-fill" class="progress-fill" style="width: 0%"></div>
</div>
<div class="progress-text">
<span id="compression-progress-message">Ready to compress</span>
<span id="compression-progress-percent">0%</span>
</div>
</div>
<!-- Model Size Comparison -->
<div class="size-comparison" id="size-comparison" style="display: none;">
<div class="size-item">
<div class="size-label">Original Size</div>
<div class="size-value" id="original-size">--</div>
</div>
<div class="size-arrow">→</div>
<div class="size-item">
<div class="size-label">Compressed Size</div>
<div class="size-value compressed" id="compressed-size">--</div>
</div>
<div class="size-item">
<div class="size-label">Reduction</div>
<div class="size-value reduction" id="compression-ratio">--</div>
</div>
</div>
<!-- Timer Display (Compact) -->
<div class="compression-timer-compact" id="compression-timer" style="display: none;">
<span class="timer-label">⏱️ Elapsed:</span>
<span class="timer-value" id="compression-timer-value">00:00:00</span>
</div>
<!-- Output Directory Display -->
<div class="output-directory-display" id="output-directory-display" style="display: none;">
<div class="output-dir-label">📁 Saved Location:</div>
<div class="output-dir-path" id="output-dir-path" title="Click to copy">--</div>
</div>
<!-- Action Buttons -->
<div class="compression-actions" id="compression-actions" style="display: none;">
<button id="download-compressed-btn" class="btn btn-success">Download Compressed Model</button>
<button id="load-compressed-btn" class="btn btn-primary">Load into vLLM</button>
<button id="new-compression-btn" class="btn btn-secondary">New Compression</button>
</div>
</div>
</div>
</div>
</div>
</div>
</section>
<!-- Horizontal Resize Handle for Metrics Section -->
<div class="resize-handle resize-handle-horizontal" id="metrics-resize-handle" data-direction="vertical"></div>
<!-- Performance Metrics Section -->
<section class="metrics-section resizable" id="metrics-panel">
<div class="panel">
<div class="panel-header">
<div style="display: flex; align-items: center; gap: 10px;">
<button id="toggle-metrics-section-btn" class="btn btn-secondary btn-sm section-toggle-btn" title="Show/Hide section">▼</button>
<h2>📊 Performance Metrics (GuideLLM)</h2>
</div>
<div class="metrics-controls">
<button id="run-benchmark-btn" class="btn btn-primary btn-sm" disabled>Run Benchmark</button>
<button id="stop-benchmark-btn" class="btn btn-danger btn-sm" disabled style="display: none;">Stop</button>
</div>
</div>
<div id="metrics-section-content">
<!-- Benchmark Configuration -->
<div class="benchmark-config">
<!-- Benchmark Method Selection -->
<div class="config-row" style="margin-bottom: 15px; padding-bottom: 15px; border-bottom: 1px solid #2a3142;">
<div class="config-item" style="flex: 1;">
<label style="font-weight: 600; margin-bottom: 8px; display: block;">Benchmark Method:</label>
<div style="display: flex; gap: 20px;">
<label style="display: flex; align-items: center; cursor: pointer;">
<input type="radio" name="benchmark-method" id="benchmark-method-builtin" value="builtin" checked style="margin-right: 8px;">
<span>Built-in (Fast)</span>
</label>
<label style="display: flex; align-items: center; cursor: pointer;">
<input type="radio" name="benchmark-method" id="benchmark-method-guidellm" value="guidellm" style="margin-right: 8px;">
<span>GuideLLM (Advanced)</span>
</label>
</div>
<small class="form-help" style="display: block; margin-top: 5px;">Built-in: Fast & simple. GuideLLM: More detailed metrics & HTML reports</small>
</div>
</div>
<div class="config-row">
<div class="config-item">
<label for="benchmark-requests">Total Requests:</label>
<input type="number" id="benchmark-requests" class="form-control-sm" value="100" min="10" max="1000">
</div>
<div class="config-item">
<label for="benchmark-rate">Request Rate (req/s):</label>
<input type="number" id="benchmark-rate" class="form-control-sm" value="5" min="1" max="50">
</div>
<div class="config-item">
<label for="benchmark-prompt-tokens">Prompt Tokens:</label>
<input type="number" id="benchmark-prompt-tokens" class="form-control-sm" value="100" min="10" max="2048">
</div>
<div class="config-item">
<label for="benchmark-output-tokens">Output Tokens:</label>
<input type="number" id="benchmark-output-tokens" class="form-control-sm" value="100" min="10" max="2048">
</div>
</div>
</div>
<!-- Command Preview Section -->
<div class="command-preview-section" style="margin-top: 15px;">
<div class="command-preview-header">
<h3>Command Preview</h3>
<button id="copy-benchmark-command-btn" class="btn btn-secondary btn-sm" title="Copy command">Copy</button>
</div>
<textarea id="benchmark-command-text" class="command-preview-textarea" rows="6" spellcheck="false" readonly>guidellm --target http://localhost:8000/v1 --rate 5 --max-requests 100</textarea>
<small class="command-help">Equivalent GuideLLM command for this benchmark configuration</small>
</div>
<!-- Raw GuideLLM Output Section -->
<div class="command-preview-section" id="guidellm-raw-output-section" style="margin-top: 15px; display: none;">
<div class="command-preview-header">
<h3>GuideLLM Raw Output</h3>
<div style="display: flex; gap: 8px;">
<button id="toggle-raw-output-btn" class="btn btn-secondary btn-sm" title="Hide/Show raw output">Hide</button>
<button id="copy-guidellm-output-btn" class="btn btn-secondary btn-sm" title="Copy output">Copy</button>
</div>
</div>
<div id="guidellm-raw-output-content">
<textarea id="guidellm-raw-output" class="command-preview-textarea" rows="15" spellcheck="false" readonly style="font-family: monospace; font-size: 11px;"></textarea>
<small class="command-help">Complete output from GuideLLM benchmark</small>
</div>
</div>
<!-- GuideLLM JSON Output Section -->
<div class="command-preview-section" id="guidellm-json-output-section" style="margin-top: 15px; display: none;">
<div class="command-preview-header">
<h3>📊 GuideLLM Benchmark Results (JSON)</h3>
<div style="display: flex; gap: 8px;">
<button id="toggle-json-output-btn" class="btn btn-secondary btn-sm" title="Hide/Show JSON output">Hide</button>
<button id="copy-guidellm-json-btn" class="btn btn-secondary btn-sm" title="Copy JSON">Copy</button>
</div>
</div>
<div id="guidellm-json-output-content">
<pre id="guidellm-json-output" class="json-display" style="background: #1e1e1e; color: #d4d4d4; padding: 15px; border-radius: 6px; max-height: 500px; overflow: auto; font-family: 'Monaco', 'Menlo', 'Courier New', monospace; font-size: 12px; line-height: 1.5; margin: 0;"></pre>
<small class="command-help">Structured benchmark data in JSON format</small>
</div>
</div>
<!-- GuideLLM Table View Section -->
<div class="benchmark-table-section" id="guidellm-table-section" style="margin-top: 15px; display: none;">
<div class="command-preview-header">
<h3>📈 Benchmark Summary Table</h3>
</div>
<div id="guidellm-table-content" class="table-container">
<!-- Tables will be populated here by JavaScript -->
</div>
</div>
<!-- Metrics Display -->
<div id="metrics-display" class="metrics-display">
<div class="metrics-placeholder">
<p>No benchmark data available</p>
<p class="metrics-help">Start the vLLM server and click "Run Benchmark" to test performance</p>
</div>
</div>
<!-- Metrics Grid -->
<div id="metrics-grid" class="metrics-grid" style="display: none;">
<!-- Throughput Metrics -->
<div class="metric-card">
<div class="metric-icon">🚀</div>
<div class="metric-label">Throughput</div>
<div class="metric-value" id="metric-throughput">-- req/s</div>
<div class="metric-subtext">Requests per second</div>
</div>
<!-- Latency Metrics -->
<div class="metric-card">
<div class="metric-icon">⏱️</div>
<div class="metric-label">Avg Latency</div>
<div class="metric-value" id="metric-latency">-- ms</div>
<div class="metric-subtext">Mean response time</div>
</div>
<!-- Tokens per Second -->
<div class="metric-card">
<div class="metric-icon">📝</div>
<div class="metric-label">Token Throughput</div>
<div class="metric-value" id="benchmark-tokens-per-sec">-- tok/s</div>
<div class="metric-subtext">Output tokens per second</div>
</div>
<!-- P50 Latency -->
<div class="metric-card">
<div class="metric-icon">📊</div>
<div class="metric-label">P50 Latency</div>
<div class="metric-value" id="metric-p50">-- ms</div>
<div class="metric-subtext">50th percentile</div>
</div>
<!-- P95 Latency -->
<div class="metric-card">
<div class="metric-icon">📈</div>
<div class="metric-label">P95 Latency</div>
<div class="metric-value" id="metric-p95">-- ms</div>
<div class="metric-subtext">95th percentile</div>
</div>
<!-- P99 Latency -->
<div class="metric-card">
<div class="metric-icon">⚡</div>
<div class="metric-label">P99 Latency</div>
<div class="metric-value" id="metric-p99">-- ms</div>
<div class="metric-subtext">99th percentile</div>
</div>
<!-- Total Tokens -->
<div class="metric-card">
<div class="metric-icon">💬</div>
<div class="metric-label">Total Tokens</div>
<div class="metric-value" id="benchmark-total-tokens">--</div>
<div class="metric-subtext">Input + Output tokens</div>
</div>
<!-- Success Rate -->
<div class="metric-card">
<div class="metric-icon">✅</div>
<div class="metric-label">Success Rate</div>
<div class="metric-value" id="metric-success-rate">-- %</div>
<div class="metric-subtext">Successful requests</div>
</div>
</div>
<!-- Benchmark Progress -->
<div id="benchmark-progress" class="benchmark-progress" style="display: none;">
<div class="progress-bar">
<div id="progress-fill" class="progress-fill" style="width: 0%"></div>
</div>
<div class="progress-text">
<span id="progress-status">Running benchmark...</span>
<span id="progress-percent">0%</span>
</div>
</div>
</div>
</div>
</section>
</div>
<script src="/static/js/app.js"></script>
</body>
</html>