Release 0.16.0: new look, search, remove files, easier deploy
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:
Pascal LinxweilerandClaude Opus 5.5 committed 2026-10-30 14:06:46 +01:00
1 parent c6bcb514e6
commit 5becfc47a0
53 files changed
+1869 -468

No files matched your search

+41 -1
View File
@@ -1,4 +1,5 @@
// Delete a model: its files on disk, then its database rows.
// Delete a model: its files on disk, then its database rows. Or ("remove" jobs) only some of its
// files, which were already taken out of the selection; the model stays.
// Only files that belong to the repo (any revision we know of) and hf's .cache folder are removed;
// anything else in the folder is kept and logged, and the folder stays if it isn't empty.
@@ -58,6 +59,7 @@ export class DeleteRunner implements Runner {
interrupt() {}
async run(): Promise<void> {
if (this.job.purpose === "remove") return this.removeFiles();
const root = resolve(coreEnv().MODELS_DIR);
const dir = modelDir(root, this.model.localPath);
const deleted: string[] = [];
@@ -104,4 +106,42 @@ export class DeleteRunner implements Runner {
log.error(`job ${this.job.id}: deleting ${this.model.repoId} failed`, err);
}
}
/** Delete the files a "remove" job names, if they are still unselected (the user may have re-added one). */
private async removeFiles(): Promise<void> {
const dir = modelDir(resolve(coreEnv().MODELS_DIR), this.model.localPath);
const d = db();
const named = this.job.result?.removePaths ?? [];
const rows = named.length
? await d.select().from(modelFiles).where(and(eq(modelFiles.modelId, this.model.id), inArray(modelFiles.path, named)))
: [];
const removed: string[] = [];
try {
for (const f of rows) {
if (f.selected) {
this.jobLog.system(`Kept ${f.path}: it is selected again.`);
continue;
}
const existed = await removeLocalFile(dir, f.path);
removed.push(f.path);
this.jobLog.system(existed ? `Deleted ${f.path} (${formatBytes(f.size)}).` : `${f.path} wasn't on disk.`);
}
await removeEmptyDirs(dir);
await this.jobLog.close();
await d.batch([
d.update(jobs).set({ state: "completed", finishedAt: new Date(), result: { removePaths: named, removed } }).where(eq(jobs.id, this.job.id)),
...(removed.length
? [d.update(modelFiles).set({ state: "pending", checkedAt: new Date() }).where(and(eq(modelFiles.modelId, this.model.id), inArray(modelFiles.path, removed)))]
: []),
]);
log.info(`removed ${removed.length} file(s) from ${this.model.repoId}`);
} catch (err) {
const message = err instanceof Error ? err.message : String(err);
this.jobLog.system(`Failed after removing ${removed.length} file(s): ${message}`);
await this.jobLog.close();
await d.update(jobs).set({ state: "failed", finishedAt: new Date(), errorCode: "unknown", errorMessage: message }).where(eq(jobs.id, this.job.id));
log.error(`job ${this.job.id}: removing files from ${this.model.repoId} failed`, err);
}
await settleModelStatus(this.model.id);
}
}