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

+5
View File
@@ -3,6 +3,7 @@ import { asc, eq } from "drizzle-orm";
import { z } from "zod";
import { db } from "@/lib/db/client";
import { type DockerHostInfo, runtimes, workerState } from "@/lib/db/schema";
import { deploymentsUsing } from "@/lib/deployments";
import { type RuntimeInput, RUNTIME_PRESETS, RuntimeValidationError, validateRuntime } from "@/lib/runtimes-shared";
export type Runtime = typeof runtimes.$inferSelect;
@@ -77,6 +78,10 @@ export async function updateRuntime(id: string, input: RuntimeInput): Promise<Ru
export async function deleteRuntime(id: string): Promise<void> {
await getRuntime(id);
const using = await deploymentsUsing({ runtimeId: id });
if (using.length > 0) {
throw new RuntimeError("invalid", `Deployments use this runtime (${using.map((u) => u.name).join(", ")}). Delete them first.`, 409);
}
await db().delete(runtimes).where(eq(runtimes.id, id));
}