Skip to content

feat(mobile): add on-device Gemini Nano to Quick Chat on Android - #7326

Merged
iscekic merged 6 commits into
igor/quick-chat-apple-modelfrom
igor/quick-chat-android-model
Oct 10, 2026
Merged

iscekic merged 6 commits into
igor/quick-chat-apple-modelfrom
igor/quick-chat-android-model

Conversation

@iscekic

@iscekic iscekic commented Oct 9, 2026 •

Copy link
Copy Markdown
Collaborator

Changelog for users

  • Quick Chat on Android can use Gemini Nano on the device through Android AICore. The option appears only when the system model is available.
  • When the model is downloadable, Chat backends settings offer a "Download on-device model" action with progress. The download never starts automatically.
  • Unavailable reasons have fixed copy: unsupported device or Android version, AICore missing or out of date, download required or in progress, battery quota exceeded.
  • On-device inference runs only in the foreground. Leaving the app stops the answer with a clear message, and Retry works after returning.
  • No fallback to Kilo or another backend.

Changelog for maintainers

  • Add the Android-only Expo local module modules/kilo-android-model over ML Kit GenAI Prompt API (com.google.mlkit:genai-prompt:1.0.0-beta2, genai-common:1.0.0-beta3). Newer betas ship Kotlin 2.3 metadata, which RN 0.86's Kotlin 2.1.20 cannot read.
  • The app keeps minSdk 24. The module manifest uses tools:overrideLibrary for the two GenAI libraries, and the module returns unsupported_os below API 26 before loading them.
  • Native fixes from review: availability no longer takes the inference slot, background no longer cancels the system download, OnCreate no longer clears the foreground flag, and output tokens are capped by the documented token limit.
  • Register the android provider and its reason codes in the shared on-device registry from feat(mobile): add on-device Apple Foundation Models to Quick Chat #7325.
  • The background-stopped sentence references the Retry button label as $t(common.retry) in every catalog.
  • Translations for all 87 catalogs.

Verification

  • Android debug build with the module: expo prebuild and assembleDebug succeed with minSdk 24 and the manifest override, and the app installs on the API 35 emulator.
  • On the emulator (no AICore) the settings sheet shows Gemini Nano (on device) — Not available with the honest reason, and the existing custom backends still work. Reported as unavailable rather than crashing is the expected emulator result.
  • Focused tests: reason mapping (unavailable, busy, background, failed), user-initiated download with progress and failure, option gating, background then Retry, no fallback.
  • Mobile lint, typecheck, unused-code check, catalog check, formatting, and the chat suites pass.
  • Not covered: inference on a Gemini Nano device (a Pixel with AICore). The emulator cannot provide it; the API surface is exercised only up to the availability answer.

Stack

@iscekic iscekic self-assigned this Oct 9, 2026
Comment thread apps/mobile/src/i18n/locales/en.json Resolved
@kilo-code-bot

kilo-code-bot Bot commented Oct 9, 2026 •

Copy link
Copy Markdown
Contributor

Code Review Summary

Status: No Issues Found | Recommendation: Merge

Executive Summary

The incremental change makes modelChat.localModels.background reference $t(common.retry) in all 87 locale catalogs, resolving the previous hardcoded-button-label finding; no new issues found. common.retry exists in every catalog and the nested $t() pattern matches the repo convention.

Files Reviewed (87 files)
  • apps/mobile/src/i18n/locales/*.json (87 catalogs)
Previous Review Summary (commit cc6a1c4)

Current summary above is authoritative. Previous snapshots are kept for context only.

Previous review (commit cc6a1c4)

Status: 1 Issue Found | Recommendation: Address before merge

Overview

Severity Count
CRITICAL 0
WARNING 0
SUGGESTION 1
Issue Details (click to expand)

SUGGESTION

File Line Issue
apps/mobile/src/i18n/locales/en.json 3307 modelChat.localModels.background copy hardcodes the "Retry" button label instead of $t(common.retry)

Fix these issues in Kilo Cloud

Files Reviewed (103 files)
  • apps/mobile/modules/kilo-android-model/** (Kotlin module, build.gradle, manifest, expo-module.config.json)
  • apps/mobile/src/lib/chat/android-model-download.ts
  • apps/mobile/src/lib/chat/android-model.test.ts
  • apps/mobile/src/lib/chat/local-model-error.ts
  • apps/mobile/src/lib/chat/local-models.ts
  • apps/mobile/src/lib/chat/native-model-client.ts
  • apps/mobile/src/lib/chat/native-model-client.test.ts
  • apps/mobile/src/components/chat/backend-settings-sheet.tsx
  • apps/mobile/src/components/chat/model-download-control.tsx
  • apps/mobile/src/i18n/locales/*.json (87 catalogs) - 1 issue
  • apps/mobile/README.md

Reviewed by deepseek-v4.1-flash · Input: 40.3K · Output: 5.3K · Cached: 224K

Review guidance: REVIEW.md from base branch igor/quick-chat-apple-model

@iscekic

iscekic commented Oct 9, 2026

Copy link
Copy Markdown
Collaborator Author

Android emulator evidence (API 35, debug build from this branch): the settings sheet reports the on-device model and its reason without crashing, and the custom backends are unaffected. The emulator has no AICore, so this is the expected unavailable state; real inference needs a Gemini Nano device.

Gemini Nano reported as unavailable on the emulator

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.

2 participants