Download more, file labels, split-file grouping, settings for labels and tags

- Files tab: "Download more" adds files to a model's selection and queues them
- Colored file labels (Model, MTP, Vision/mmproj, imatrix, Config, …)
- Split GGUF/safetensors parts shown and selected as one entry everywhere
- Settings page with a Labels section: file label names/colors, tag
  rename/recolor/delete; new settings table and tags.color
- Quants only count model weights

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Pascal LinxweilerandClaude Opus 5.5 committed 2026-10-05 20:42:03 +02:00
1 parent 5211ec9064
commit df18415e02
34 files changed
+2256 -132

No files matched your search

+59
View File
@@ -1,5 +1,7 @@
import assert from "node:assert/strict";
import { describe, it } from "node:test";
import { groupSplitFiles, splitInfo } from "./file-groups";
import { fileRole } from "./file-roles";
import { modelFamilies, parseRepoMetadata } from "./hub/metadata";
import { EMPTY_FILTERS, facetCounts, matchesFilters, matchesQuery, type SearchableModel } from "./search";
@@ -89,3 +91,60 @@ describe("filters and facet counts", () => {
assert.deepEqual(facetCounts(models, "family", "", f), [["google", 1], ["Qwen", 1]]);
});
});
describe("fileRole", () => {
it("classifies typical GGUF repo files", () => {
const cases: [string, string][] = [
["Qwen3.8-27B-UD-Q4_K_M.gguf", "model"],
["Q4_K_M/Qwen3-235B-A22B-Q4_K_M-00001-of-00003.gguf", "model"],
["MTP/mtp-Qwen3.8-27B-Q4_0.gguf", "mtp"],
["mmproj-BF16.gguf", "vision"],
["mmproj-model-f16.gguf", "vision"],
["imatrix_unsloth.gguf", "imatrix"],
["imatrix_unsloth.dat", "imatrix"],
["Qwen_Qwen3-8B.imatrix", "imatrix"],
["config.json", "config"],
["generation_config.json", "config"],
["params", "config"],
["tokenizer.json", "tokenizer"],
["tokenizer_config.json", "tokenizer"],
["merges.txt", "tokenizer"],
["chat_template.jinja", "template"],
["template", "template"],
["README.md", "docs"],
["LICENSE", "docs"],
[".gitattributes", "git"],
["model-00001-of-00004.safetensors", "model"],
["adapter_model.safetensors", "adapter"],
["images/banner.png", "image"],
];
for (const [path, role] of cases) assert.equal(fileRole(path), role, path);
});
});
describe("groupSplitFiles", () => {
it("merges split parts into one entry and leaves other files alone", () => {
const files = [
{ path: ".gitattributes", size: 1 },
{ path: "BF16/Qwen3.8-27B-BF16-00002-of-00002.gguf", size: 20 },
{ path: "BF16/Qwen3.8-27B-BF16-00001-of-00002.gguf", size: 50 },
{ path: "Qwen3.8-27B-Q4_0.gguf", size: 16 },
];
const groups = groupSplitFiles(files);
assert.deepEqual(
groups.map((g) => [g.path, g.size, g.totalParts, g.parts.map((p) => p.path.slice(-18))]),
[
[".gitattributes", 1, 1, [".gitattributes"]],
["BF16/Qwen3.8-27B-BF16.gguf", 70, 2, ["00001-of-00002.gguf", "00002-of-00002.gguf"].map((s) => s.slice(-18))],
["Qwen3.8-27B-Q4_0.gguf", 16, 1, ["Qwen3.8-27B-Q4_0.gguf".slice(-18)]],
],
);
});
it("parses part numbers", () => {
assert.deepEqual(splitInfo("Q4_K_M/X-Q4_K_M-00003-of-00010.gguf"), { base: "Q4_K_M/X-Q4_K_M.gguf", part: 3, total: 10 });
assert.equal(splitInfo("model-00001-of-00004.safetensors")?.base, "model.safetensors");
assert.equal(splitInfo("Qwen3-8B-Q4_K_M.gguf"), null);
});
});