Release / release (push) Successful in 4m33s
- Dot-matrix "Creation of Adam" page banners behind a floating menu, glass cards and tables, library header with live stats, table toolbar with pagination, Cmd/Ctrl+K search across models, endpoints, runs, tags, settings and actions. - Remove single files from a model (selection + disk, via a worker job). - Containers start as root to prepare folders and drop to PUID:PGID; AUTH_SECRET is generated when unset; sandbox runs as nobody; KANAME_IMAGE and image docs in the README. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
57 lines
2.7 KiB
TypeScript
57 lines
2.7 KiB
TypeScript
import type { Metadata } from "next";
|
|
import { notFound } from "next/navigation";
|
|
import { RunMetaCard } from "@/components/run-meta";
|
|
import { endpointRunMeta, endpointSystem } from "@/lib/benchmark-meta";
|
|
import { kanameVersion } from "@/lib/benchmark-snapshot";
|
|
import { listBenchmarks } from "@/lib/benchmarks";
|
|
import { getEndpoint, listEndpoints } from "@/lib/endpoints";
|
|
import { BenchmarkList } from "../../benchmarks/benchmark-list";
|
|
import { BenchmarkStart } from "./benchmark-start";
|
|
import { EndpointHeader } from "./endpoint-header";
|
|
|
|
export const dynamic = "force-dynamic";
|
|
|
|
export async function generateMetadata({ params }: PageProps<"/endpoints/[id]">): Promise<Metadata> {
|
|
const e = await getEndpoint((await params).id);
|
|
return { title: e ? `${e.name} · Endpoint` : "Endpoint" };
|
|
}
|
|
|
|
export default async function EndpointPage({ params }: PageProps<"/endpoints/[id]">) {
|
|
const { id } = await params;
|
|
const endpoint = await getEndpoint(id);
|
|
if (!endpoint) notFound();
|
|
const [runs, all] = await Promise.all([listBenchmarks({ endpointId: id }), listEndpoints()]);
|
|
const model = endpoint.model ?? (endpoint.probe?.models.length === 1 ? endpoint.probe.models[0] : null);
|
|
// What a run would record now (the worker asks the server again when it starts).
|
|
const preview = endpointRunMeta({
|
|
type: "endpoint",
|
|
endpointName: endpoint.name,
|
|
model: model ?? "(model)",
|
|
engine: endpoint.engine ?? endpoint.probe?.engine ?? null,
|
|
engineVersion: endpoint.probe?.engineVersion ?? null,
|
|
contextSize: endpoint.probe?.contextSize ?? null,
|
|
slots: endpoint.probe?.slots ?? null,
|
|
hardware: endpoint.hardware,
|
|
});
|
|
|
|
return (
|
|
<EndpointHeader endpoint={endpoint} runCount={runs.length}>
|
|
<div className="grid items-start gap-4 lg:grid-cols-[minmax(0,1fr)_360px]">
|
|
<div className="flex min-w-0 flex-col gap-4">
|
|
<BenchmarkStart
|
|
endpoint={{ id: endpoint.id, name: endpoint.name, model, models: endpoint.probe?.models ?? [] }}
|
|
peers={all.filter((e) => e.id !== id).map((e) => ({ id: e.id, name: e.name, models: e.probe?.models ?? [], model: e.model }))}
|
|
/>
|
|
<BenchmarkList rows={JSON.parse(JSON.stringify(runs))} filter={{ endpoint: id }} />
|
|
</div>
|
|
<aside className="flex flex-col gap-4">
|
|
<RunMetaCard meta={preview} system={endpointSystem(endpoint.hardware, kanameVersion())} />
|
|
{endpoint.hardware.description && (
|
|
<p className="rounded-xl bg-card/55 px-4 py-3 text-xs backdrop-blur-md whitespace-pre-wrap text-muted-foreground ring-1 ring-foreground/10">{endpoint.hardware.description}</p>
|
|
)}
|
|
</aside>
|
|
</div>
|
|
</EndpointHeader>
|
|
);
|
|
}
|