- Benchmarks: BetterBench 0.6.1 (pinned by checksum) runs against a running deployment, one at a time; quick/full/custom passes, phase selection, live step and output, cancel, run again, compare runs side by side. - Report page after launch80's bench.betterbench.v1: headline tiles, "Read these first" caveats (quick, sample gate, max_tokens truncation, batched streams, failures, skipped depths, prefix-cache hits), charts, full tables with daggered under-sampled cells, method text. All figures come from BetterBench's own report functions. - Publish to launch80 as a double opt-in: L80 dry run builds the exact payload for inspection, an explicit confirmation publishes that file (L80 CLI 0.4.0 pinned by checksum, L80_TOKEN worker-only). Endpoint and host never leave. - GPUs: runtime accelerator (CPU, NVIDIA, /dev/dri, ROCm) with presets for the official CUDA/Vulkan/Intel/ROCm builds; NVIDIA GPUs probed via nvidia-smi in a short-lived container; per-deployment GPU picking, -ngl, split mode, tensor split, MoE offload, vLLM tensor parallel and GPU memory share. - llama.cpp --cache-ram option (1 GiB for new deployments) and a memory estimate that counts it and the KV cache: the 8 GiB default made containers thrash at their memory limit. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
46 lines
1.9 KiB
TypeScript
46 lines
1.9 KiB
TypeScript
import { NextResponse } from "next/server";
|
|
import { z } from "zod";
|
|
import { withAuth } from "@/lib/api-auth";
|
|
import { apiError, handleApiError } from "@/lib/api-errors";
|
|
import { confirmPublication, discardPublication, PublicationError, readPayloadPreview } from "@/lib/publications";
|
|
|
|
export const dynamic = "force-dynamic";
|
|
|
|
/** What the previewed payload contains (read from the exact file that would be sent). */
|
|
export const GET = withAuth<RouteContext<"/api/benchmarks/[id]/publications/[pubId]">>(async (_req, { params }) => {
|
|
try {
|
|
const { id, pubId } = await params;
|
|
return NextResponse.json({ preview: await readPayloadPreview(id, pubId) });
|
|
} catch (err) {
|
|
if (err instanceof PublicationError) return apiError(err.status, err.code, err.message);
|
|
return handleApiError(err);
|
|
}
|
|
});
|
|
|
|
const Confirm = z.object({ confirm: z.literal(true) });
|
|
|
|
/** Opt-in 2: publish the previewed payload. Requires `{ "confirm": true }`. */
|
|
export const POST = withAuth<RouteContext<"/api/benchmarks/[id]/publications/[pubId]">>(async (req, { params, session }) => {
|
|
try {
|
|
const { id, pubId } = await params;
|
|
Confirm.parse(await req.json());
|
|
await confirmPublication(id, pubId, session.user.email ?? session.user.name ?? null);
|
|
return new NextResponse(null, { status: 202 });
|
|
} catch (err) {
|
|
if (err instanceof PublicationError) return apiError(err.status, err.code, err.message);
|
|
return handleApiError(err);
|
|
}
|
|
});
|
|
|
|
/** Discard a preview. */
|
|
export const DELETE = withAuth<RouteContext<"/api/benchmarks/[id]/publications/[pubId]">>(async (_req, { params }) => {
|
|
try {
|
|
const { id, pubId } = await params;
|
|
await discardPublication(id, pubId);
|
|
return new NextResponse(null, { status: 204 });
|
|
} catch (err) {
|
|
if (err instanceof PublicationError) return apiError(err.status, err.code, err.message);
|
|
return handleApiError(err);
|
|
}
|
|
});
|