feat: Gemma 4 on-device inference via LiteRT-LM (Android)#4
Open
sparkleMing wants to merge 2 commits intomainfrom
Open
feat: Gemma 4 on-device inference via LiteRT-LM (Android)#4sparkleMing wants to merge 2 commits intomainfrom
sparkleMing wants to merge 2 commits intomainfrom
Conversation
- Add LiteRtLmPlugin (Kotlin) wrapping official LiteRT-LM API with queue-based inference, download support, and audio PCM conversion - Add GemmaLocalClient (Dart) with per-request engine init/teardown - Add GemmaModelManager with on-demand backend init: vision/audio backends only enabled when request contains image/audio content, engine rebuilt (with full teardown) when config changes - Engine rebuild happens after acquiring inference lock to prevent teardown while another inference is in progress - Add gemma_local provider type with model list (gemma-4-e2b/e4b) - Add download UI in model config pages (Android only) - Skip LLM data sharing consent for on-device models - asset_analysis_tool: use JPEG + 896px cap for Gemma 4 to avoid LiteRT-LM patch count overflow; non-Gemma path unchanged - pkm_skill/timeline_card_skill: use state factId as fallback when model-provided fact_id is unreliable - Upgrade drift 2.30→2.32.1, sqlite3_flutter_libs 0.5→0.6, drift_flutter 0.2→0.3
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
Add support for running Gemma 4 models fully on-device on Android using the official LiteRT-LM Kotlin API.
What's new
Android native layer
Dart layer
Provider integration
Other fixes
Dependency upgrades