Project file · labib-ai
Labib AI
OngoingApp
Executive summary
An Android app that runs fully offline: the model is an external file imported onto the device, the licence is verified locally with an Ed25519 key, and the admin console is separate and takes no part in generating an answer.
Context and challenge
Where there is no network, or where data must not leave the device. The app takes a model file and a signed licence, then runs with no connection; Supabase is used for administration and operational data only.
The real work was proving the model runs on the device: its file is larger than an app file can carry, the right to run it has to be checked without internet, and distribution passes through devices with no store — the chat interface is the easy part of that road.
The approach
- 01
The model file lives outside the app: a .litertlm file is imported from the device, so the installed app stays small and the model is not downloaded again with every update.
- 02
The licence is signed with an Ed25519 key and checked on the device against its registration, so the app runs with no connection and the licence is read once.
- 03
Separated responsibilities: domain/application/data/ui modules inside one Kotlin app (Compose, Room, Tink, LiteRT-LM), and an admin console on Next.js and Supabase that stays out of the inference path.
Scope of work
In scope
A complete Android app: on-device chat, model and licence import, local encryption, and an admin console with tests.
Out of scope
An app store: distribution today is an APK installed by hand.
Server-side inference: Supabase is for administration and operational data only.
What we built
- 01
On-device chat with a Gemma model through LiteRT-LM, on a Jetpack Compose interface.
- 02
Offline import of the model and the licence, Room storage, and local encryption through Tink.
- 03
Ed25519 licence checks and device registration with no connection.
- 04
An admin console on Next.js 15, React 19 and Supabase, with a Vitest suite that reached 374 passing tests.
Decisions
- 01
The model stays out of the app fileThe alternative was carrying the model inside the APK. Rejected because the file is too large to download again with every update; it is imported once and stays on the device.
- 02
Verification on the device, not a serverThe project requires working with no network, so proof of rights became a public key on the device instead of a server call that would stop the app at the first outage.
- 03
A separate admin consoleEverything could have been managed inside the app. It was separated because administration is operational data: it should not sit in the answer path, nor cost the app a connection.
Outcome and status
Chat, flow and on-device inference build successfully, inference speed was improved, licensing and encryption are in place, and the admin console works. The build available to download today is 1.3.1. What remains is written plainly: testing the real Gemma model on a device over USB — fetching the file, interrupted download, keeping versions, and answer quality — then finishing distribution over Bluetooth and Wi-Fi.