Use case

Run your agents on a Mac mini or a Raspberry Pi.

The Mac mini under the desk and the Raspberry Pi in the drawer can run your agents' sandboxes for nothing. Annex uses them first and sends the rest to the cloud.

The problem

Sandbox bills grow with every agent, while perfectly good machines sit idle: a spare Mac, a server with room to spare, a Raspberry Pi.

Turning one into a safe place for agents to run code is real work, and it still wouldn't help on the day it is full.

How Annex does it

  1. Run one command on the machine

    It installs a small helper that calls out to Annex. Nothing on the machine is opened to the internet, and Annex never has a login there.

  2. Sandboxes start there first

    At $0 an hour your machine is the first choice, up to the limit you give it. Each sandbox is kept apart from the machine, your network and the others.

  3. The overflow goes elsewhere

    When your machine is full, the next sandbox starts on your next account. Add a second machine and it shares the load.

Walkthrough

Build it yourself, part by part.

A Mac mini under a desk or a Raspberry Pi on a shelf is a real computer that costs nothing more to use. Connected to Annex, it becomes the first place your agents' sandboxes start, with your cloud accounts taking over only when it is full.

Nothing about your code changes. Every other walkthrough on this site runs at home as it is, because where a sandbox runs is Annex's decision, not your program's.

Your Raspberry Pi$0 an hour · tried firstFull at fourYour other accountstake what is left

The whole thing is one command, and a 19-line script to prove it. Get the code →

  1. Connect the machine

    In the dashboard, under Connections, choose Your own server and run the one command it shows on the machine. It installs a small helper that connects out to Annex, so nothing on the machine is opened to the internet and your router is left alone.

    The machine then appears beside your other accounts with a rate of $0 an hour and a limit on how many sandboxes it runs at once. A Linux machine needs a 64-bit system; a Mac needs Apple silicon and macOS 26 or later.

  2. Watch it fill up and spill over

    This script starts sandboxes one at a time with the route cheapest and prints where each one landed. Your machine costs nothing, so it is chosen first. Once it is at its limit, the next sandbox goes to your next-cheapest account without the script knowing or caring.

    spill.mjs

    const count = Number(process.argv[2] || 4)
    const started = []
    try {
      for (let i = 1; i <= count; i++) { // one at a time, so each sees the ones before it
        const sb = await annex.start({ route: 'cheapest', vcpu: 1, memory_gib: 1 })
        started.push(sb)
        const host = (await annex.run(sb.id, 'uname -nm')).output?.trim()
        console.log(`${i}. ${sb.provider.padEnd(12)} $${(sb.rate_per_hour_micros / 1e6).toFixed(4)}/h  ${host}`)
      }
    } finally {
      await Promise.allSettled(started.map((sb) => annex.stop(sb.id)))
      console.log(`stopped all ${started.length}`)
    }

Before you rely on it

  • Whoever controls the machine can see what its sandboxes do, including any secrets you give them. Use a machine you trust.
  • One sandbox can fill the machine's disk. Keep an eye on it, or give sandboxes a machine of their own.
  • A machine that is switched off is skipped, and its work goes to your other accounts until it is back.

Get the code on GitHub

Related use cases