Skip to main content
This path checks that the development build can open the runtime. It does not download a model, create a Cloud account, or start a remote server. scriptedModel replays responses you write in the source. It demonstrates the runtime. It is not AI inference. The same createRuntime, defineTool, and agent.start calls are what a Cactus agent uses later.
1

Open a runtime

sqlite() with no path stores larkx.db in the application documents directory.
2

Define one local tool and a scripted agent

The tool is pure, so an interrupted attempt may run again. The model asks for read_notes, then returns one sentence.
3

Start the run and read the result

Expected output

result.message is "Seal needs service." and result.finish is "stop". agent.start stores the run and starts its driver. run.result() waits for that driver. It does not start a second one. close() waits for in-flight steps and releases ownership. Do not call close() from an engine hook, and do not use that same runtime object after it resolves.

What this does not show

The sentence came from the script, not from a model download. A killed process does not keep running. To reopen the same database and see that the committed tool call is not repeated, follow Crash recovery. That page creates a new runtime. It does not reuse the runtime you just closed. Next, run a real local model in Your first on-device agent.