Skip to content

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

pin why an -fp16.gguf build gets no Ollama variant

[._.]/ Adam Eivy2f68d12ad6a7
diff --git a/server/services/huggingFaceCatalog.js b/server/services/huggingFaceCatalog.js
index 3d6c419934..f8f76179a5 100644
--- a/server/services/huggingFaceCatalog.js
+++ b/server/services/huggingFaceCatalog.js
@@ -212,6 +212,11 @@ function quantFromFilename(filename) {
// `hf.co/<repo>:Q2` pull is rejected by Ollama with "not a valid quantization
// scheme". An unparseable quant is better as null: the install id then falls
// back to the bare repo, which Ollama resolves via its `latest` manifest.
+ // `FP16` is deliberately NOT a token here (only `F16`/`BF16`): Ollama rejects
+ // an `:FP16` tag as an invalid scheme, and an `:F16` tag on a repo whose file
+ // is named `…-fp16.gguf` 404s ("tag is not available in the repository"), so a
+ // `…-fp16.gguf` build has no pullable tag at all — dropping it from the variant
+ // list and installing the repo's `latest` is the only form that works.
const match = stem.match(/(?:^|[-_.])((?:UD-)?(?:IQ\d(?:_[A-Z0-9]+)*|Q\d(?:_[A-Z0-9]+)*|BF16|F16))$/i)
return match?.[1] || null
}
diff --git a/server/services/huggingFaceCatalog.test.js b/server/services/huggingFaceCatalog.test.js
index d761d2db78..d324b11a1e 100644
--- a/server/services/huggingFaceCatalog.test.js
+++ b/server/services/huggingFaceCatalog.test.js
@@ -243,6 +243,25 @@ describe('huggingFaceCatalog', () => {
expect(result.variants || []).toEqual([])
})
+ it('offers no variant for an `-fp16.gguf` build, which Ollama has no valid tag for', async () => {
+ // Verified against the HF/Ollama registry: `:FP16` → 400 "not a valid
+ // quantization scheme" and `:F16` → 400 "not available in the repository"
+ // when the file is named `…-fp16.gguf`. Neither tag installs, so the build
+ // must stay off the variant list rather than offering a 400 behind Install.
+ const repo = 'exampleorg/Example-0.5B-Instruct-GGUF'
+ fetch
+ .mockResolvedValueOnce(listing(repo, ['example-0.5b-instruct-fp16.gguf', 'example-0.5b-instruct-q4_k_m.gguf']))
+ .mockResolvedValueOnce(blobs(repo, {
+ 'example-0.5b-instruct-fp16.gguf': 1_000_000_000,
+ 'example-0.5b-instruct-q4_k_m.gguf': 400_000_000,
+ }))
+
+ const [result] = await searchHuggingFaceModels({ backend: 'ollama', query: 'example-0.5b', systemMemoryBytes: 128 * 1024 ** 3 })
+
+ expect(result.variants.map((v) => v.quant)).toEqual(['q4_k_m'])
+ expect(result.id).toBe(`hf.co/${repo}:q4_k_m`)
+ })
+
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