Add mflux library to model-libraries.ts (closes #2091)#2196
Conversation
4e32a65 to
2a15ce1
Compare
Registers mflux (https://github.com/filipstrand/mflux), a line-by-line MLX port of FLUX/Z-Image image generation models for Apple Silicon. Models tagged with library_name: mflux currently show 0 downloads because most mflux repos do not ship config.json (only safetensors weights + tokenizer files), so the default config.json fallback misses them. mflux loads weights via huggingface_hub.snapshot_download with allow_patterns=[file_pattern, "config.json"], so it requests config.json on every download — matching that path correctly counts mflux usage without over-counting unrelated safetensors fetches. Closes huggingface#2091
2a15ce1 to
1304845
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 1304845. Configure here.
| repoName: "mflux", | ||
| repoUrl: "https://github.com/filipstrand/mflux", | ||
| filter: false, | ||
| countDownloads: `path:"config.json"`, |
There was a problem hiding this comment.
countDownloads uses wrong pattern, defeating the PR's purpose
High Severity
The countDownloads value is set to path:"config.json" but the entire purpose of this PR is to fix download tracking for mflux repos that don't include a config.json. The PR description explicitly states the value should be path_extension:"safetensors", matching how mflux downloads weights. Using path:"config.json" replicates the exact broken fallback behavior this change is meant to fix — most mflux repos will continue showing 0 downloads.
Reviewed by Cursor Bugbot for commit 1304845. Configure here.
Hey @Sanjays2402 , this assumption is not correct unfortunately. The allow pattern is a filter when downloading a repo that matches which files it should try to load. Since Is there another file that could be used for download count? Otherwise a solution is to add a snippet in the mflux library to make sure the config file is always called. |


Closes #2091.
What
Registers mflux in
packages/tasks/src/model-libraries.tsso models taggedlibrary_name: mfluxget download counts.Why
mflux is a line-by-line MLX port of FLUX / FLUX.2 / Z-Image for Apple Silicon (4k+ stars, actively maintained). Models like
filipstrand/FLUX.1-Krea-dev-mflux-4bitandRunpod/FLUX.2-klein-4B-mflux-4bitcurrently report 0 downloads despite being actively used, because:config.jsonconfig.jsonand finds nothingconfig.json(e.g.madroid/flux.1-dev-mflux-4bit) do get counted via the fallback, which confirms the gapHow
mflux loads weights via
huggingface_hub.snapshot_downloadwithallow_patterns=[file_pattern, "config.json"], so it always requestsconfig.jsonon every download — even when the repo does not contain one. Matching on that path is the most precise filter for mflux usage without over-counting unrelated safetensors fetches from other libraries.Verification
pnpm lintcleanpnpm test— 18/18 passingpnpm build— cleanInserted in alphabetical position between
medvaeandmitie.Note
Low Risk
Single registry entry for download analytics only; no auth, inference, or runtime behavior changes.
Overview
Registers the mflux modeling library in
packages/tasks/src/model-libraries.tsso Hub models taggedlibrary_name: mfluxuse a library-specific download counter instead of only the generic defaults.The new entry points at the mflux repo, keeps it out of the public models filter (
filter: false), and setscountDownloadstopath:"config.json"(per the diff). The PR text argues many mflux repos lack that file and proposes counting*.safetensorsinstead—worth confirming the merged query matches the intended metric before ship.Reviewed by Cursor Bugbot for commit 1304845. Bugbot is set up for automated code reviews on this repo. Configure here.