Hundreds of agents working unattended.One job API.

Run sandboxed agents in parallel on your own machine, without a costly fleet of hosted sandboxes. Send a task or a whole batch; get structured results your code can use.

500 jobs at once on one 4 GB Arm server, measured. How, and on what
$ npx elflodge stack start
Open source · MIT · TypeScript · 0.10.0, early (0.x)
one job · submit, wait, readreplay
customId
quickstart-1
id
not yet submitted
runs on
the Runner on your machine
input
Count the lines of this text: one, two, three
status
not submitted
3
output
one / two / three
A replay of the quickstart, not a live run.
1 · the agent

Define the agent once.

The lavender hat is the agent: instructions, an Output contract (a JSON Schema), a time limit and a model-spend limit. It sits on the desk and never changes.

2 · the inputs

Change the input. Each pairing is a job.

Every slip is a different question about a different CSV. Same hat, different colour: one agent, many jobs. Together they are a Batch.

3 · the canary

A few go first.

The Batch's first jobs, the Canary (five by default), run before the rest. If one of them fails, the Batch pauses, before you have spent anything on the others.

4 · your machine

They all fit in one house.

A Runner on your machine runs many agent loops in one process. Only their commands go into a small per-job sandbox.

How many? On one 4 GB Arm server, one Runner held 500 mostly-waiting jobs at once. Drawn to scale further down ↓

5 · the contract

Hand in JSON or fail.

An agent finishes by calling submit_output. The output is checked against your schema and errors go back to the agent to fix. No accepted output means the job fails (noOutput).

6 · morning

Read the answers when you are up.

batches submit --wait --output-dir results saves every output to results/output.jsonl, every failure to error.jsonl. A valid output can still be wrong, so every answer here brings back the script that produced it.

Illustration of one Batch.
Not a recording, not to scale.
  1. 1 · THE AGENTDefine the agent once.Instructions, an Output contract (a JSON Schema), a time limit and a model-spend limit.
  2. 2 · THE INPUTSChange the input.Each input paired with the agent is a job; together they are a Batch.
  3. 3 · THE CANARYA few go first.The first jobs (five by default) run before the rest; a failure there pauses the Batch.
  4. 4 · YOUR MACHINEThey fit in one house.Many agent loops per Runner process; commands in a per-job sandbox. Measured: 500 mostly-waiting jobs at once on one 4 GB Arm server.
  5. 5 · THE CONTRACTHand in JSON or fail.Outputs are checked against your schema; errors go back to the agent. No accepted output: noOutput.
  6. 6 · MORNINGRead the answers.One line per job in results/output.jsonl. Valid does not mean right: check the script.
Play with it

Same agent. Pick another input.

One agent answers questions about large CSVs by writing and running a script. Each job is a folder: a question and its CSV. Pick a question: the agent stays the same, and only the job and its output change.

unchanged
The agent defined once
{
  "instructions": "Answer the question in inputs/question.txt about the CSV beside it. Write and run a script to compute the figure; never estimate by eye. Submit the figure, the script you ran, and anything that could make it wrong.",
  "outputContract": {
    "schema": {
      "type": "object",
      "required": ["answer", "script", "caveats"],
      "properties": {
        "answer":  { "type": "number" },
        "script":  { "type": "string" },
        "caveats": { "type": "array", "items": { "type": "string" } }
      }
    }
  },
  "runTimeoutSeconds": 900,
  "modelBudgetUsd": 0.5
}
March refundsthe input
questions/refunds/
├─ question.txt
│    What was the total refunded in March 2026?
└─ refunds.csv
     date;order;amount
     2026-03-02;A-1041;120,00
     2026-03-02;A-1057;89,90
     2026-03-03;A-1102;
     …

jobs events, paraphrased · illustration

  • ·ran awk … inputs/refunds.csv → 1.240,00
  • ·called submit_output with "answer": "1.240,00"
  • ✗rejected: answer must be a number, got "1.240,00", sent back to the agent
  • ·converted the decimal comma, ran the script again → 1240
  • ✓called submit_output with "answer": 1240: accepted
✓ What came backjobs get
{
  "output": {
    "answer": 1240,
    "script": "awk -F';' 'NR>1 && $1 ~ /^2026-03/ { gsub(/\\./, \"\", $3); sub(/,/, \".\", $3); s += $3 } END { print s }' inputs/refunds.csv",
    "caveats": [
      "Amounts use a decimal comma and a dot for thousands; converted before summing.",
      "Three rows have an empty amount and were counted as zero."
    ]
  }
}
Schema-valid does not mean factually right. The contract makes sure an answer, a script and caveats come back. Whether the answer is true is still yours to check; rerun the script.
Try it · about three commands

The first answer is 3.

Start small and certain. The first job counts the lines of a three-line text, so you know the answer before you run it. When you see 3, your stack, your model login and the Output contract all work.

  • Docker (Engine 29+, Compose 5+), Node 22.19+ and jq.
  • On Ubuntu 24.04, run once first: sudo sysctl -w kernel.apparmor_restrict_unprivileged_userns=0. Ubuntu 25.04+ is not supported yet.
  • A model: the stack defaults to OpenRouter's free models, which still need an OpenRouter login or key. Any provider and model Pi supports works with --provider and --model.

Working with a coding agent? Install the Elflodge skill.

npx skills add elflodge/elflodge --skill elflodge-agent-batches

