Skip to content

Repository files navigation

AI On-Device Android

CI License: MIT

Reference architecture for on-device AI inference on Android — clear boundaries between UI, inference, and optional cloud fallback.


Overview

Demonstrates how to structure on-device ML without coupling Compose UI to a specific model runtime:

Layer Responsibility
UI SummarizeScreen — input, loading state, result
Inference boundary OnDeviceSummarizer interface
Implementation LocalTextSummarizer (deterministic, no network)

Swap LocalTextSummarizer for:

  • Gemini Nano (AICore on supported Pixel devices)
  • ML Kit GenAI APIs
  • ONNX Runtime Mobile / TensorFlow Lite

Architecture

Compose UI  →  OnDeviceSummarizer (interface)  →  Model runtime (pluggable)

No API keys required for the sample. Processing runs entirely on-device.


Build

./gradlew assembleDebug
./gradlew testDebugUnitTest

Related work

License

MIT — see LICENSE.

About

On-device AI inference architecture for Android — pluggable model boundary

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages