Instances and fleets

Instances and fleets

By default every run gets a fresh sandbox that is removed afterwards. When an agent should stay online, keep what it installed, or hold one long conversation, run it on an instance instead.

Instances

An instance is a long-lived machine. It keeps its disk, the tools installed in $HOME and the harness conversation between runs, and can be stopped, started, snapshotted and terminated. Instances are free during the beta; the model tokens of the runs on them are charged as usual.

lgr instances launch desk --agent oncall --size lgr.medium
lgr send desk "Check the error rate on the checkout service"
lgr send desk "Now roll back the last deploy if it is above 5%"   # same conversation
lgr send desk --new "Start over: what changed today?"

An instance launched with --agent serves that agent: each message is a run of the agent's live version on the instance, and the conversation carries on across messages unless the message asks for a new one. Pin a version with --agent oncall@v3, or change the agent later with lgr instances agent desk support-bot (none detaches it). The instance prepares the agent once per version instead of on every run.

Command
lgr instancesList instances with their state, uptime and cost
lgr instances stop deskStop it; the disk and conversation are kept. Refused while runs are active.
lgr instances start deskStart it again
lgr instances snapshot desk --profile goldenSave its disk as a profile version
lgr instances terminate deskTerminate it and delete its disk

In the console, instances and fleets are under Compute in the sidebar, where you can send them messages. An agent's Instances tab lists the ones serving it and launches new ones for it.

A resource bound to a Paused or Removed agent cannot accept new messages, start, or expand into new instances. The console shows the reason and keeps Stop, detaching, and scaling down available where the resource's own state permits them. Pausing an agent does not stop its machines. Detaching also does not stop a machine or its own triggers: without a bound agent, those messages use the default harness with no agent instructions. Review the resource's triggers when changing its binding.

Before saving a binding change, the console loads the current resource state and its triggers, including member-instance triggers for a fleet. Confirm that the resource and these plans are being kept and will be managed or deliberately handed over separately. Enabled plans can run immediately under the new binding, even if the previous agent's pause had blocked them. A changed preview clears this confirmation and must be reviewed again; a failed read is not shown as an empty plan list.

Sizes

SizevCPUMemory
lgr.small12 GiB
lgr.medium24 GiB
lgr.large48 GiB
lgr.xlarge816 GiB

lgr.medium is the default. Every size is free during the beta; model tokens on platform models are charged as usual.

Fleets

A fleet is a group of identical instances. Messages go to the least busy running member, and each message starts a new conversation by default.

lgr fleets create desk-pool --desired 3 --agent support-bot --size lgr.small
lgr send --fleet desk-pool "Where is order 1057?"
lgr fleets scale desk-pool --desired 5
lgr fleets delete desk-pool

Scaling down removes idle members, newest first. Fleets don't scale on their own yet, and a member that fails isn't replaced automatically.

Scaling down permanently deletes removed members and their disks. The console requires explicit disk-deletion confirmation; desired 0 removes all members rather than preserving them in a paused state. Agent removal never performs this operation for you.

Profiles

A profile is a saved environment for on-demand runs: workspace, tools installed in $HOME, harness state and environment variables. A run on a profile restores it first and saves a new version afterwards, so setup only happens once.

lgr profiles create dev --setup "npm i -g pnpm" --env NODE_ENV=development
lgr run --profile dev "Set up the repo and run the tests" --repo github.com/acme/app
lgr run --profile dev --continue "Now fix the failing test"
lgr profiles rollback dev --version 3

--continue resumes the harness conversation stored on the profile, and --no-persist runs on it without saving a new version. An instance can be launched from a profile with --profile.

Triggers

Schedules and webhooks can message an instance or fleet instead of starting a fresh run: create them with --instance NAME or --fleet NAME.