Improve chat app model and mmproj cache UX#266
Merged
Conversation
Contributor
|
Chat app preview removed for |
There was a problem hiding this comment.
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.
32d99ab to
e7e9bbb
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Improves the chat app model/mmproj cache UX for issue #132:
Fixes #132.
Validation
flutter analyze --no-pubpassed inexample/chat_appflutter 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.dartpassedflutter 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.dartgit diff --checkpasseddart run tool/testing/run_local_e2e.dart --scenario chat-app-model-cache --device macosChatService, and asserted engine ready plussupportsVision == trueNotes
The macOS E2E emitted a non-fatal
Failed to foreground app; open returned 1warning after all tests had already passed.