Skip to content

Conversation

ericcurtin
Copy link
Contributor

More info than previous progress bar

@ericcurtin
Copy link
Contributor Author

ericcurtin commented Aug 22, 2025

Looks like this:

$ ./model-cli pull ai/gemma3
 43% |██████████              |   1022.74 MB/2.32 GB    85.83 MB/s         15s

@ericcurtin
Copy link
Contributor Author

@xenoscopic @p1-0tr PTAL... Especially as regards user-facing aesthetics... Want to avoid wasted effort if the appearance isn't preferred...

@ericcurtin
Copy link
Contributor Author

Needs a bit more work...

@ericcurtin ericcurtin force-pushed the progress-bar branch 2 times, most recently from ee17d51 to 666c1d4 Compare August 24, 2025 15:12
@ericcurtin
Copy link
Contributor Author

This is complete and ready for review/merge... PTAL need somebody to press the build button again @xenoscopic @p1-0tr

@ericcurtin ericcurtin force-pushed the progress-bar branch 2 times, most recently from 3a0fab7 to 524737d Compare August 24, 2025 15:28
More info than previous progress bar

Signed-off-by: Eric Curtin <[email protected]>
return fmt.Sprintf("%s%s| %s", prefix, bar, suffix)
}

func getTerminalWidthUnix() (int, error) {
Copy link
Member

Choose a reason for hiding this comment

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

This needs to go in a separate file with build directives (https://pkg.go.dev/cmd/go#hdr-Build_constraints) to make sure the Unix specific code is built only on Unix. You can use https://github.com/docker/model-runner/tree/main/pkg/gpuinfo as an example.

Copy link
Contributor

@xenoscopic xenoscopic left a comment

Choose a reason for hiding this comment

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

Happy for the change overall. We'll likely be doing concurrent downloads for sharded GGUF layers in the next release, so detailed and dynamic progress bars would be great (I'm not sure how much of an extension it would be for this implementation to support multiple bars).

Agree with @p1-0tr that the main thing would just be making sure it works on Windows (or at least builds with a simple fallback implementation). On the Windows side, we do get a lot of users on MinTTY-based terminals, in which case maybe it's worth using an existing library to implement this (e.g. the progress bar component of https://github.com/charmbracelet/bubbles (which uses https://github.com/charmbracelet/bubbletea)). @fiam might know best.

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.

3 participants