Skip to content

feat: show download state for local translation models - #1039

Open
Pewpenguin wants to merge 1 commit into
koharu-rs:mainfrom
Pewpenguin:feat/model-download-badge
Open

feat: show download state for local translation models#1039
Pewpenguin wants to merge 1 commit into
koharu-rs:mainfrom
Pewpenguin:feat/model-download-badge

Conversation

@Pewpenguin

Copy link
Copy Markdown

Summary

Local translation models now expose their per-quantization download state and size from the on-disk Hugging Face cache.

Downloaded quantizations show a Downloaded badge. Missing quantizations show the remaining download size and a Download & Load action, which saves the selected ModelSelection and loads it through the existing translator path. Download state is derived locally from the pinned model catalog, so opening the picker does not require a Hugging Face metadata request.

Normal model selection remains preference-only, and remote providers are unchanged. The Download & Load action is available in the editor model picker; Settings remains selection-only and shows download state/size without triggering a download.

Related issue

Closes #233

Verification

  • cargo fmt -- --check
  • cargo check -p koharu-app
  • cargo test -p koharu-runtime --lib source::hugging_face
  • cargo test -p koharu-translator --lib
  • cargo test -p koharu-pipeline --lib tests::load_translation_model_is_noop_for_remote_providers
  • bun run --filter @koharu/app lint
  • bunx tsc --noEmit in packages/koharu
  • Vitest: 15 test files, 115 tests passed
  • git diff --check
  • Manually verified downloaded and undownloaded quantizations, persistence after reopening the model picker, and the Download & Load flow.

UI

Downloaded quantization:

Settings:

image

Editor:

image

Undownloaded quantization:

Settings:

image

Editor:

image

AI assistance

Used AI assistance to understand the existing model-loading, Hugging Face cache, and frontend flows while developing the change. I reviewed the full diff, ran the checks above, and take responsibility for the change.

@github-actions

github-actions Bot commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

Thanks for your first PR to Koharu.

Please review our contribution guide before review:
https://koharu.rs/development/contributing/

In the PR description, include:

  • what changed
  • any user-visible behavior differences
  • how you verified the change

If AI substantially helped design or implement the patch, disclose the extent and purpose of that assistance. A human contributor must personally review, understand, and take responsibility for every submission.

@mayocream mayocream left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Please make minimal changes needed, only change the model list api to include a downloaded bool to indicate the status; let's use an icon for downloaded status instead of showing a literal.

@Pewpenguin
Pewpenguin force-pushed the feat/model-download-badge branch from 1ddb782 to 581fc92 Compare September 4, 2026 13:23
@Pewpenguin

Copy link
Copy Markdown
Author

Please make minimal changes needed, only change the model list api to include a downloaded bool to indicate the status; let's use an icon for downloaded status instead of showing a literal.

Addressed this point and kept the changes minimal. I used the HardDrive icon for the downloaded status — does that look appropriate, or would you prefer a different icon?

@Pewpenguin
Pewpenguin requested a review from mayocream September 4, 2026 15:16
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.

Badge for downloaded models

2 participants