The tools namespace
RunAnywhere.llm.tools carries register, unregister, and list.
Defining a tool
Controlling the loop
Tools registered through
tools.register are offered to every generation. Tools passed in
options.tools apply to that call alone.
Executors run in the main process
This is what Electron has over the browser and the phone. A tool executor here has the full Node API: the filesystem, child processes, the network with no CORS, and any native module you have installed.Watching the calls happen
The stream reports tool activity, which is what lets you show “checking the weather…” rather than a stalled cursor:Which models can do this
Tool calling needs a model with enough context to hold the tool definitions. The SDK gates on context length rather than a model allowlist, so any model with a large enough window can participate, though instruction-tuned models trained on tool use do it far more reliably. A desktop can afford a largercontextLength at load time, which helps here.