feat: auto-unload model after 30min inactivity + model picker on first launch#13
Open
Swallow74 wants to merge 6 commits into
Open
feat: auto-unload model after 30min inactivity + model picker on first launch#13Swallow74 wants to merge 6 commits into
Swallow74 wants to merge 6 commits into
Conversation
…t launch - Unloads model from GPU memory after 30 minutes of inactivity\n- Auto-reloads on next message or chat open\n- Shows model picker (E2B/E4B) on first launch instead of auto-loading default\n- Selection persisted in chrome.storage.local\n- Handles 'unloaded' status in content script UI
Owner
|
hi @Swallow74 |
Author
|
Thanks for checking! I verified the sizes directly from the Hugging Face model repos. The app loads the E2B (~3.4GB):
E4B (~5.2GB):
I originally had the default ONNX sizes (~500MB and ~1.5GB), which seemed wrong the first time I actually downloaded a model, so I updated them to match the Feel free to double-check at: |
- Alt+G toggles the chat overlay open/closed from anywhere on the page - Escape closes the overlay when it is visible
Alt+G toggles the chat overlay from anywhere on the page and Escape closes it; both are rebindable from the settings panel and persisted to browser.storage.local. Shortcuts are matched off KeyboardEvent.code (so modifier combos are layout-stable) and handled in the capture phase so they work even when the chat input is focused.
- Add auto fallback from webgpu to wasm device on load failure - Copy ort-wasm-simd-threaded files needed for WASM backend - Add device field to model status/switch/load messages - Better error messages for WebGPU alignment failures
- Catch 'unaligned' error during agent run, not just model load - Reload model with WASM backend and retry generation automatically - Show warning message to user during fallback - Remove premature error wrapping in generateRaw
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
Two features for better model lifecycle management:
1. Auto-unload after inactivity
2. Model picker on first launch
chrome.storage.local— only shown onceFiles changed
offscreen/model-host.tslastModelId— persists across unload/reloadentrypoints/offscreen/main.tsagent:runcontent/chat-overlay.tsentrypoints/content.tsgemma_model_chosenflag, show picker or auto-loadshared/messages.tsunloadedtoModelStatusMessagestatus union