- Rename the app to Kaname - Hub metadata per model (base models, architecture, license, Hub tags), backfilled by the worker for existing models - Library search across repo/author/family/quant/tags and multi-select facet filters (author, family, quant, tag, status) kept in the URL - Custom tags (model page editor, on add, click-to-filter) - README rewritten around a quick install, with banner and screenshots - deploy/compose.yaml: models in a host folder (KANAME_MODELS_DIR) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
2167ea0950
commit
67191b3e16
37 files changed
+2028
-206
No files matched your search
@@ -0,0 +1,10 @@
|
||||
import { NextResponse } from "next/server";
|
||||
import { withAuth } from "@/lib/api-auth";
|
||||
import { removeTag } from "@/lib/tags";
|
||||
|
||||
/** Detach a tag from a model. */
|
||||
export const DELETE = withAuth<RouteContext<"/api/models/[id]/tags/[tagId]">>(async (_req, { params }) => {
|
||||
const { id, tagId } = await params;
|
||||
await removeTag(id, tagId);
|
||||
return new NextResponse(null, { status: 204 });
|
||||
});
|
||||
@@ -0,0 +1,19 @@
|
||||
import { NextResponse } from "next/server";
|
||||
import { z } from "zod";
|
||||
import { withAuth } from "@/lib/api-auth";
|
||||
import { apiError, handleApiError } from "@/lib/api-errors";
|
||||
import { addTag, TagError } from "@/lib/tags";
|
||||
|
||||
const Body = z.object({ name: z.string() });
|
||||
|
||||
/** Attach a tag to a model (creates the tag on first use). */
|
||||
export const POST = withAuth<RouteContext<"/api/models/[id]/tags">>(async (req, { params }) => {
|
||||
const { id } = await params;
|
||||
try {
|
||||
const { name } = Body.parse(await req.json());
|
||||
return NextResponse.json(await addTag(id, name), { status: 201 });
|
||||
} catch (err) {
|
||||
if (err instanceof TagError) return apiError(err.status, err.code, err.message);
|
||||
return handleApiError(err);
|
||||
}
|
||||
});
|
||||
Reference in new issue
Block a user