-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This needs to be updated once we have data for multiple days.
- Loading branch information
Showing
10 changed files
with
271 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
--- | ||
import Section from './Section.astro'; | ||
import { ModelDefinition, RegionDefinition, TTRDefinition, TTFTDefinition, TPSDefinition, TokensDefinition, TotalTimeDefinition } from '@/utils/DataGridDefinitions'; | ||
--- | ||
|
||
<Section> | ||
<div class="text-sm"> | ||
<p class="text-xl font-bold">Definitions</p> | ||
<br /> | ||
<ul class="list-none"> | ||
<li class="pb-2"><b>{ ModelDefinition.title } → </b>{ ModelDefinition.definition }</li> | ||
<li class="pb-2"><b>{ RegionDefinition.title } → </b>{ RegionDefinition.definition }</li> | ||
<li class="pb-2"><b>{ TTRDefinition.title } → </b>{ TTRDefinition.definition }</li> | ||
<li class="pb-2"><b>{ TTFTDefinition.title } → </b>{ TTFTDefinition.definition }</li> | ||
<li class="pb-2"><b>{ TPSDefinition.title } → </b>{ TPSDefinition.definition }</li> | ||
<li class="pb-2"><b>{ TokensDefinition.title } → </b>{ TokensDefinition.definition }</li> | ||
<li class="pb-2"><b>{ TotalTimeDefinition.title } → </b>{ TotalTimeDefinition.definition }</li> | ||
</ul> | ||
</div> | ||
</Section> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
--- | ||
// Import the necessary CSS for AG Grid | ||
import 'ag-grid-community/styles/ag-grid.css'; | ||
import 'ag-grid-community/styles/ag-theme-quartz.css'; | ||
--- | ||
<style> | ||
.ag-theme-quartz { | ||
font-family: monospace; | ||
} | ||
</style> | ||
<div id="myGrid" class="ag-theme-quartz text-sm bg-stone-100 font-mono text-gray-950 dark:bg-stone-900 dark:text-white " style="height: 800px; width: 1000px;"></div> | ||
|
||
<script> | ||
import { createGrid } from 'ag-grid-community'; | ||
import { gridOptions } from '@/utils/DataGridDefinitions.ts'; | ||
|
||
let gridApi; | ||
|
||
// URLs of our JSON data | ||
const urls = [ | ||
'https://storage.googleapis.com/thefastest-data/cdg/text/2024-04-13.json', | ||
'https://storage.googleapis.com/thefastest-data/iad/text/2024-04-13.json', | ||
'https://storage.googleapis.com/thefastest-data/sea/text/2024-04-13.json', | ||
]; | ||
|
||
async function fetchBenchmarkData(urls) { | ||
try { | ||
// Fetch all the JSON files concurrently | ||
const fetchPromises = urls.map(url => fetch(url).then(response => response.json())); | ||
const jsonFiles = await Promise.all(fetchPromises); | ||
|
||
// Combine the data from all files | ||
const combinedData = jsonFiles.map(file => { | ||
// Extract date from the time string and ignore the timestamp | ||
const date = file.time.split('T')[0]; | ||
|
||
// Map each result object to a new object that includes the date and region | ||
return file.results.map(result => ({ | ||
date, | ||
region: file.region, | ||
...result | ||
})); | ||
}).flat(); // Flatten the array of arrays into a single array | ||
|
||
return combinedData; | ||
} catch (error) { | ||
console.error('Error combining JSON files:', error); | ||
} | ||
} | ||
|
||
fetchBenchmarkData(urls) | ||
.then(combinedResults => { | ||
console.log('Combined results:', combinedResults); | ||
gridOptions.rowData = combinedResults; | ||
gridApi = createGrid(document.querySelector("#myGrid"), gridOptions); | ||
}) | ||
.catch(error => { | ||
console.error('Error in combining JSON files:', error); | ||
}); | ||
|
||
</script> | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
--- | ||
import Section from './Section.astro'; | ||
--- | ||
|
||
<Section> | ||
<div class="text-sm"> | ||
<p class="text-xl font-bold">How to Use</p> | ||
<br /> | ||
<p>The above table is interactive. You can sort on any column. Further, the hamburger menu (appears when you hover a column header) allows for custom filtering. Have fun exploring!</p> | ||
|
||
</div> | ||
</Section> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,128 @@ | ||
interface ValueFormatterParam { | ||
value: number; | ||
} | ||
|
||
export const ModelDefinition = { | ||
title: "Provider/Model", | ||
definition: "The LLM and host provider used." | ||
}; | ||
|
||
export const RegionDefinition = { | ||
title: "Region", | ||
definition: "The region where the benchmark was run." | ||
}; | ||
|
||
export const TTRDefinition = { | ||
title: "TTR", | ||
definition: "Time to (HTTP) Response. Indicates the overall speed of the serving infrastructure of the provider/model." | ||
}; | ||
|
||
export const TTFTDefinition = { | ||
title: "TTFT", | ||
definition: "Time to First Token. Time to get first text from the model. This translates directly into how quickly the UI starts to update when displaying the response and indicates the overall speed with which the model begins working on the request and processing the input tokens." | ||
}; | ||
|
||
export const TPSDefinition = { | ||
title: "TPS", | ||
definition: "Tokens per Second. This is how quickly text is emitted from the model and translates directly into how quickly the UI finishes displaying the response. It also indicates how quickly the model can produce each output token." | ||
}; | ||
|
||
export const TokensDefinition = { | ||
title: "Num Tokens", | ||
definition: "The total number of output tokens. Longer responses take longer to produce." | ||
}; | ||
|
||
export const TotalTimeDefinition = { | ||
title: "Total Time", | ||
definition: "The total time from the start of the request until the response is complete, i.e., the last token has been generated. Total time = TTFT + TPS * Tokens." | ||
}; | ||
|
||
// Set-up all of our column definitions that will be used in the Data Grid | ||
const headerClass = "font-bold"; | ||
|
||
// Model column | ||
const columnModel = { | ||
field: "model", | ||
headerName: ModelDefinition.title, | ||
headerTooltip: ModelDefinition.definition, | ||
headerClass: headerClass, | ||
minWidth: 400, | ||
tooltipField: "output" | ||
}; | ||
|
||
// Region column | ||
const columnRegion = { | ||
field: "region", | ||
headerName: RegionDefinition.title, | ||
headerTooltip: RegionDefinition.definition, | ||
headerClass: headerClass, | ||
maxWidth: 100 | ||
}; | ||
|
||
// TTR column | ||
const columnTTR = { | ||
field: "ttr", | ||
headerName: TTRDefinition.title, | ||
headerTooltip: TTRDefinition.definition, | ||
headerClass: headerClass, | ||
maxWidth: 90, | ||
valueFormatter: (p: ValueFormatterParam) => p.value.toFixed(2) | ||
}; | ||
|
||
// TTFT column | ||
const columnTTFT = { | ||
field: "ttft", | ||
headerName: TTFTDefinition.title, | ||
headerTooltip: TTFTDefinition.definition, | ||
headerClass: headerClass, | ||
maxWidth: 90, | ||
valueFormatter: (p: ValueFormatterParam) => p.value.toFixed(2) | ||
}; | ||
|
||
// TPS column | ||
const columnTPS = { | ||
field: "tps", | ||
headerName: TPSDefinition.title, | ||
headerTooltip: TPSDefinition.definition, | ||
headerClass: headerClass, | ||
maxWidth: 90, | ||
valueFormatter: (p: ValueFormatterParam) => p.value.toFixed(2) | ||
}; | ||
|
||
// Tokens column | ||
const columnNumTokens = { | ||
field: "num_tokens", | ||
headerName: TokensDefinition.title, | ||
headerTooltip: TokensDefinition.definition, | ||
headerClass: headerClass, | ||
minWidth: 100, | ||
maxWidth: 100, | ||
wrapHeaderText: true | ||
}; | ||
|
||
// Total Time column | ||
const columnTotalTime = { | ||
field: "total_time", | ||
headerName: TotalTimeDefinition.title, | ||
headerTooltip: TotalTimeDefinition.definition, | ||
headerClass: headerClass, | ||
minWidth: 100, | ||
maxWidth: 100, | ||
wrapHeaderText: true, | ||
valueFormatter: (p: ValueFormatterParam) => p.value.toFixed(2) | ||
}; | ||
|
||
export const gridOptions = { | ||
alwaysShowVerticalScroll: true, | ||
autoSizeStrategy: { type: 'fitCellContents' }, | ||
defaultColDef: { | ||
filter: true, | ||
minWidth: 80, | ||
}, | ||
pagination: true, | ||
paginationPageSizeSelector: [50, 150, 500], | ||
paginationPageSize: 150, | ||
rowData: [], | ||
// Columns to be displayed (Should match rowData properties) | ||
columnDefs: [ columnModel, columnRegion, columnTTR, columnTTFT, columnTPS, columnNumTokens, columnTotalTime] | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -968,6 +968,19 @@ acorn@^8.11.2: | |
resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.11.3.tgz#71e0b14e13a4ec160724b38fb7b0f233b1b81d7a" | ||
integrity sha512-Y9rRfJG5jcKOE0CLisYbojUjIrIEE7AGMzA/Sm4BslANhbS+cDMpgBdcPT91oJ7OuJ9hYJBx59RjbhxVnrF8Xg== | ||
|
||
[email protected], ag-grid-community@^31.2.1: | ||
version "31.2.1" | ||
resolved "https://registry.yarnpkg.com/ag-grid-community/-/ag-grid-community-31.2.1.tgz#6031c91baa5caebccfa58a5131efc13339643e50" | ||
integrity sha512-D+gnUQ4dHZ/EQJmupQnDqcEKiCEeuK5ZxlsIpdPKgHg/23dmW+aEdivtB9nLpSc2IEK0RUpchcSxeUT37Boo5A== | ||
|
||
ag-grid-react@^31.2.1: | ||
version "31.2.1" | ||
resolved "https://registry.yarnpkg.com/ag-grid-react/-/ag-grid-react-31.2.1.tgz#21be0703225e4c7ad88b1b6ca13491a6d9a072c1" | ||
integrity sha512-9UH3xxXRwZfW97oz58KboyCJl4t+zdetopieeHVcttsXX1DvGFDUIEz7A1sQaG8e1DAXLMf3IxoIPrfWheH4XA== | ||
dependencies: | ||
ag-grid-community "31.2.1" | ||
prop-types "^15.8.1" | ||
|
||
ansi-align@^3.0.1: | ||
version "3.0.1" | ||
resolved "https://registry.yarnpkg.com/ansi-align/-/ansi-align-3.0.1.tgz#0cdf12e111ace773a86e9a1fad1225c43cb19a59" | ||
|
@@ -2274,7 +2287,7 @@ longest-streak@^3.0.0: | |
resolved "https://registry.yarnpkg.com/longest-streak/-/longest-streak-3.1.0.tgz#62fa67cd958742a1574af9f39866364102d90cd4" | ||
integrity sha512-9Ri+o0JYgehTaVBBDoMqIl8GXtbWg711O3srftcHhZ0dqnETqLaoIK0x17fUw9rFSlK/0NlsKe0Ahhyl5pXE2g== | ||
|
||
loose-envify@^1.1.0: | ||
loose-envify@^1.1.0, loose-envify@^1.4.0: | ||
version "1.4.0" | ||
resolved "https://registry.yarnpkg.com/loose-envify/-/loose-envify-1.4.0.tgz#71ee51fa7be4caec1a63839f7e682d8132d30caf" | ||
integrity sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q== | ||
|
@@ -2861,7 +2874,7 @@ npm-run-path@^5.1.0: | |
dependencies: | ||
path-key "^4.0.0" | ||
|
||
object-assign@^4.0.1: | ||
object-assign@^4.0.1, object-assign@^4.1.1: | ||
version "4.1.1" | ||
resolved "https://registry.yarnpkg.com/object-assign/-/object-assign-4.1.1.tgz#2109adc7965887cfc05cbbd442cac8bfbb360863" | ||
integrity sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg== | ||
|
@@ -3172,6 +3185,15 @@ prompts@^2.4.2: | |
kleur "^3.0.3" | ||
sisteransi "^1.0.5" | ||
|
||
prop-types@^15.8.1: | ||
version "15.8.1" | ||
resolved "https://registry.yarnpkg.com/prop-types/-/prop-types-15.8.1.tgz#67d87bf1a694f48435cf332c24af10214a3140b5" | ||
integrity sha512-oj87CgZICdulUohogVAR7AjlC0327U4el4L6eAvOqCeudMDVU0NThNaV+b9Df4dXgSP1gXMTnPdhfe/2qDH5cg== | ||
dependencies: | ||
loose-envify "^1.4.0" | ||
object-assign "^4.1.1" | ||
react-is "^16.13.1" | ||
|
||
property-information@^6.0.0: | ||
version "6.5.0" | ||
resolved "https://registry.yarnpkg.com/property-information/-/property-information-6.5.0.tgz#6212fbb52ba757e92ef4fb9d657563b933b7ffec" | ||
|
@@ -3213,6 +3235,11 @@ react-dom@^18.2.0: | |
loose-envify "^1.1.0" | ||
scheduler "^0.23.0" | ||
|
||
react-is@^16.13.1: | ||
version "16.13.1" | ||
resolved "https://registry.yarnpkg.com/react-is/-/react-is-16.13.1.tgz#789729a4dc36de2999dc156dd6c1d9c18cea56a4" | ||
integrity sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ== | ||
|
||
react-refresh@^0.14.0: | ||
version "0.14.0" | ||
resolved "https://registry.yarnpkg.com/react-refresh/-/react-refresh-0.14.0.tgz#4e02825378a5f227079554d4284889354e5f553e" | ||
|