The all-in-one local AI studio for your desktop: chat, image and video generation and a coding agent in one free, open source app. Windows and Linux. No Docker, no terminal, no cloud required.
TypeScript agentai-chatai-studioall-in-onecoding-agentdesktop-appfluximage-generationlinuxllmlocal-ailocal-llmopen-sourceprivacyself-hostedstable-diffusionuncensoreduncensored-aivideo-generationwindows
fix(models): quant detection survives multi-part shard suffixes
purpleb61984344f4b
diff --git a/src/lib/__tests__/hf-to-provider.test.ts b/src/lib/__tests__/hf-to-provider.test.tsindex 3f1bd0a4..3567bd65 100644--- a/src/lib/__tests__/hf-to-provider.test.ts+++ b/src/lib/__tests__/hf-to-provider.test.ts@@ -25,9 +25,21 @@ describe('extractGgufQuant', () => {expect(extractGgufQuant('model-IQ4_XS.gguf')).toBe('IQ4_XS')expect(extractGgufQuant('model-F16.gguf')).toBe('F16')})+ it('reads the quant through a multi-part shard suffix (2.5.8 catalog regression)', () => {+ // Caught live on the ship exe: the 155 GB "DeepSeek V4 Flash" card offered+ // the repo's 80.9 GB Q2 set in the confirm dialog, because the shard+ // counter after the quant made extractGgufQuant return undefined and the+ // resolver fell back to the repo's first quant group.+ expect(extractGgufQuant('DeepSeek-V4-Flash-UD-Q4_K_XL-00001-of-00005.gguf')).toBe('Q4_K_XL')+ expect(extractGgufQuant('GLM-5.2-UD-Q2_K_XL-00001-of-00007.gguf')).toBe('Q2_K_XL')+ expect(extractGgufQuant('GLM-5.2-UD-Q3_K_M-00001-of-00009.gguf')).toBe('Q3_K_M')+ expect(extractGgufQuant('Kimi-K2.7-Code-UD-Q2_K_XL-00008-of-00008.gguf')).toBe('Q2_K_XL')+ })it('returns undefined when no quant token is present', () => {expect(extractGgufQuant('model.gguf')).toBeUndefined()expect(extractGgufQuant('not-a-gguf.txt')).toBeUndefined()+ // a bare shard counter is not a quant+ expect(extractGgufQuant('model-00001-of-00002.gguf')).toBeUndefined()})})diff --git a/src/lib/hf-to-provider.ts b/src/lib/hf-to-provider.tsindex d5739631..f8724891 100644--- a/src/lib/hf-to-provider.ts+++ b/src/lib/hf-to-provider.ts@@ -47,7 +47,14 @@ export function extractGgufQuant(filename: string): string | undefined {// unsloth files like `...-UD-Q4_K_XL.gguf` produced NO quant tag, so the// Ollama HF ref fell back to a tag-less `hf.co/<repo>` pull (Aldrich Ironhart,// Discord 2026-06-07 — "Gemma 4 26B MoE" → ollama 400).- const m = filename.match(+ //+ // Multi-part names put the shard counter AFTER the quant+ // (`...-UD-Q4_K_XL-00001-of-00005.gguf`) — strip it first, or the quant is+ // never found and resolveHfGgufFiles falls back to whatever quant group the+ // repo lists first (caught live: the "DeepSeek V4 Flash · 155 GB" card+ // offered the repo's 80.9 GB Q2 set in the multi-part confirm dialog).+ const normalized = filename.replace(/-\d{4,6}-of-\d{4,6}(?=\.gguf$)/i, '')+ const m = normalized.match(/[-._](Q\d_K_(?:XL|XS|[MSL])|Q\d_K|Q\d_[01]|IQ\d_[A-Z0-9_]+|F16|BF16|F32)\.gguf$/i)return m?.[1].toUpperCase()