Try a batch document extraction workflow →

  1. Start a hub, a Runner and Postgres in the background.

    $ npx elflodge stack start
    # offers a provider login on first run
  2. Describe one job.

    $ cat > job.json <<'EOF'
    {
      "customId": "quickstart-1",
      "agent": {
        "outputContract": { "schema": { "type": "integer" } }
      },
      "input": "Count the lines of this text:\none\ntwo\nthree\n"
    }
    EOF
  3. Submit it, wait, read the output.

    $ ID=$(npx elflodge jobs submit --input job.json | jq -er .id)
    $ npx elflodge jobs wait --id "$ID"   # exit 1 unless it succeeded
    $ npx elflodge jobs get --id "$ID" | jq .output   # 3

If it is not 3, look here.

npx elflodge jobs events --id "$ID"
What the agent did, step by step.
npx elflodge stack logs --follow
What the hub and the Runner are saying.
npx elflodge stack stop
Stops the stack and keeps its data. stack delete removes the data, without asking.
The morning report · measured, drawn to scale

How many fit in the house? Five hundred.

The night above is a drawing. This one is to scale. Each house is the same server's 4 GB of memory. In one Runner, every open job costs about 6.3 MiB, so each little group drawn here is ten jobs. With one container per job (the same Pi agent, in a container of its own), each job costs about 100 MiB and gets a crate of its own.

Fig. 1 · one 4 GB server, two waysto scale by area
500 open · 3,150 MiB of 4,096
Measured on Elflodge 0.7.1 in November 2026 on one Hetzner CAX11 (Arm, 2 vCPU, 4 GB RAM, about €7 a month), one Runner, real commands in real sandboxes, the hub on another machine, model replies replayed from real recordings at 20× their recorded latency, standing for a slow model, so the provider does not set the limit. Jobs: extraction (read a messy invoice and submit JSON), which mostly wait on the model. The Runner's concurrency is a setting, RUNNER_MAX_JOBS (default 8); the benchmark raised it. Particular workloads on one machine, not a capacity guarantee; infrastructure cost only, not model tokens. The slider redraws the houses; it is not a live run. Method and results: docs/benchmark.md.
500jobs open at once on one Runner
about 16×more jobs on the same machine (about 30 with one container per job)
500 GBheld by 500 agents in their own 1 GB sandboxes; on one Runner they fit in a 4 GB server

When the jobs do real work. For CPU-heavy jobs (data scripts over large CSVs, code fixes with test runs) a Runner used 1.16–3.8× less CPU per job than one container per job: 1.16× for the heaviest, where the jobs' own work dominates.

Ballpark · a comparison of approaches, not of equal capacity

  • Small hosted agent sandboxes or serverless containers (1–2 vCPU, 1–4 GiB), 500 kept running for one night (8 hours), at public list ratesabout $160–$960
  • Shared-CPU microVMs, 500 for one night, with much less sustained CPUabout $40–$140
  • One 4 GB Arm server that held 500 of the measured jobs, for one nightabout $0.09

List rates read 2026-10-28, no provider named, scaled to 500 and 8 hours. Kept running all month for steady work, the 500 sandboxes come to about $15,000–$88,000, the server to about €7. Those environments each reserve far more CPU and memory than a job here uses; billing only actual CPU, or stopping environments between tasks, lowers their cost. Where billing follows elapsed time, an agent that waits 90% of the night still pays for the whole night.

Why they fit

An agent spends the night waiting.

Most of a job's life is waiting for the model to answer. Its commands are short. So one process can carry hundreds of agent loops, and only the commands need a sandbox. Waiting is cheap, not free: a waiting job still holds a few MiB, the server costs the same whether its agents wait or work, and model tokens are a separate bill.

Fig. 2 · one job, close upillustrative timing
waiting on the modela command in its sandboxsubmit_output
Fig. 3 · now stack them: one Batch, dusk to dawn
dusk48 not started0 waiting on the model0 running a command0 handed in JSON
Illustrative timing, not measured: 48 jobs drawn with made-up durations. The Canary (five by default) runs first; any Canary failure would pause the Batch, and after it more than 10% failed jobs pause it. The rest run together only as far as RUNNER_MAX_JOBS allows (default 8; raise it to hold more open).
Where the key lives

The model key lives in the house, and only there.

The agent loop runs inside the Runner and calls the model with the Runner's credential. Everything the agent executes (its shell commands and file access) runs one floor down, in a lightweight per-job OS sandbox: sandbox-runtime, bubblewrap on Linux, Seatbelt on macOS.

  • Credentials stay in the Runner. Provider login (account sign-in or API key) is offered on first start and saved in the Runner's volume. Model credentials stay in the Runner, outside every job sandbox. --env NAME forwards a named host variable, such as a provider key, to the Runner.
  • Job commands reach the public internet, not the Runner's host or your local and private networks.
  • The hub keeps the record. Events (what the agent did), usage and outputs are recorded there; Runners connect out to it. A Runner keeps each job's journal on disk, so after a restart it resumes jobs where they stopped.
  • The boundary you get: one organization, not hostile multi-tenant use.
the Runner · one processagent loops, many per processmodel keyhere, and only heremodel providerjob 1no keyno LANjob 2no keyno LANjob 3no keyno LANjob 4no keyno LANdownstairs: one OS sandbox per job, for its commands and filesthe Runner · one processagent loops, many per processmodel keyhere, and only heremodel providerjob 1no keyno LANjob 2no keyno LANjob 3no keyno LANjob 4no keyno LANdownstairs: one OS sandbox per job
Illustration of one Runner, not to scale.
Before you build on it

What it does not do yet.

Elflodge is early (0.x). These limits shape what you can build on it today; the full list is in docs/release-scope.md.