Use cases
Bring your own model or agent loop
Some developers want their own loop: their model, their prompt, their budget, and a phone at the end of it. Silan’s Examples/agent-loops folder has three small, complete phone agents that do exactly that. Each one starts silan mcp, the same MCP server the plugins use, hands the model Silan’s tools as MCP lists them, and uses Silan’s public skills as the system prompt. Every call goes through the engine’s safety rules, so your loop asks before it pays or sends and never sees a password, like any other client.
A worked example
Section titled “A worked example”You run a local model server on your Mac and want it to drive your phone. From a copy of the repository:
cd Examples/agent-loopspython3 open_model_loop.py "Open the Clock app and start the stopwatch" --model <local model> --device ios:<device id>The loop finds the silan command inside Silan.app, starts silan mcp, reads the silan and silan-safety skills into the system prompt and sends the model the 16 tools of the core profile. On the first tool call Silan asks you whether this program may use your devices. You press Allow. The model calls observe, gets the element list of the Home Screen, calls launch_app for Clock, then tap on the words Start. Your terminal prints each tool call and its result, and the live picture in Silan shows the stopwatch running. Without --vision the model works from element lists only, which suits small models best with one short task.
With a Claude API key, claude_loop.py does the same on the Claude API and keeps only the newest three screenshots in the conversation to save tokens. With an OpenAI key, openai_loop.py runs any Responses API model with function calling and lets the API keep the conversation between turns.
- Install Silan and set up a device (Install and quickstart). Get its id with
/Applications/Silan.app/Contents/Helpers/silan devices. - Get a copy of the repository and open
Examples/agent-loops. - Pick a loop.
claude_loop.pyneedspip install anthropicandANTHROPIC_API_KEY.openai_loop.pyneedspip install openai,OPENAI_API_KEYand--model.open_model_loop.pyneeds nothing beyond Python and a running OpenAI-compatible server such as Ollama, LM Studio, llama.cpp or vLLM. - Run it with the task in quotes and
--device. Without--device, the model callslist_devicesand picks one. - Give the model more tools with
--profile testing(27 tools) or--profile full(45 tools on the current release) when the task needs recordings, installs or the built-in agent (Use Silan from your agent). - Press Allow when Silan asks about the program, answer ask cards in Silan, and press Control Option Command Period to stop everything.
The offline tests in Examples/agent-loops/tests check how the loops find silan and read the skills, with no key and no network. The last test drives the real silan mcp against a running engine and a real device when you set SILAN_CLI, SILAN_URL, SILAN_API_KEY and SILAN_TEST_DEVICE.
For a program that is not Python, the same tools are on the engine’s REST API at http://127.0.0.1:47800/v1 with a key from Settings › Connections, and any MCP client can use The setup text for other apps from the same page (Connections, API).
What is supported today
Section titled “What is supported today”| What | Status |
|---|---|
A phone agent on the Claude API from claude_loop.py |
Supported |
A phone agent on any OpenAI Responses model from openai_loop.py |
Supported |
A phone agent on a local OpenAI-compatible server from open_model_loop.py |
Supported |
| Silan’s safety rules and the Vault for every loop | Supported |
| The loops run against a real phone | Not yet proved. Their proof was on a Mac with no phone attached |
| A published Python library | Coming soon. It lives in the repository at SDKs/python and is not published |
| Headless use on a CI machine with no Silan window | Coming soon |