Release 0.16.0: new look, search, remove files, easier deploy
Release / release (push) Successful in 4m33s
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>
This commit is contained in:
1 parent
c6bcb514e6
commit
5becfc47a0
53 files changed
+1869
-468
No files matched your search
@@ -2,7 +2,7 @@ import { NextResponse } from "next/server";
|
||||
import { z } from "zod";
|
||||
import { withAuth } from "@/lib/api-auth";
|
||||
import { apiError, handleApiError } from "@/lib/api-errors";
|
||||
import { addFilesToModel, ModelError } from "@/lib/models";
|
||||
import { addFilesToModel, ModelError, removeFilesFromModel } from "@/lib/models";
|
||||
|
||||
const Body = z.object({ add: z.array(z.string().min(1).max(1024)).min(1).max(10_000) });
|
||||
|
||||
@@ -17,3 +17,17 @@ export const POST = withAuth<RouteContext<"/api/models/[id]/files">>(async (req,
|
||||
return handleApiError(err);
|
||||
}
|
||||
});
|
||||
|
||||
const RemoveBody = z.object({ remove: z.array(z.string().min(1).max(1024)).min(1).max(10_000) });
|
||||
|
||||
/** Remove files from a model's selection and queue deleting them from disk. */
|
||||
export const DELETE = withAuth<RouteContext<"/api/models/[id]/files">>(async (req, { params }) => {
|
||||
const { id } = await params;
|
||||
try {
|
||||
const { remove } = RemoveBody.parse(await req.json());
|
||||
return NextResponse.json(await removeFilesFromModel(id, remove), { status: 202 });
|
||||
} catch (err) {
|
||||
if (err instanceof ModelError) return apiError(err.status, err.code, err.message);
|
||||
return handleApiError(err);
|
||||
}
|
||||
});
|
||||
@@ -0,0 +1,28 @@
|
||||
import { NextResponse } from "next/server";
|
||||
import { withAuth } from "@/lib/api-auth";
|
||||
import { listBenchmarks } from "@/lib/benchmarks";
|
||||
import { modelName, targetName } from "@/lib/benchmark-view";
|
||||
import { listEndpoints } from "@/lib/endpoints";
|
||||
import { listLibrary } from "@/lib/library";
|
||||
import { listTags } from "@/lib/tags";
|
||||
|
||||
export const dynamic = "force-dynamic";
|
||||
|
||||
/** Everything the ⌘K palette can jump to, compact (it filters in the browser). */
|
||||
export const GET = withAuth(async () => {
|
||||
const [models, endpoints, runs, tags] = await Promise.all([listLibrary(), listEndpoints(), listBenchmarks(), listTags()]);
|
||||
return NextResponse.json({
|
||||
models: models.map((m) => ({ id: m.id, repoId: m.repoId, quants: m.quants, status: m.status, tags: m.tags.map((t) => t.name) })),
|
||||
endpoints: endpoints.map((e) => ({ id: e.id, name: e.name, model: e.model, engine: e.engine ?? e.probe?.engine ?? null })),
|
||||
benchmarks: runs.slice(0, 300).map((r) => ({
|
||||
id: r.id,
|
||||
label: r.label,
|
||||
kind: r.kind,
|
||||
state: r.state,
|
||||
target: targetName(r.snapshot),
|
||||
model: modelName(r.snapshot),
|
||||
createdAt: r.createdAt.getTime(),
|
||||
})),
|
||||
tags: tags.map((t) => t.name),
|
||||
});
|
||||
});
|
||||
Reference in new issue
Block a user