Skip to content

Commit 99709dd

Browse files
committed
Add model info to eval runs table
1 parent 079b37a commit 99709dd

File tree

6 files changed

+491
-15
lines changed

6 files changed

+491
-15
lines changed

apps/web-roo-code/src/app/evals/evals.tsx

Lines changed: 18 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -38,14 +38,20 @@ export function Evals({
3838

3939
const tableData = useMemo(
4040
() =>
41-
runs.map((run) => ({
42-
...run,
43-
label: run.description || run.model,
44-
score: run.score,
45-
cost: run.taskMetrics.cost,
46-
model: openRouterModels?.[run.modelId ?? ""],
47-
modelInfo: openRouterModels?.[run.modelId ?? ""]?.modelInfo,
48-
})),
41+
runs.map((run) => {
42+
const openRouterModelInfo = openRouterModels?.[run.modelId ?? ""]?.modelInfo
43+
44+
return {
45+
...run,
46+
label: run.name || run.description || run.model,
47+
score: run.score,
48+
cost: run.taskMetrics.cost,
49+
description: run.description ?? openRouterModelInfo?.description,
50+
contextWindow: run.contextWindow ?? openRouterModelInfo?.contextWindow,
51+
inputPrice: run.inputPrice ?? openRouterModelInfo?.inputPrice,
52+
outputPrice: run.outputPrice ?? openRouterModelInfo?.outputPrice,
53+
}
54+
}),
4955
[runs, openRouterModels],
5056
)
5157

@@ -127,17 +133,15 @@ export function Evals({
127133
<TableBody className="font-mono">
128134
{tableData.map((run) => (
129135
<TableRow key={run.id}>
130-
<TableCell title={run.model?.description}>
136+
<TableCell title={run.description}>
131137
<div className="font-sans">{run.label}</div>
132-
<div className="text-xs opacity-50">
133-
{formatTokens(run.modelInfo?.contextWindow ?? 0)}
134-
</div>
138+
<div className="text-xs opacity-50">{formatTokens(run.contextWindow ?? 0)}</div>
135139
</TableCell>
136140
<TableCell className="border-r">
137141
<div className="flex flex-row gap-2">
138-
<div>{formatCurrency(run.modelInfo?.inputPrice ?? 0)}</div>
142+
<div>{formatCurrency(run.inputPrice ?? 0)}</div>
139143
<div className="opacity-25">/</div>
140-
<div>{formatCurrency(run.modelInfo?.outputPrice ?? 0)}</div>
144+
<div>{formatCurrency(run.outputPrice ?? 0)}</div>
141145
</div>
142146
</TableCell>
143147
<TableCell className="font-mono">{formatDuration(run.taskMetrics.duration)}</TableCell>

apps/web-roo-code/src/lib/hooks/use-open-router-models.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ export const getOpenRouterModels = async (): Promise<OpenRouterModelRecord> => {
4949

5050
return result.data.data
5151
.filter((rawModel) => {
52-
// Skip image generation models (models that output images)
52+
// Skip image generation models (models that output images).
5353
return !rawModel.architecture?.output_modalities?.includes("image")
5454
})
5555
.sort((a, b) => a.name.localeCompare(b.name))
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
ALTER TABLE "runs" ADD COLUMN "name" text;--> statement-breakpoint
2+
ALTER TABLE "runs" ADD COLUMN "contextWindow" integer;--> statement-breakpoint
3+
ALTER TABLE "runs" ADD COLUMN "inputPrice" real;--> statement-breakpoint
4+
ALTER TABLE "runs" ADD COLUMN "outputPrice" real;--> statement-breakpoint
5+
ALTER TABLE "runs" ADD COLUMN "cacheWritesPrice" real;--> statement-breakpoint
6+
ALTER TABLE "runs" ADD COLUMN "cacheReadsPrice" real;

0 commit comments

Comments
 (0)