Shared model-core integration
In My Head consumes dev.sysout:model-core:0.1.0 from local Maven. The shared
module owns model-artifact mechanics and the Android LiteRT-LM runtime seam;
In My Head owns model selection, prompts, transcript cleanup policy, and the
Settings/Record UI.
Adding another model
To add a model such as Phi-4:
-
Add a
ModelSpecto the feature’s model catalog. Set a stable app-specificid, display name, compatible.litertlmfilename, download URL, optional minimum size, and preferably a SHA-256 checksum. -
Choose an app-private destination and construct
ModelDownloadManager(spec, path). -
Expose
manager.state()to the feature UI. The UI can callstartDownload()andcancelDownload()and mapNotStarted,Downloading,Completed,Failed, andCancelledto its own controls. -
Create the runtime with
createTextGenerationModel(path), callinitialize(), create a session with the app-specific system instruction, and close the session/runtime when finished.
The manager downloads to a .part file, supports HTTP range resume, and only
promotes the final file after validation. A consumer may use the optional
ModelDownloadCard or provide its own row-based Settings UI. In My Head uses
its own Settings controls so Whisper and Gemma can be presented as separate
models while sharing the same manager behavior.
The model runtime is deliberately not a categorizer, cleaner, or speech
engine. Prompts and response parsing stay in the consuming feature. See the
model-core README in the Money O Money repository for the complete API
example and dependency setup.