Skip to content

Support concurrent model downloads - #126

Merged
Blaizzy merged 2 commits into
mainfrom
feat/concurrent-downloads
Jul 27, 2026
Merged

Support concurrent model downloads#126
Blaizzy merged 2 commits into
mainfrom
feat/concurrent-downloads

Conversation

@Lazarus-931

Copy link
Copy Markdown
Collaborator

Replace the single-download HuggingFaceDownloadManager with a queue that runs up to a user's device suffices. Each download tracks its own operation, task, progress, state (downloading/paused/queued) and waiters, keyed by model ID; extra requests are queued FIFO and started as active slots free up on completion or cancel. Pause (SIGSTOP), resume (SIGCONT) and cancel now target an individual model.

Add a cumulative disk gate: capacityBlocker compares a model's size against free space minus reservedBytes (the remaining bytes of every in-flight download), so a download is only offered when it still fits.

Update all consumers: the sidebar arrow shows the active count, the Models banner lists one row per download with per-model controls, and hub rows drive their state per model while disabling downloads that no longer fit on disk.

Replace the single-download HuggingFaceDownloadManager with a queue that
runs up to 3 downloads at once. Each download tracks its own operation,
task, progress, state (downloading/paused/queued) and waiters, keyed by
model ID; extra requests are queued FIFO and started as active slots free
up on completion or cancel. Pause (SIGSTOP), resume (SIGCONT) and cancel
now target an individual model.

Add a cumulative disk gate: capacityBlocker compares a model's size
against free space minus reservedBytes (the remaining bytes of every
in-flight download), so a download is only offered when it still fits.

Update all consumers: the sidebar arrow shows the active count, the
Models banner lists one row per download with per-model controls, and hub
rows drive their state per model while disabling downloads that no longer
fit on disk.
Every requested download now starts immediately; drop the FIFO queue,
the concurrency limit, and the .queued state. DownloadState is just
downloading/paused. The multi-download manager, per-model controls,
reservedBytes, the disk gate, the banner list, and the sidebar count are
unchanged.

@Blaizzy Blaizzy left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

LGTM, thanks!

@Blaizzy
Blaizzy merged commit 06d90b6 into main Jul 27, 2026
2 checks passed
@Blaizzy
Blaizzy deleted the feat/concurrent-downloads branch July 27, 2026 18:15
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.

2 participants