Benchmarks: lean list queries
listBenchmarks() selected every column of every run, including the raw A/B series, all quality eval items, hardware facts and descriptions, while lists show only the snapshot, settings, headline numbers and the quality score. With 200 runs /api/benchmarks returned 732 KB, re-fetched every 3 s while a run was active; the table used about 55 KB of it. - listBenchmarks() returns lean rows: the headline numbers are computed on the server from the summary, the quality score comes from json_extract(). - The model page asks for 5 runs (it shows 5), the ⌘K index for 300. - getBenchmark()/getBenchmarks() keep the full rows for detail and compare; cancel and delete only read the state. - ListRow (lists) and RunRow (detail) are separate types. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01EooZ9biu7kFNB4eDJrwQc5
This commit is contained in:
10 files changed
+111
-34
No files matched your search
@@ -10,11 +10,11 @@ export const dynamic = "force-dynamic";
|
||||
|
||||
/** Everything the ⌘K palette can jump to, compact (it filters in the browser). */
|
||||
export const GET = withAuth(async () => {
|
||||
const [models, endpoints, runs, tags] = await Promise.all([listLibrary(), listEndpoints(), listBenchmarks(), listTags()]);
|
||||
const [models, endpoints, runs, tags] = await Promise.all([listLibrary(), listEndpoints(), listBenchmarks({}, { limit: 300 }), listTags()]);
|
||||
return NextResponse.json({
|
||||
models: models.map((m) => ({ id: m.id, repoId: m.repoId, quants: m.quants, status: m.status, tags: m.tags.map((t) => t.name) })),
|
||||
endpoints: endpoints.map((e) => ({ id: e.id, name: e.name, model: e.model, engine: e.engine ?? e.probe?.engine ?? null })),
|
||||
benchmarks: runs.slice(0, 300).map((r) => ({
|
||||
benchmarks: runs.map((r) => ({
|
||||
id: r.id,
|
||||
label: r.label,
|
||||
kind: r.kind,
|
||||
|
||||
Reference in new issue
Block a user