- 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>
15 lines
566 B
TypeScript
15 lines
566 B
TypeScript
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);
|
|
}
|
|
});
|