ModelManager

interface ModelManager

The settings-screen-facing control surface for optional downloadable on-device models. Kept tiny on purpose (list / observe / download / delete). Backends that need no download (ML Kit Gemini Nano is managed by AICore; Foundation Models by the OS) don't appear here — only models the app fetches itself (MediaPipe Gemma) do.

Model binaries are NEVER shipped in the repo: download is user-triggered, wifi-only by default, into app-private storage.

Inheritors

Functions

Link copied to clipboard
abstract suspend fun delete(modelId: String)

Remove a downloaded model from app-private storage.

Link copied to clipboard
abstract suspend fun download(modelId: String)

Start (or resume) downloading modelId. Suspends until it completes or fails.

Link copied to clipboard
abstract fun models(): List<ModelInfo>

Current snapshot of every manageable model.

Link copied to clipboard
abstract fun observe(modelId: String): Flow<ModelInfo>

Observe one model's state (drives the download-progress UI).