Skip to content

Improve chat app model and mmproj cache UX#266

Merged
leehack merged 2 commits into
mainfrom
issue-132-chat-app-mmproj-cache-ux
Jul 4, 2026
Merged

Improve chat app model and mmproj cache UX#266
leehack merged 2 commits into
mainfrom
issue-132-chat-app-mmproj-cache-ux

Conversation

@leehack

@leehack leehack commented Jul 4, 2026

Copy link
Copy Markdown
Owner

Summary

Improves the chat app model/mmproj cache UX for issue #132:

  • tracks model and mmproj cache state independently
  • surfaces partial cache state in Manage Models and model cards
  • downloads/caches only missing assets when a profile is partially cached
  • refreshes all cache states after download/delete so shared assets do not leave stale cards
  • persists web cache markers per asset as each prefetch succeeds
  • warns before saving signed/tokenized custom model URLs

Fixes #132.

Validation

  • flutter analyze --no-pub passed in example/chat_app
  • flutter test --no-pub test/model_card_test.dart test/model_service_test.dart test/manage_models_screen_download_test.dart test/model_download_controller_adapter_test.dart test/unit_test.dart passed
  • additional focused tests after review fixes passed:
    • flutter test test/model_service_test.dart test/model_card_test.dart test/model_download_controller_adapter_test.dart test/model_asset_source_test.dart test/manage_models_screen_download_test.dart
  • git diff --check passed
  • Real chat-app E2E passed on macOS:
    • dart run tool/testing/run_local_e2e.dart --scenario chat-app-model-cache --device macos
    • built the macOS app, downloaded real LFM2-VL model + mmproj, loaded through ChatService, and asserted engine ready plus supportsVision == true

Notes

The macOS E2E emitted a non-fatal Failed to foreground app; open returned 1 warning after all tests had already passed.

@github-actions

github-actions Bot commented Jul 4, 2026

Copy link
Copy Markdown
Contributor

Chat app preview removed for leehack/llamadart-chat-pr-266.

@leehack leehack marked this pull request as ready for review July 4, 2026 17:59
Copilot AI review requested due to automatic review settings July 4, 2026 17:59

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This PR improves the runnable chat app’s model + multimodal projector (“mmproj”) caching UX by tracking cache state per asset (model vs projector), enabling partial-cache recovery (download/cache only missing assets), refreshing cache state across all profiles after download/delete, and warning users before persisting signed/tokenized custom Hugging Face URLs.

Changes:

  • Introduces per-asset cache state (ModelProfileCacheState) and cache-key markers (ModelAssetCacheMarkers) to represent partial availability.
  • Updates IO + Web model services to skip already-cached assets and to persist cache markers per asset as each stage succeeds.
  • Enhances Manage Models + ModelCard UI to display model/mmproj cache chips, partial-cache messaging, capability mismatch warnings, and credentialed-URL confirmation.

Reviewed changes

Copilot reviewed 13 out of 13 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
CHANGELOG.md Adds an Unreleased entry describing the chat app cache UX improvements and credentialed-URL confirmation.
website/docs/changelog/recent-releases.md Mirrors the Unreleased entry for website “Recent Releases”.
example/chat_app/lib/services/model_service_base.dart Adds getModelCacheState API plus new cache state/marker types for per-asset availability.
example/chat_app/lib/services/model_service_io.dart Computes per-asset cache state and skips downloading already-present model/mmproj assets.
example/chat_app/lib/services/model_service_web.dart Migrates cache markers in getDownloadedModels, adds per-asset cache state, and caches only missing web assets while persisting markers per stage.
example/chat_app/lib/screens/manage_models_screen.dart Refreshes cache state independently of “downloaded” state, warns on runtime capability mismatches, and confirms saving credential-like custom URLs.
example/chat_app/lib/widgets/model_card.dart Displays asset-level cache chips + partial-cache messaging and adjusts download/delete labels accordingly.
example/chat_app/test/model_service_test.dart Adds coverage for skipping cached model downloads when only mmproj is missing.
example/chat_app/test/model_card_test.dart Adds widget coverage for partial multimodal cache UI/UX behavior.
example/chat_app/test/manage_models_screen_download_test.dart Adds widget coverage for capability mismatch warnings, shared-asset refresh on delete, and credentialed-URL confirmation flow.
example/chat_app/test/model_download_controller_adapter_test.dart Updates test fake to satisfy the new getModelCacheState API.
example/chat_app/test/model_asset_source_test.dart Adds unit coverage for cache markers correctly reflecting partial-cache state.
example/chat_app/test/unit_test.dart Updates recording service stub to implement getModelCacheState.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread example/chat_app/lib/services/model_service_web.dart
@leehack leehack force-pushed the issue-132-chat-app-mmproj-cache-ux branch from 32d99ab to e7e9bbb Compare July 4, 2026 22:02
@leehack leehack merged commit 4e3536f into main Jul 4, 2026
11 checks passed
@leehack leehack deleted the issue-132-chat-app-mmproj-cache-ux branch July 4, 2026 22:12
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.

feat(chat-app): improve model/mmproj asset-level cache UX

2 participants