Self-hosted, Self-Improving, Federated Everything App — dev management, agent orchestration, persistent mind, digital twin, second brain, and creative pipeline from a single dashboard over Tailscale to port the user into the OS
JavaScript ai-agentsdashboarddeveloper-toolsdigital-twinquantified-selfsecond-brainself-hostedtailscale
address review (claude): don't advertise one arbitrary build's size when no quant parses
[._.]/ Adam Eivy10d649fe70f5
diff --git a/server/services/huggingFaceCatalog.js b/server/services/huggingFaceCatalog.jsindex 128aacaa49..3d6c419934 100644--- a/server/services/huggingFaceCatalog.js+++ b/server/services/huggingFaceCatalog.js@@ -219,13 +219,21 @@ function quantFromFilename(filename) {function pickGgufFile(model) {const files = ggufFilesOf(model)if (files.length === 0) return null- return files+ const ranked = files.map((file) => {const quant = quantFromFilename(file.name)const priority = quant ? QUANT_PRIORITY.findIndex((q) => q.toLowerCase() === quant.toLowerCase()) : -1return { ...file, quant, priority: priority === -1 ? 999 : priority }})- .sort((a, b) => a.priority - b.priority || (a.size || Number.MAX_SAFE_INTEGER) - (b.size || Number.MAX_SAFE_INTEGER))[0]+ .sort((a, b) => a.priority - b.priority || (a.size || Number.MAX_SAFE_INTEGER) - (b.size || Number.MAX_SAFE_INTEGER))+ const picked = ranked[0]+ // A repo whose builds all use a non-standard scheme (`…-AVQ2.gguf`) parses to no+ // quant, so the install id is the bare repo and the BACKEND decides which build+ // to pull. With several such files the pick above is arbitrary (all tie at 999,+ // so size-ascending wins) — advertising its size would promise "8.4 GB · fits+ // comfortably" for an install that may fetch a much larger build. Drop the size+ // so the card reports an unknown fit instead. A single-GGUF repo is unambiguous.+ return !picked.quant && ranked.length > 1 ? { ...picked, size: null } : picked}// Delegates formatting to the shared fileUtils.formatBytes, but returns `null`diff --git a/server/services/huggingFaceCatalog.test.js b/server/services/huggingFaceCatalog.test.jsindex b2b0d74157..d761d2db78 100644--- a/server/services/huggingFaceCatalog.test.js+++ b/server/services/huggingFaceCatalog.test.js@@ -243,6 +243,20 @@ describe('huggingFaceCatalog', () => {expect(result.variants || []).toEqual([])})+ it('reports an unknown size when several custom-scheme builds leave the backend to choose', async () => {+ // No file parses a quant, so the id is the bare repo and Ollama picks the+ // build — pinning the card to one arbitrary file's size would advertise a+ // fit verdict for a build the install may not fetch.+ const repo = 'exampleorg/Example-3-Multi'+ fetch+ .mockResolvedValueOnce(listing(repo, ['Example-3-AVQ2.gguf', 'Example-3-AVQ8.gguf']))+ .mockResolvedValueOnce(blobs(repo, { 'Example-3-AVQ2.gguf': 8_400_000_000, 'Example-3-AVQ8.gguf': 30_000_000_000 }))++ const [result] = await searchHuggingFaceModels({ backend: 'ollama', query: 'example-3', systemMemoryBytes: 16 * 1024 ** 3 })++ expect(result).toMatchObject({ id: `hf.co/${repo}`, quant: null, sizeBytes: null, size: 'GGUF' })+ })+it('defaults to a small quant on a low-memory machine', async () => {const repo = 'empero-ai/Qwythos-9B-Small-GGUF'fetch