intel / intel/AI-Playground

Add Estimated Time Remaining (ETA) to Model Downloads

Open
#423 1 comment 0 reactions 0 assignees View on GitHub
enhancement stale
Dominant language
TypeScript
Stars
979
Forks
132
Avg merge
9h 23m
Merged PRs (30d)
8

Description

## Is your feature request related to a problem? Please describe.

When downloading models, the UI currently shows a progress bar and percentage, but it does not show an estimated remaining time (ETA). Because model files are often several gigabytes and download speeds fluctuate, it is difficult to know whether a download will take seconds or several minutes. This makes it hard to judge whether the process is slow, stalled, or simply ongoing.

## Describe the solution you'd like

Add an Estimated Time Remaining (ETA) indicator to the model download UI.

The backend already emits download_model_progress events containing:

download_size
total_size
percent
speed

Using these values, ETA can be computed as:

remaining_bytes = total_size - download_size
eta_seconds = remaining_bytes / smoothed_speed
The UI could display this directly under the progress bar, for example:

Estimated time remaining: 2m 15s

## Describe alternatives you've considered

Using only the progress bar and percentage
This shows progress but not how long the download will take.

Estimating manually from the displayed speed
This is inconvenient and inaccurate, especially when speeds fluctuate.

## Additional context

**Sequential multi‑file downloads**
From the logs, the backend downloads model components sequentially, one file at a time. For example:

- black-forest-labs/FLUX.2-klein-4b-fp8/flux-2-klein-4b-fp8.safetensors (3.8G)

- Comfy-Org/vae-text-encoder-for-flux-klein-4b/split_files/text_encoders/qwen_3_4b_fp4_flux2.safetensors (3.6G)

- Additional VAE and NSFW detector files follow.

The backend emits:

- download_model_progress events for each file
- download_model_completed when a file finishes
- Hugging Face API calls to enumerate all required files before downloading

This confirms that the backend already knows:

- the full list of required files
- their sizes
- the order in which they will download

**Suggested implementation steps**

**1. Enumerate all required files and sizes up front**

- Use existing Hugging Face API calls (/api/models/.../tree/main) to gather file metadata.

- Compute:

total_bytes = sum(size of all required files).

**2. Track cumulative downloaded bytes across all files**

- Maintain a running downloaded_bytes counter.
- Avoid resetting progress when moving to the next file.

**3. Smooth download speed**

- Use a short moving average to stabilize ETA when speeds fluctuate.

**4. Compute ETA**

- remaining_bytes = total_bytes - downloaded_bytes
- eta_seconds = remaining_bytes / smoothed_speed

**5. Extend the progress event schema**

Add fields such as:
- downloaded_bytes
- total_bytes
- speed_bytes_per_sec
- eta_seconds

**6. Update the UI**

- Display ETA under the progress bar.
- Optionally show the current file name for clarity.

**Why this helps**
Large model downloads (3–4 GB per file, often multiple files per model) benefit greatly from a clear time estimate. The backend already provides all necessary data, so adding ETA would be a minimal extension with a meaningful UX improvement.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.