-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtemplate.html
650 lines (605 loc) · 25.8 KB
/
template.html
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
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="DeepSeek API Arena - 全面的 LLM API 性能基准测试平台。比较不同供应商的 DeepSeek 模型性能,包括火山方舟、硅基流动、深度求索、阿里百炼和腾讯 LKE 等。提供 TTFT、TBT 和吞吐量等关键指标对比。">
<meta name="keywords" content="DeepSeek, API基准测试, LLM性能, TTFT, TBT, 吞吐量, 火山方舟, 硅基流动, 深度求索, 阿里百炼, 腾讯知识引擎, API性能对比">
<meta name="author" content="TensorChord">
<meta name="robots" content="index, follow">
<!-- Open Graph tags -->
<meta property="og:title" content="DeepSeek API Arena - LLM API 性能基准测试平台">
<meta property="og:description" content="比较评估各大供应商 DeepSeek 模型API性能的基准测试平台,提供实时性能数据分析。">
<meta property="og:type" content="website">
<meta property="og:url" content="https://tensorchord.github.io/deepseek-api-arena/">
<meta property="og:image" content="https://tensorchord.github.io/deepseek-api-arena/preview.png">
<meta property="og:site_name" content="DeepSeek API Arena">
<!-- Twitter Card tags -->
<meta name="twitter:card" content="summary_large_image">
<meta name="twitter:site" content="@tensorchord">
<meta name="twitter:title" content="DeepSeek API Arena - LLM API 性能基准测试平台">
<meta name="twitter:description" content="比较评估各大供应商 DeepSeek 模型API性能的基准测试平台,提供实时性能数据分析。">
<meta name="twitter:image" content="https://tensorchord.github.io/deepseek-api-arena/preview.png">
<!-- Schema.org markup -->
<script type="application/ld+json">
{
"@context": "https://schema.org",
"@type": "WebApplication",
"name": "DeepSeek API Arena",
"description": "LLM API性能基准测试平台,提供各大供应商DeepSeek模型的性能对比数据",
"url": "https://tensorchord.github.io/deepseek-api-arena/",
"provider": {
"@type": "Organization",
"name": "TensorChord",
"url": "https://github.com/tensorchord"
},
"applicationCategory": "Benchmark Tool",
"offers": {
"@type": "Offer",
"price": "0",
"priceCurrency": "USD"
}
}
</script>
<link rel="canonical" href="https://tensorchord.github.io/deepseek-api-arena/">
<title>DeepSeek API Arena - LLM API 性能基准测试平台 | 多供应商性能对比</title>
<!-- Google tag (gtag.js) -->
<script async src="https://www.googletagmanager.com/gtag/js?id=G-BB749M91RM"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'G-BB749M91RM');
</script>
<!-- Existing scripts and styles -->
<script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
<style>
.chart-container {
width: 800px;
height: 500px; /* Increased default height */
margin: 20px auto;
padding: 10px;
border: 1px solid #eee;
border-radius: 5px;
}
.table-container {
width: 800px;
margin: 20px auto;
padding: 10px;
}
table {
width: 100%;
border-collapse: collapse;
margin-bottom: 20px;
}
th, td {
padding: 12px;
text-align: left;
border-bottom: 1px solid #ddd;
}
th {
background-color: #f5f5f5;
cursor: pointer;
user-select: none;
}
th:hover {
background-color: #e8e8e8;
}
th::after {
content: '';
float: right;
margin-top: 7px;
border-width: 4px;
border-style: solid;
border-color: transparent;
visibility: hidden;
}
th.asc::after {
border-bottom-color: #666;
visibility: visible;
}
th.desc::after {
border-top-color: #666;
visibility: visible;
margin-top: 3px;
}
tr:hover {
background-color: #f9f9f9;
}
h1, h2 {
text-align: center;
color: #333;
margin-bottom: 30px;
}
.metrics-info {
width: 800px;
margin: 20px auto;
padding: 20px;
background-color: #f8f9fa;
border-radius: 8px;
box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}
.metric-item {
margin-bottom: 20px;
}
.metric-title {
font-weight: bold;
color: #333;
margin-bottom: 8px;
}
.metric-desc {
color: #555;
line-height: 1.5;
}
.github-link {
position: absolute;
top: 20px;
right: 20px;
display: flex;
align-items: center;
text-decoration: none;
color: #333;
font-size: 16px;
gap: 8px;
}
.github-link:hover {
color: #666;
}
.github-icon {
width: 24px;
height: 24px;
}
.header {
background-color: #fff;
box-shadow: 0 1px 3px rgba(0,0,0,0.1);
padding: 1rem;
position: fixed;
top: 0;
left: 0;
right: 0;
z-index: 1000;
}
.header-content {
max-width: 1200px;
margin: 0 auto;
display: flex;
justify-content: space-between;
align-items: center;
}
.social-links {
display: flex;
gap: 20px;
align-items: center;
}
.social-links a {
color: #333;
text-decoration: none;
display: flex;
align-items: center;
gap: 5px;
}
.social-links a:hover {
color: #666;
}
.footer {
background-color: #f8f9fa;
padding: 2rem;
margin-top: 3rem;
text-align: center;
}
.footer-logo {
height: 32px;
margin-bottom: 1rem;
display: block;
margin-left: auto;
margin-right: auto;
}
.footer-links {
margin-top: 1rem;
display: flex;
justify-content: center;
gap: 20px;
}
body {
padding-top: 60px; /* Add space for fixed header */
}
/* Mobile responsive styles */
@media (max-width: 868px) {
.chart-container, .table-container, .metrics-info {
width: 95%;
margin: 10px auto;
padding: 5px;
}
table {
font-size: 14px;
}
th, td {
padding: 8px 4px;
}
.header-content {
padding: 0 10px;
}
.social-links {
gap: 10px;
}
h1 {
font-size: 24px;
margin: 20px 0;
}
h2 {
font-size: 20px;
margin: 15px 0;
}
.metric-desc {
font-size: 14px;
}
.footer {
padding: 1rem;
}
.footer-links {
flex-direction: column;
gap: 10px;
}
table {
display: block;
overflow-x: auto;
white-space: nowrap;
}
/* Hide long Chinese names on mobile */
td:first-child {
max-width: 150px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.chart-container {
width: 95%;
height: 400px; /* Increased height for mobile */
margin: 15px auto;
padding: 10px 0;
}
canvas {
width: 100% !important;
height: 400px !important; /* Set fixed height for canvas */
min-height: 400px !important; /* Ensure minimum height */
}
th[data-sort="throughput"] {
white-space: normal;
line-height: 1.2;
}
th, td {
padding: 8px 2px; /* Reduced padding for more compact layout */
font-size: 12px; /* Smaller font size to fit more columns */
}
/* Adjust column widths for mobile */
td:first-child {
max-width: 120px; /* Reduced width for provider column */
}
}
.cached-price {
font-size: 0.85em;
color: #666;
margin-top: 4px;
display: block;
}
/* Update best-metric class to only use bold */
.best-metric {
font-weight: 900;
}
</style>
</head>
<body itemscope itemtype="https://schema.org/WebPage">
<header class="header">
<div class="header-content">
<h3 style="margin: 0;">DeepSeek API Arena</h3>
<div class="social-links">
<a href="https://github.com/tensorchord/deepseek-api-arena" target="_blank">
<svg height="20" width="20" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 98 96"><path fill="currentColor" fill-rule="evenodd" clip-rule="evenodd" d="M48.854 0C21.839 0 0 22 0 49.217c0 21.756 13.993 40.172 33.405 46.69 2.427.49 3.316-1.059 3.316-2.362 0-1.141-.08-5.052-.08-9.127-13.59 2.934-16.42-5.867-16.42-5.867-2.184-5.704-5.42-7.17-5.42-7.17-4.448-3.015.324-3.015.324-3.015 4.934.326 7.523 5.052 7.523 5.052 4.367 7.496 11.404 5.378 14.235 4.074.404-3.178 1.699-5.378 3.074-6.6-10.839-1.141-22.243-5.378-22.243-24.283 0-5.378 1.94-9.778 5.014-13.2-.485-1.222-2.184-6.275.486-13.038 0 0 4.125-1.304 13.426 5.052a46.97 46.97 0 0 1 12.214-1.63c4.125 0 8.33.571 12.213 1.63 9.302-6.356 13.427-5.052 13.427-5.052 2.67 6.763.97 11.816.485 13.038 3.155 3.422 5.015 7.822 5.015 13.2 0 18.905-11.404 23.06-22.324 24.283 1.78 1.548 3.316 4.481 3.316 9.126 0 6.6-.08 11.897-.08 13.526 0 1.304.89 2.853 3.316 2.364 19.412-6.52 33.405-24.935 33.405-46.691C97.707 22 75.788 0 48.854 0z"/></svg>
GitHub
</a>
<a href="https://twitter.com/tensorchord" target="_blank">
<svg height="20" width="20" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="currentColor" d="M18.244 2.25h3.308l-7.227 8.26 8.502 11.24H16.17l-5.214-6.817L4.99 21.75H1.68l7.73-8.835L1.254 2.25H8.08l4.713 6.231zm-1.161 17.52h1.833L7.084 4.126H5.117z"/></svg>
Twitter
</a>
</div>
</div>
</header>
<main>
<article itemscope itemtype="https://schema.org/TechArticle">
<div class="metrics-info">
<h1 itemprop="headline">DeepSeek API Arena</h1>
<div class="metric-desc" itemprop="description">
这是一个用于测试不同供应商 DeepSeek R1 模型推理性能的 benchmark。用于比较和评估不同供应商部署的 DeepSeek R1 模型的推理能力和效率。
</div>
</div>
<div class="metrics-info">
<h2>性能指标说明</h2>
<div class="metric-item">
<div class="metric-title">TTFT (Time To First Token)</div>
<div class="metric-desc">该指标显示了用户在看到模型输出之前需要等待的时间。这是从提交查询到接收到第一个 token(如果响应不为空)所花费的时间。TTFT 越小,用户等待时间越短,体验越好。</div>
</div>
<div class="metric-item">
<div class="metric-title">TBT(Time Between Tokens)</div>
<div class="metric-desc">该指标表示生成相邻 token 之间的平均时间间隔。反映了模型生成文本的连续性和流畅度,数值越低表示生成速度越快,用户获得完整回复的时间越短。</div>
</div>
<div class="metric-item">
<div class="metric-title">Throughput (吞吐量)</div>
<div class="metric-desc">基于 TBT 计算的每秒生成 token 数量(1/TBT)。这个指标直观地反映了模型的实际生成效率,数值越高表示生成速度越快,单个用户每秒能产生更多的文本内容。</div>
</div>
</div>
<div class="table-container">
<h2>最新数据 ({{ data.dates[-1] }})</h2>
<table id="resultsTable">
<thead>
<tr>
<th data-sort="provider">供应商</th>
<th data-sort="input_price" title="每百万输入 token 的价格">输入<br>(1M tokens)</th>
<th data-sort="output_price" title="每百万输出 token 的价格">输出<br>(1M tokens)</th>
<th data-sort="ttft" title="从提交查询到接收到第一个 token 的时间">TTFT (s)</th>
<th data-sort="tbt" title="生成相邻 token 之间的平均时间">TBT (ms)</th>
<th data-sort="throughput" title="每秒生成的 token 数 (1000/TBT)">吞吐<br>(tokens/s)</th>
</tr>
</thead>
<tbody>
{% set min_ttft = namespace(value=100000) %}
{% set min_tbt = namespace(value=100000) %}
{% set max_throughput = namespace(value=0) %}
{% for provider in data.providers %}
{% if data.ttft[provider][-1] < min_ttft.value %}
{% set min_ttft.value = data.ttft[provider][-1] %}
{% endif %}
{% if data.tbt[provider][-1] < min_tbt.value %}
{% set min_tbt.value = data.tbt[provider][-1] %}
{% endif %}
{% set throughput = 1.0 / data.tbt[provider][-1] if data.tbt[provider][-1] > 0 else 0 %}
{% if throughput > max_throughput.value %}
{% set max_throughput.value = throughput %}
{% endif %}
{% endfor %}
{% for provider in data.providers %}
<tr>
<td>{{ {
'Ark': '火山方舟',
'siliconflow': '硅基流动',
'DeepSeek': '深度求索',
'Bailian': '阿里百炼',
'LKE': '腾讯知识引擎原子能力'
}[provider] }}</td>
<td>¥{{ "%.2f" | format(pricing.input_prices[provider]) }}
{% if provider in pricing.input_cache_prices %}
<span class="cached-price">(¥{{ "%.2f" | format(pricing.input_cache_prices[provider]) }} cached)</span>
{% endif %}
</td>
<td>¥{{ "%.2f" | format(pricing.output_prices[provider]) }}</td>
<td>
{% if data.ttft[provider][-1] > 0 %}
<span {% if data.ttft[provider][-1] == min_ttft.value %}class="best-metric"{% endif %}>
{{ "%.2f" | format(data.ttft[provider][-1]) }}
</span>
{% else %}
N/A
{% endif %}
</td>
<td>
{% if data.tbt[provider][-1] > 0 %}
<span {% if data.tbt[provider][-1] == min_tbt.value %}class="best-metric"{% endif %}>
{{ "%.2f" | format(data.tbt[provider][-1] * 1000) }}
</span>
{% else %}
N/A
{% endif %}
</td>
<td>
{% if data.tbt[provider][-1] > 0 %}
<span {% if (1.0 / data.tbt[provider][-1]) == max_throughput.value %}class="best-metric"{% endif %}>
{{ "%.2f" | format(1.0 / data.tbt[provider][-1]) }}
</span>
{% else %}
N/A
{% endif %}
</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
<div class="chart-container">
<canvas id="ttftChart"></canvas>
</div>
<div class="chart-container">
<canvas id="tbtChart"></canvas>
</div>
<div class="chart-container">
<canvas id="qpsChart"></canvas>
</div>
</article>
</main>
<script>
const data = {{ data | tojson }};
const providerNames = {
'Ark': 'Ark (火山方舟)',
'siliconflow': 'siliconflow (硅基流动)',
'DeepSeek': 'DeepSeek (深度求索)',
'Bailian': 'Bailian (阿里百炼)',
'LKE': 'LKE (腾讯知识引擎原子能力)'
};
// Calculate Throughput from TBT
const throughputData = {};
for (const provider of data.providers) {
throughputData[provider] = data.tbt[provider].map((tbt, idx) => ({
x: data.dates[idx],
y: tbt > 0 ? (1.0 / tbt) : null
}));
}
function createChart(ctx, label, dataKey, yAxisLabel, dataSource) {
const sourceData = dataSource || data[dataKey];
const datasets = data.providers.map(provider => {
let chartData;
if (dataKey === 'throughput') {
chartData = sourceData[provider];
} else if (dataKey === 'tbt') {
// Convert TBT to milliseconds for chart
chartData = sourceData[provider].map((val, idx) => ({
x: data.dates[idx],
y: val > 0 ? val * 1000 : null
}));
} else {
chartData = sourceData[provider].map((val, idx) => ({
x: data.dates[idx],
y: val > 0 ? val : null
}));
}
return {
label: providerNames[provider] || provider,
data: chartData,
fill: false,
tension: 0.1,
borderWidth: 2
};
});
return new Chart(ctx, {
type: 'line',
data: {
datasets: datasets
},
options: {
responsive: true,
maintainAspectRatio: false,
plugins: {
title: {
display: true,
text: label,
font: {
size: 16
}
},
legend: {
position: 'bottom',
labels: {
boxWidth: 12,
padding: 10,
font: {
size: window.innerWidth < 868 ? 10 : 12
}
}
}
},
scales: {
y: {
title: {
display: true,
text: yAxisLabel,
font: {
size: window.innerWidth < 868 ? 10 : 12
}
},
beginAtZero: true,
ticks: {
font: {
size: window.innerWidth < 868 ? 10 : 12
}
}
},
x: {
type: 'category',
title: {
display: true,
text: 'Date',
font: {
size: window.innerWidth < 868 ? 10 : 12
}
},
ticks: {
maxRotation: 45,
minRotation: 45,
font: {
size: window.innerWidth < 868 ? 10 : 12
}
}
}
}
}
});
}
createChart(
document.getElementById('ttftChart'),
'Time To First Token (TTFT)',
'ttft',
'Seconds'
);
createChart(
document.getElementById('tbtChart'),
'Token Between Time (TBT)',
'tbt',
'Milliseconds'
);
createChart(
document.getElementById('qpsChart'),
'Throughput',
'throughput',
'Tokens/Second',
throughputData
);
// Function to sort table
function sortTable(headerCell, initialSort = false) {
const table = headerCell.closest('table');
const tbody = table.querySelector('tbody');
const rows = Array.from(tbody.querySelectorAll('tr'));
const sortColumn = headerCell.dataset.sort;
const currentIsAsc = headerCell.classList.contains('asc');
// Remove existing sort classes
table.querySelectorAll('th').forEach(th => {
th.classList.remove('asc', 'desc');
});
// Add new sort class
headerCell.classList.add(initialSort ? 'asc' : (currentIsAsc ? 'desc' : 'asc'));
// Sort rows
const sortedRows = rows.sort((a, b) => {
const aCol = a.querySelector(`td:nth-child(${headerCell.cellIndex + 1})`);
const bCol = b.querySelector(`td:nth-child(${headerCell.cellIndex + 1})`);
let aValue, bValue;
if (sortColumn === 'provider') {
aValue = aCol.textContent.trim();
bValue = bCol.textContent.trim();
return initialSort || !currentIsAsc ?
aValue.localeCompare(bValue) :
bValue.localeCompare(aValue);
} else {
aValue = parseFloat(aCol.textContent);
bValue = parseFloat(bCol.textContent);
return initialSort || !currentIsAsc ? aValue - bValue : bValue - aValue;
}
});
// Clear and re-add sorted rows
tbody.innerHTML = '';
sortedRows.forEach(row => tbody.appendChild(row));
}
// Add table sorting functionality
document.querySelectorAll('#resultsTable th').forEach(headerCell => {
headerCell.addEventListener('click', () => sortTable(headerCell));
});
// Sort by TTFT by default on page load
window.addEventListener('load', () => {
const ttftHeader = document.querySelector('#resultsTable th[data-sort="ttft"]');
if (ttftHeader) {
sortTable(ttftHeader, true);
}
});
</script>
<footer class="footer">
<div style="margin-bottom: 1rem;">
Crafted with ❤️ by <a href="https://github.com/tensorchord" target="_blank" style="color: #333; text-decoration: none;">TensorChord</a>
</div>
<div class="footer-links">
<a href="https://github.com/tensorchord/vectorchord" target="_blank" style="display: flex; align-items: center; gap: 4px;">
<!-- svg from vectorchord.svg -->
<img src="vectorchord.svg" height="20"/>
</a>
<a href="https://twitter.com/tensorchord" target="_blank" style="display: flex; align-items: center; gap: 4px;">
<svg height="16" width="16" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="currentColor" d="M18.244 2.25h3.308l-7.227 8.26 8.502 11.24H16.17l-5.214-6.817L4.99 21.75H1.68l7.73-8.835L1.254 2.25H8.08l4.713 6.231zm-1.161 17.52h1.833L7.084 4.126H5.117z"/></svg>
Twitter
</a>
</div>
</footer>
</body>
</html>