Repository navigation
[Bug]: AI Models catalog falls back to three models when estimated_pulls is null #1480
mikeshollen
started this conversation in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Hi all.
First, thank everyone that is involved with this project. It's epic! This is my first time reporting a bug or even using Github, but here it goes.
[Bug]: AI Models catalog falls back to three models when estimated_pulls is null
Description
The AI Models page in Project NOMAD displays only three models (llama3.1, deepseek-r1, and llama3.2), even though the public model catalog is accessible and contains hundreds of models.
Clicking "Refresh Models" does not resolve the issue.
I traced the problem to a null-handling bug in the backend's model-sorting logic, identified the offending code, and successfully restored the full GUI catalog with a minimal two-line patch.
Environment
ghcr.io/crosstalk-solutions/project-nomad:latestnomad_adminSteps to Reproduce
curl -sS 'http://localhost:8080/api/ollama/models?sort=pulls&recommendedOnly=false&limit=15&force=true'The endpoint returns only three fallback models.
curl -sS 'http://localhost:8080/api/ollama/models?sort=name&recommendedOnly=false&limit=15'This successfully returns 15 models, with
hasMore: true.Root Cause
The public model catalog includes entries where:
In
admin/app/services/ollama_service.ts, thesortModels()function callsparsePulls()without checking whether the input is a string.The compiled JavaScript contains:
When
pullsis null, the function throws:The Command Center logs confirm the sequence:
The catalog downloads successfully, but processing fails during sorting.
Verified Local Fix
I modified the compiled JavaScript at:
Added the following guard to
parsePulls():I also added the equivalent defensive check to
parseSize(), which has the same potential null-handling vulnerability:After validating JavaScript syntax, deploying the patched file, and restarting
nomad_admin, the full model catalog was restored in the GUI.Expected Behavior
Models with missing popularity statistics should remain available in the catalog.
Missing
estimated_pullsvalues should be handled gracefully rather than causing the entire catalog request to fail.Actual Behavior
The backend throws an exception and substitutes three fallback models, making the full downloadable catalog inaccessible through the GUI.
Suggested Permanent Fix
Add null/type guards to the sorting functions in the TypeScript source:
Apply equivalent handling to
parseSize()for missing or null size values.Ideally, add regression tests covering catalog entries with null popularity and size fields.
Impact
This bug can prevent users from browsing and downloading models through the standard GUI despite having a functioning internet connection and a valid model catalog.
The failure also misleadingly resembles a connectivity or cache problem, potentially encouraging unnecessary updates or reinstalls.
Status: Root cause identified; local workaround tested successfully. Permanent upstream fix requested.
All reactions