Benchmarks: paired A/B runs, sweeps, resource usage
- A/B with betterbench ab between two deployments of the same model, with verdict, confidence interval and caveats. - Sweeps vary one or two deployment settings, deploy, benchmark and remove each variant, and compare them in one table. - Every run records CPU, RAM, VRAM, GPU utilization and power. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
9e167a44f6
commit
b623b16a6d
37 files changed
+4314
-214
No files matched your search
@@ -0,0 +1,14 @@
|
||||
import { NextResponse } from "next/server";
|
||||
import { withAuth } from "@/lib/api-auth";
|
||||
import { apiError, handleApiError } from "@/lib/api-errors";
|
||||
import { cancelSweep, SweepRequestError } from "@/lib/sweeps";
|
||||
|
||||
export const POST = withAuth<RouteContext<"/api/sweeps/[id]/cancel">>(async (_req, { params }) => {
|
||||
try {
|
||||
await cancelSweep((await params).id);
|
||||
return new NextResponse(null, { status: 202 });
|
||||
} catch (err) {
|
||||
if (err instanceof SweepRequestError) return apiError(err.status, err.code, err.message);
|
||||
return handleApiError(err);
|
||||
}
|
||||
});
|
||||
@@ -0,0 +1,21 @@
|
||||
import { NextResponse } from "next/server";
|
||||
import { withAuth } from "@/lib/api-auth";
|
||||
import { apiError, handleApiError } from "@/lib/api-errors";
|
||||
import { deleteSweep, getSweep, SweepRequestError } from "@/lib/sweeps";
|
||||
|
||||
export const dynamic = "force-dynamic";
|
||||
|
||||
export const GET = withAuth<RouteContext<"/api/sweeps/[id]">>(async (_req, { params }) => {
|
||||
const s = await getSweep((await params).id);
|
||||
return s ? NextResponse.json(s) : apiError(404, "not_found", "Sweep not found.");
|
||||
});
|
||||
|
||||
export const DELETE = withAuth<RouteContext<"/api/sweeps/[id]">>(async (_req, { params }) => {
|
||||
try {
|
||||
await deleteSweep((await params).id);
|
||||
return new NextResponse(null, { status: 204 });
|
||||
} catch (err) {
|
||||
if (err instanceof SweepRequestError) return apiError(err.status, err.code, err.message);
|
||||
return handleApiError(err);
|
||||
}
|
||||
});
|
||||
@@ -0,0 +1,18 @@
|
||||
import { NextResponse } from "next/server";
|
||||
import { withAuth } from "@/lib/api-auth";
|
||||
import { apiError, handleApiError } from "@/lib/api-errors";
|
||||
import { createSweep, listSweeps, SweepBody, SweepRequestError } from "@/lib/sweeps";
|
||||
|
||||
export const dynamic = "force-dynamic";
|
||||
|
||||
export const GET = withAuth(async () => NextResponse.json(await listSweeps()));
|
||||
|
||||
/** Queue a sweep: one or two settings varied over a base deployment, one benchmark per variant. */
|
||||
export const POST = withAuth(async (req) => {
|
||||
try {
|
||||
return NextResponse.json(await createSweep(SweepBody.parse(await req.json())), { status: 201 });
|
||||
} catch (err) {
|
||||
if (err instanceof SweepRequestError) return apiError(err.status, err.code, err.message);
|
||||
return handleApiError(err);
|
||||
}
|
||||
});
|
||||
Reference in new issue
Block a user