Skip to content

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

@TimPietrusky

Description

@TimPietrusky

Problem

Models tagged with library_name: mflux on Hugging Face Hub show 0 downloads, even though they are actively downloaded and used. This affects all mflux-quantized models, including repos by the mflux author themselves.

Root cause

mflux is not registered in model-libraries.ts, so there is no countDownloads filter for it. The default fallback counts requests to config.json, but most mflux repos don't include that file — they only contain safetensors weights, tokenizer files, and optionally model.safetensors.index.json index files.

Evidence

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

Repos with config.json get download counts via the default fallback. Repos without it — despite being actively used — show 0.

What mflux downloads

Looking at the mflux source code, it uses huggingface_hub.snapshot_download with:

allow_patterns=[file_pattern, "config.json"]

where file_pattern defaults to "*.safetensors". So mflux requests both safetensors files and config.json.

Suggested fix

Register mflux in model-libraries.ts with a countDownloads filter targeting config.json (which mflux explicitly requests on every download):

countDownloads: `path:"config.json"`

About mflux

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions