Companion and local AI¶
Experimental on-device models
The read-only and safety boundaries apply to every provider. On-device LiteRT performance depends on the Android device and available memory.
AI Companion¶
Read-only architecture¶
flowchart LR
DATA[Tracking data] --> CTX[context builder]
CTX --> SNAP[read-only excerpt]
SNAP --> SVC[provider service]
SVC --> P1[On-device LiteRT]
SVC --> P2[Ollama or private endpoint]
SVC --> P3[Configured cloud endpoint]
P1 & P2 & P3 --> VAL[validate output]
VAL --> CHAT[visible answer]
VAL --> MEM[optional memory proposal]
MEM -. no write path .-> DATA
The provider receives no database access and no tools for changing check-ins, counters, relapses, tasks or settings.
Provider selection and consent¶
- Enabled and configured endpoints are checked by priority.
- External endpoints require explicit data consent.
- Fallback occurs only for allowed technical failures.
- A local failure never silently sends data to a server or cloud provider.
- Each endpoint receives only the excerpt assembled for the selected context budget.
On-device LiteRT profiles¶
The local provider uses LiteRT-LM Android and currently offers:
- Gemma 4 E4B with 2K, 4K or 8K total context and optional Thinking,
- Qwen3 4B Instruct 2507 with a 2K context and no Thinking.
Models are downloaded only after an explicit action, SHA-256 verified and excluded from backups. Generated chunks can stream into the response bubble, while only the completed visible answer is persisted. Internal thought output is not stored as answer text.
Thinking is exposed only for supported models or endpoint types. The Companion settings use the same conversation path for local and remote providers; model testing first checks provider status instead of duplicating a separate status action.
Context and local memory¶
Context can contain sparse time series, field schema, counter and reset history, dynamic events, task overviews, monthly aggregates, selected free text, confirmed local memories and local person profiles. In the Recovery build with program resources enabled, it may additionally contain explicitly approved Inventory entries. A coverage manifest describes what was included completely or in abbreviated form.
Durable insights can be proposed and stored locally in encrypted form. They can be reviewed in Settings, deleted individually or cleared completely. Disabling memory does not silently delete existing entries.
Brief acknowledgements such as “yes” or “exactly” continue an existing conversation without automatically sending the tracking-data excerpt again. If a provider repeats one of the recent answers almost verbatim, Steady requests a new continuation exactly once. If that response is still a duplicate, the app displays a short transparent follow-up question without new memory or evidence proposals.
Local LiteRT models can distinguish loading, thinking and visible response as real stream phases. Remote Llama/Ollama endpoints currently use non-streaming transport, so Steady does not invent a phase transition from an elapsed-time timer.
Deterministic safety boundary¶
A narrow set of acute high-risk phrases is checked by fixed local rules before a provider call. On a match, a predefined local response is used and the message is not sent to the provider. This boundary is deterministic and independent of the selected AI endpoint.