Skip to content

feat: add mflux library for download tracking#2092

Open
TimPietrusky wants to merge 1 commit into
huggingface:mainfrom
TimPietrusky:add-mflux-library
Open

feat: add mflux library for download tracking#2092
TimPietrusky wants to merge 1 commit into
huggingface:mainfrom
TimPietrusky:add-mflux-library

Conversation

@TimPietrusky
Copy link
Copy Markdown

@TimPietrusky TimPietrusky commented Apr 10, 2026

Summary

  • Adds mflux to model-libraries.ts so that download stats are tracked for models tagged with library_name: mflux
  • Uses config.json as the countDownloads target, which mflux explicitly requests via snapshot_download(allow_patterns=[file_pattern, "config.json"])

Context

mflux is a line-by-line MLX port of image generation models (FLUX.1, FLUX.2, Z-Image, etc.) optimized for Apple Silicon. It has 4k+ GitHub stars and is actively maintained.

All models with library_name: mflux currently show 0 downloads because the library isn't registered. Repos that happen to have config.json but don't set library_name: mflux get counted via the default fallback, confirming the fix is straightforward.

Repo library_name Has config.json Downloads
madroid/flux.1-dev-mflux-4bit (none) Yes 40
dhairyashil/FLUX.1-schnell-mflux-4bit (none) Yes 155
filipstrand/FLUX.1-Krea-dev-mflux-4bit mflux No 0
Runpod/FLUX.2-klein-4B-mflux-4bit mflux No 0

Closes #2091


Note

Low Risk
Low risk: adds a single new MODEL_LIBRARIES_UI_ELEMENTS entry to improve download counting for library_name: mflux models, with no changes to shared logic or security-sensitive code.

Overview
Adds the mflux library to MODEL_LIBRARIES_UI_ELEMENTS so models tagged with library_name: mflux are recognized and have downloads counted.

Download counting for mflux is configured to use path:"config.json", and the library is marked filter: false with repo metadata pointing to filipstrand/mflux.

Reviewed by Cursor Bugbot for commit 15918af. Bugbot is set up for automated code reviews on this repo. Configure here.

mflux is an MLX port of image generation models (FLUX.1, FLUX.2, Z-Image, etc.)
optimized for Apple Silicon. It has 4k+ GitHub stars and is actively maintained.

Models tagged with library_name: mflux currently show 0 downloads because
mflux is not registered in model-libraries.ts. mflux uses snapshot_download
with allow_patterns that includes config.json, so targeting that file for
countDownloads accurately reflects real usage.

Closes huggingface#2091
Copy link
Copy Markdown
Contributor

@Wauplin Wauplin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR!

Comment on lines +854 to +855
prettyLabel: "mflux",
repoName: "mflux",
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
prettyLabel: "mflux",
repoName: "mflux",
prettyLabel: "MFLUX",
repoName: "MFLUX",

(taken from https://github.com/filipstrand/mflux)

repoName: "mflux",
repoUrl: "https://github.com/filipstrand/mflux",
filter: false,
countDownloads: `path:"config.json"`,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
countDownloads: `path:"config.json"`,

This is the default behavior. If your library needs to count downloads by config.json then no need to do anything! Registering the library is still good for linking to github repo but the download count rule is not needed anymore

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add mflux library to model-libraries.ts for download tracking

3 participants