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>
96 lines
4.5 KiB
TypeScript
96 lines
4.5 KiB
TypeScript
import { PlusIcon, ServerIcon } from "lucide-react";
|
||
import type { Metadata } from "next";
|
||
import Link from "next/link";
|
||
import { buttonVariants } from "@/components/ui/button";
|
||
import { Card } from "@/components/ui/card";
|
||
import { Table, TableBody, TableCell, TableHead, TableHeader, TableRow } from "@/components/ui/table";
|
||
import { ENGINE_LABEL } from "@/lib/benchmark-meta";
|
||
import { headline } from "@/lib/benchmark-view";
|
||
import { listBenchmarks } from "@/lib/benchmarks";
|
||
import { listEndpoints } from "@/lib/endpoints";
|
||
import { PageHero } from "@/components/hero/page-hero";
|
||
import { EndpointStatus } from "./endpoint-status";
|
||
|
||
export const dynamic = "force-dynamic";
|
||
export const metadata: Metadata = { title: "Endpoints" };
|
||
|
||
export default async function EndpointsPage() {
|
||
const [endpoints, runs] = await Promise.all([listEndpoints(), listBenchmarks()]);
|
||
// Newest completed speed run and quality score per endpoint.
|
||
const latest = new Map<string, { decode: number | null; quality: number | null }>();
|
||
for (const r of runs) {
|
||
if (!r.endpointId || r.state !== "completed") continue;
|
||
const cur = latest.get(r.endpointId) ?? { decode: null, quality: null };
|
||
if (r.kind === "run" && cur.decode == null) cur.decode = headline(r.summary).decode;
|
||
if (r.kind === "eval" && cur.quality == null) cur.quality = r.quality?.score ?? null;
|
||
latest.set(r.endpointId, cur);
|
||
}
|
||
|
||
return (
|
||
<PageHero
|
||
title="Endpoints"
|
||
description="OpenAI-compatible servers to benchmark. They run elsewhere; Kaname only sends them requests."
|
||
painting={{ view: 0.6, focus: [0.75, 0.35], anchor: [0.62, 0.35] }}
|
||
actions={
|
||
<Link href="/endpoints/new" className={buttonVariants()}>
|
||
<PlusIcon />
|
||
Add endpoint
|
||
</Link>
|
||
}
|
||
>
|
||
|
||
{endpoints.length === 0 ? (
|
||
<Card className="items-center gap-3 py-10 text-center">
|
||
<ServerIcon className="size-8 text-muted-foreground" />
|
||
<p className="max-w-md text-sm text-muted-foreground">
|
||
No endpoints yet. Add the URL of a llama.cpp, vLLM, SGLang or Ollama server, describe its hardware, and benchmark it.
|
||
</p>
|
||
</Card>
|
||
) : (
|
||
<Card className="py-0">
|
||
<Table>
|
||
<TableHeader>
|
||
<TableRow>
|
||
<TableHead>Endpoint</TableHead>
|
||
<TableHead className="hidden md:table-cell">Model</TableHead>
|
||
<TableHead className="hidden lg:table-cell">Hardware</TableHead>
|
||
<TableHead className="text-right">Decode t/s</TableHead>
|
||
<TableHead className="hidden text-right sm:table-cell">Quality</TableHead>
|
||
<TableHead className="w-32">Status</TableHead>
|
||
</TableRow>
|
||
</TableHeader>
|
||
<TableBody>
|
||
{endpoints.map((e) => {
|
||
const l = latest.get(e.id);
|
||
const engine = e.hardware.engineName || (e.engine ?? e.probe?.engine ? ENGINE_LABEL[(e.engine ?? e.probe?.engine)!] : null);
|
||
return (
|
||
<TableRow key={e.id}>
|
||
<TableCell className="whitespace-normal">
|
||
<Link href={`/endpoints/${e.id}`} className="font-medium hover:underline">
|
||
{e.name}
|
||
</Link>
|
||
<div className="text-xs text-muted-foreground">
|
||
{e.baseUrl}
|
||
{engine && ` · ${engine}${e.probe?.engineVersion ? ` ${e.probe.engineVersion}` : ""}`}
|
||
</div>
|
||
</TableCell>
|
||
<TableCell className="hidden max-w-64 truncate text-sm md:table-cell">{e.model ?? (e.probe?.models.length === 1 ? e.probe.models[0] : "–")}</TableCell>
|
||
<TableCell className="hidden text-sm text-muted-foreground lg:table-cell">
|
||
{e.hardware.gpuName ? `${e.hardware.gpuCount ?? 1}× ${e.hardware.gpuName}` : (e.hardware.cpu ?? "–")}
|
||
</TableCell>
|
||
<TableCell className="text-right font-medium tabular-nums">{l?.decode != null ? l.decode.toFixed(1) : "–"}</TableCell>
|
||
<TableCell className="hidden text-right tabular-nums sm:table-cell">{l?.quality != null ? `${l.quality}%` : "–"}</TableCell>
|
||
<TableCell>
|
||
<EndpointStatus probe={e.probe} />
|
||
</TableCell>
|
||
</TableRow>
|
||
);
|
||
})}
|
||
</TableBody>
|
||
</Table>
|
||
</Card>
|
||
)}
|
||
</PageHero>
|
||
);
|
||
}
|