13
The model runs on the phone

DroidDoodle

An offline Android app where a small on-device language model rearranges a structured canvas through tool calls.

KotlinC++ on-device-aiagentic-aioffline-firstandroid
click to turn
A turn

Sentence in, constrained plan out, board rearranged. Replayed from the documented turn lifecycle.

Architecture in one picture
user text :core-agentsystem + toolsboard digestreference tablehistory + message prompt + GBNF rebuilt each turn :inferenceMockEngine — CIllama.cpp — device one constrained generation → a plan of tool calls :core-agentvalidateconfirmexecutehalt on failure :core-worldimmutable Boardgrid-snappedundo by reference the canvas DETERMINISTIC — NOT ASKED OF THE MODEL coordinates · referent resolution · validation · collision

Redrawn from the diagram in the repo’s own README.

The governing rule

The model contributes intent and structure. Coordinates, referent resolution, validation and collision belong to the runtime — if it can be determined deterministically, the model is not asked to infer it.

The hard part

The GBNF grammar is rebuilt every turn, so the model can only emit a syntactically valid plan against the ten tools and the entities currently on the board. Invalid plans are not parsed and rejected — they are made unrepresentable.

Execution then validates, confirms and runs the plan, halting on the first failure, against an immutable grid-snapped Board where undo is by reference.

What green does not mean

Packages P0–P6 are complete and green in CI — the whole pure-Kotlin agent core, running as JVM unit tests with no Android SDK, no emulator and no model file.

And the README refuses to let that stand as more than it is: “nothing has run on a device, no real model has produced a single plan, and the GBNF grammar has never been fed to llama.cpp.” Every plan the test suite executes was written by hand.

Outcome

DroidDoodle

Chapter 14
Santioni

A study of santionispirits.com — a 100% WebGL experience — rebuilt at two fidelity tiers.

continue
13 — DroidDoodle
scroll · drag · ← →