Skip to main content
A runtime is where an agent runs. It starts the agent, watches it until it ends, steers it with messages, shows it to you, and stops it. piloop has two built-in runtimes. A Python package can add more. A project sets its runtime with the runtime key of piloop.toml. A role can set another one with its own runtime key. See Configure a role.

What a runtime does for you

Every runtime has the same contract. These commands work with every runtime. The runtime of the agent defines what each command does: When a runtime cannot do one of these, the command says so, and tells you where to look instead. In every runtime, the brief, log and transcript of an agent are in its log directory: ~/.piloop/runs/<run>/ for an agent that does a run, and ~/.piloop/workers/<worker-id>/ for the sweeping roles.

Built-in runtimes

The invocation is the argument list of a harness that the runtime starts. headless is a process without a terminal, with the first prompt in its arguments. interactive is a session in a terminal, and the runtime types the first prompt after the start. Some features of a harness depend on the invocation. For example, pi takes MCP servers only in its headless invocation.

Choose a runtime

  • subprocess is the default. It needs nothing more than the harnesses. piloop watch shows the output of each agent. Use it for a campaign that runs without you.
  • herdr gives each agent a terminal pane. You can read each agent, answer its dialogs and type into it. It needs Herdr. See In Herdr for the session, the workspaces and the tabs that piloop makes.
You can mix them: for example, runtime = "subprocess" for the project and runtime = "herdr" for research only.

Add a runtime

A Python package adds a runtime with an entry point in the piloop.runtimes group. The class implements the Runtime protocol. This runtime starts each agent as the subprocess runtime does, at a lower CPU priority:
Install the package in the environment of piloop. A project then sets runtime = "nice", or a role sets it in its own table. piloop init refuses a name that no runtime has. A name that a built-in runtime has already, a kind that is not the name of the entry point, or a class without an invocation is an error that names the entry point. piloop attach, piloop prompt, piloop doctor and piloop watch call the methods of the runtime, so they work with the new runtime at once.