Milestone (c): worker and downloads with live progress

- Worker queue with per-model exclusivity and MAX_CONCURRENT_DOWNLOADS,
  spawns `hf download --revision <sha> --local-dir ... --include <exact paths>`
  with HF_TOKEN via env only
- Progress from bytes on disk (final + .incomplete files matched by etag),
  per job and per file, with speed and ETA; post-download size/etag check
- Job logs (sanitized), cancel, graceful interrupt on shutdown,
  partial-file cleanup (hf 2.1.1 does not resume partials)
- Single-worker DB lease, free-space check
- SSE live updates for library, model and job pages
- Dockerfile + compose.yaml (web, worker, data/models volumes)
- HF_HUB_DISABLE_XET default on for measurable progress

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Pascal LinxweilerandClaude Opus 5.5 committed 2026-10-05 16:57:12 +02:00
1 parent 8f7ac60ccf
commit 49440154a2
42 files changed
+2974 -110

No files matched your search

+6 -3
View File
@@ -2,8 +2,10 @@ import { notFound } from "next/navigation";
import { ModelStatusBadge } from "@/components/model-status-badge";
import { Card, CardContent, CardDescription, CardHeader, CardTitle } from "@/components/ui/card";
import { Table, TableBody, TableCell, TableHead, TableHeader, TableRow } from "@/components/ui/table";
import { formatBytes, formatDate } from "@/lib/format";
import { formatBytes } from "@/lib/format";
import { LocalTime } from "@/components/local-time";
import { getModel } from "@/lib/library";
import { ModelLive } from "./model-live";
import { RemoveModelButton } from "./remove-model-button";
export const dynamic = "force-dynamic";
@@ -27,7 +29,6 @@ export default async function ModelPage({ params }: PageProps<"/models/[id]">) {
<Card>
<CardHeader>
<CardTitle>Details</CardTitle>
<CardDescription>Downloading starts in the next milestone.</CardDescription>
</CardHeader>
<CardContent>
<dl className="grid grid-cols-[max-content_1fr] gap-x-6 gap-y-2 text-sm">
@@ -53,11 +54,13 @@ export default async function ModelPage({ params }: PageProps<"/models/[id]">) {
<dt className="text-muted-foreground">Exclude</dt>
<dd className="font-mono text-xs break-all">{model.excludePatterns.join(", ") || "–"}</dd>
<dt className="text-muted-foreground">Added</dt>
<dd>{formatDate(model.createdAt)}</dd>
<dd><LocalTime value={model.createdAt} /></dd>
</dl>
</CardContent>
</Card>
<ModelLive modelId={model.id} status={model.status} />
<Card className="py-0">
<CardHeader className="pt-4">
<CardTitle>