Deployments: serve a model with a runtime container

- deployments + deployment_logs tables; desired/actual state reconciled by
  the worker (create/start/stop/remove via the socket proxy, /health wait,
  log follower, stats, memory guard, adopt/remove containers on restart).
- Pure command builder for llama-server and vllm serve (mmproj, MTP draft,
  KV cache types, dtype, KV cache size) with tests; file candidates per
  engine with tests.
- New main menu entry Deployments: list, new/edit form (runtime -> model
  and files -> launch options, live command preview), detail page with
  stats, log, endpoint and a streaming chat smoke test.

Not yet tested end-to-end against real containers.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Pascal LinxweilerandClaude Opus 5.5 committed 2026-10-06 11:31:04 +02:00
1 parent 4f7ae1fc8c
commit 8b74fa69db
32 files changed
+3824 -3

No files matched your search

+9 -3
View File
@@ -1,12 +1,18 @@
"use client";
import { LibraryIcon, SettingsIcon } from "lucide-react";
import { LibraryIcon, RocketIcon, SettingsIcon } from "lucide-react";
import Link from "next/link";
import { usePathname } from "next/navigation";
import { cn } from "@/lib/utils";
const LINKS = [
{ href: "/", label: "Library", icon: LibraryIcon, active: (p: string) => !p.startsWith("/settings") && !p.startsWith("/jobs/") },
{
href: "/",
label: "Library",
icon: LibraryIcon,
active: (p: string) => !p.startsWith("/settings") && !p.startsWith("/deployments"),
},
{ href: "/deployments", label: "Deployments", icon: RocketIcon, active: (p: string) => p.startsWith("/deployments") },
{ href: "/settings", label: "Settings", icon: SettingsIcon, active: (p: string) => p.startsWith("/settings") },
];
@@ -16,7 +22,7 @@ export function AppNav() {
return (
<nav className="flex items-center gap-1 text-sm">
{LINKS.map((l) => {
const active = l.active(pathname) || (l.href === "/" && pathname.startsWith("/jobs/"));
const active = l.active(pathname);
return (
<Link
key={l.href}
+23
View File
@@ -0,0 +1,23 @@
import { LoaderCircleIcon } from "lucide-react";
import { cn } from "@/lib/utils";
const STYLE: Record<string, { label: string; className: string }> = {
stopped: { label: "stopped", className: "border-foreground/15 text-muted-foreground" },
starting: { label: "starting", className: "border-amber-500/30 bg-amber-500/10 text-amber-700 dark:text-amber-300" },
running: { label: "running", className: "border-emerald-500/30 bg-emerald-500/10 text-emerald-700 dark:text-emerald-300" },
stopping: { label: "stopping", className: "border-foreground/15 text-muted-foreground" },
failed: { label: "failed", className: "border-destructive/30 bg-destructive/10 text-destructive" },
};
/** Deployment state; shows "starting" as soon as a start was requested. */
export function DeploymentStateBadge({ state, desiredState, className }: { state: string; desiredState: string; className?: string }) {
const effective = desiredState === "running" && (state === "stopped" || state === "failed") ? "starting" : desiredState === "stopped" && (state === "running" || state === "starting") ? "stopping" : state;
const s = STYLE[effective] ?? STYLE.stopped;
return (
<span className={cn("inline-flex h-5 shrink-0 items-center gap-1 rounded-4xl border px-2 text-xs font-medium whitespace-nowrap", s.className, className)}>
{(effective === "starting" || effective === "stopping") && <LoaderCircleIcon className="size-3 animate-spin" />}
{effective === "running" && <span className="size-1.5 rounded-full bg-emerald-500" />}
{s.label}
</span>
);
}