Skip to content
sysout.dev

Shared model-core integration

The source is owned by sysout-platform, in its model-core/ module. It was moved from Money O Money with its three relevant history commits preserved; the producer’s docs/model-core-history-map.tsv maps the original SHA-1 IDs to platform’s SHA-256 IDs. MOM and IMH consume the library rather than owning it.

In My Head declares dev.sysout:model-core:0.1.0 and resolves it through the Sysout GitLab Maven registry, following Homey’s consumer setup. 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.

Repository and authentication

settings.gradle.kts exclusively resolves the dev.sysout group from https://gitlab.com/api/v4/projects/87989353/packages/maven. It uses Job-Token with CI_JOB_TOKEN in CI, or Private-Token with the existing user-level Gradle property gitLabPrivateToken locally. Do not put credentials in this repository. The producer’s inbound job-token allowlist must permit IMH (84970820) where required, just as it permits Homey.

There is no implicit mavenLocal() fallback. Local publication checks may explicitly set -PsysoutMavenRepository=file:///absolute/repository/path; -Pci rejects this override so a clean-runner failure cannot be hidden by a workstation’s artifact. The dependency’s group, artifact, and version are unchanged.

Platform now builds and publishes model-core independently, using Gradle 9.5.0, AGP 9.3.0, Kotlin 2.4.10 and Compose Multiplatform 1.11.1. No runtime source was changed during the move. Its focused publishModelCore task avoids republishing the four existing Homey library releases.

On 2026-11-07, platform verification and an isolated local model-core publication passed. IMH then built its Debug app and test APKs, passed lint, and passed all 42 JVM tests against those artifacts. The local repository was selected explicitly; this is not evidence of a remote registry download or a device test. iOS builds and publication require a macOS host and were not validated here.

Platform’s protected-main publication pipeline 3039312496 subsequently passed on 2026-11-07. The root, Android and JVM metadata now return HTTP 200. IMH resolved the published artifacts with -Pci, refreshed dependencies and no local repository override; all 42 tests, Debug app/test APK builds and lint passed. This supersedes the earlier missing-publication prerequisite.

CI job-token access remains a separate setting: platform is private and its allowlist currently contains Homey, Little Bloomers and itself, but not IMH. Add sysout-dev/imh-project/imh-app (84970820) to platform’s CI/CD job token allowlist before expecting the hosted IMH verification job to download packages. The user-level token is read-only (read_api) and does not grant access to edit that setting.

Adding another model

To add a model such as Phi-4:

  1. Add a ModelSpec to the feature’s model catalog. Set a stable app-specific id, display name, compatible .litertlm filename, download URL, optional minimum size, and preferably a SHA-256 checksum.

  2. Choose an app-private destination and construct ModelDownloadManager(spec, path).

  3. Expose manager.state() to the feature UI. The UI can call startDownload() and cancelDownload() and map NotStarted, Downloading, Completed, Failed, and Cancelled to its own controls.

  4. Create the runtime with createTextGenerationModel(path), call initialize(), 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 sysout-platform repository for the complete API example and dependency setup.