Public: anyone can read this; the crew can change it.

Hosting at every scale: hundreds of forges for cents, thousands without a forklift, free in the browser #16840

Closed opened this has it

Closed without the crew

opened this

Hosting at every scale: hundreds of forges for cents, thousands without a forklift, and a free forge that runs in the browser.

Owner, 2026-11-30: "could we host for cheaper then? could we make it viable to host hundreds of forges for cheap? what about thousands. im thinking of scale in terms of small and large. micro and macro" … "a way we could do free hosting without fronting the $. as long as the forge is clear to the user about what is going on."

What a forge costs today (measured 2026-11-30)

Today a sold forge is one VM, so every forge pays for a whole machine around the clock, though most forges sit idle most of the time. Measured on a fresh forge (current main, Bun 1.4.4, macOS arm64, empty data):

Cold start, empty data (migrations included)1.4 s to /healthz
Warm start0.5 s to /healthz; first page 55 ms
Memory, idle400 MB RSS, reached 1–2 s after boot; --smol makes no difference
Memory after 150 page requests404 MB
Where it goes (the forge's own memory line)JS heap 32 MB; mimalloc committed 357 MB
Data on disk4.7 MB
CPU when idle0.5%

On vxrail (Linux 6.12), the small forges the crew starts use 580–630 MB each, and production uses 2.2 GB.

So the JavaScript heap is small. Nearly all of an idle forge's memory is native allocation made while booting: most likely the 4,441 modules (25 MB of TypeScript) parsed at start, plus warm-ups (search, samplers, crew). A plain bun build --minify bundle comes to 10 MB, but it does not run yet, because the code reads source directories at runtime (readdirSync).

The ladder (each tier upgrades to the next by moving the same files)

  1. Browser: free, $0 to us. The forge runs in the tab: its TypeScript in the page's own engine, SQLite as wasm on OPFS, and a service worker acting as the server. Real Linux, where git, a shell or installs need it, comes from unkernel (the spike is already filed). The page says plainly what this means: it lives on this device, stops when the tab closes, others can't reach it, and here is the one button that moves it to a server.
  2. Shared and asleep: cents a month. Many forges on one machine, each asleep as files until a request wakes it.
  3. A dedicated machine: today's pinned forge.
  4. Your own cloud: connect → plan → build, on your bill.

Micro: density on one machine

  • Sleep and wake. A front router owns every forge's address. An asleep forge is a SQLite file and some git directories. The first request starts its process; the warm start is 0.5 s today, so the wake is under a second. After N quiet minutes the forge drains and sleeps (the drain already exists, FORGE_DRAIN_LINGER_S). The page says "waking…" honestly while it wakes.
  • Memory per awake forge is the lever. At 400 MB, the 8 GB Hetzner machine in our own catalog ($12.07 a month) holds about 16 awake forges. If 1 in 20 is awake at a time, that is about 320 forges, roughly 4¢ each a month. Cut it to 100 MB and the same machine holds about 1,300 forges, under 1¢ each. Both the active fraction and the cut still have to be measured.
  • Walls between neighbours. Each forge gets its own cgroup (CPU, memory, PIDs and IO caps, so no forge starves another), bwrap, and the Landlock floor (filed today) where bwrap can't run. vxrail runs 6.12, which I believe has Landlock ABI 6, so that is worth checking.

Macro: thousands across machines

  • One router for every address. It maps each forge to the machine holding it, wakes the forge, and holds the request until it answers.
  • Every forge streamed to a bucket. Each forge's SQLite and git stream continuously to object storage (the snapshots already exist; here they become continuous). Moving a forge or recovering from a dead machine becomes copy and start, and the router flips.
  • Placement. New forges go to the emptiest machine, and a busy forge can move. The router knows load from each machine's heartbeat.
  • Heavy work on a shared pool. Builds and checks run on shared runners sized for peak hours, not inside each forge.
  • Model tokens stay the person's own. Their own key or subscription grant, which the forge already supports. This is the one cost that never shrinks with density, so it must never become ours.

Phases

  • D1 Measure and cut boot memory (no infrastructure needed; it pays off at every tier, including today's VMs):
    • a memory budget test for an idle fresh forge;
    • lazy-load route and subsystem modules;
    • make the bundle run (no runtime readdirSync of the source), then try --bytecode;
    • keep optional warm-ups off until first use.

    Target: idle under 120 MB on Linux, then measure again.

  • D2 Sleep and wake for one forge behind a router on one machine: wake on request, sleep when idle, honest "waking" page, a 1 s p95 wake budget.
  • D3 Many forges on one machine:
    • a per-forge cgroup plus bwrap/Landlock;
    • per-forge ports or sockets behind the router;
    • a shared tier sold beside the dedicated one.
  • D4 Continuous backup and move: stream to a bucket, restore anywhere, flip the router; a test that kills a machine.
  • D5 Many machines: placement and heartbeat; a route table the router reads.
  • D6 Free in the browser (after the unkernel spike): wasm SQLite and OPFS, a service-worker server, plain words about what it is, and a one-click move to tier 2.

Principles

  • Plain words at every tier about where the forge runs, what it costs, and what happens when it sleeps.
  • Moving between tiers is a copy of the same files, never an export format.
  • No tier ever spends the person's money without a plan they saw (#16696).
  • Measure before claiming: every density number in a sales page comes from a test.

Related: #16696 (cloud builder), the Landlock floor, and the unkernel spike (both filed 2026-11-30).

2 earlier comments
commented

The runner split: lend, borrow, slide (owner, 2026-11-30)

"users running the forge could lend compute to others to use as check runners … my mac as a check runner … users could also just control their spend and slide for more runners. it could be even easier than vercel fluid compute and also crowdsourced! good metrics will be key for SLAs"

This is the macro half of "heavy work on a shared pool". Runners as they exist today are the right base (docs/features/runners.md): a runner pulls work with a URL and a token, nothing dials in to it, and it shares no disk with the forge. A Mac behind home NAT already works.

One slider, sources in order

Settings → Runners gets one control: how fast checks should be, against what you'll spend a month. The forge fills it from the cheapest source first:

  1. Your own machines (the forge's own runners, your Mac): free.
  2. Lent by people you trust (friends, your team): free, or paid in credits.
  3. Rented on your own cloud through connect → plan → build: ephemeral runners with a lifetime (#16699) that end when the queue is empty, so idle costs nothing. The plan shows the monthly ceiling before anything starts.
  4. The forge network's shared pool: crowdsourced lent capacity, metered. Each position on the slider shows its predicted queue wait and cost, from measured history. Never a guess.

Lending

  • A runner can serve more than one forge: its claim loop asks each forge it is enrolled in, with a share for each. Lending in v1 means enrolling your runner at a friend's forge with a share, and it can be ended at any time. In v2 the forge network matches lenders and borrowers.
  • Lent minutes earn credits, and borrowed minutes spend them. Any money price is the owner's decision.

Trust has two directions, and both must be explicit

  • The borrower's code on the lender's machine. Whoever owns the machine can read whatever runs on it. So a check goes to a lent runner only when its repository allows it (public, or private shared with a named circle), and secrets are never sent to a runner the borrower doesn't own. The page says this in plain words.
  • The borrower's code against the lender's machine. A lent runner runs strangers' code, so it must be contained: cgroups, bwrap or the Landlock floor, egress through the proxy only, and no access to the lender's home. A Mac can do none of that natively. A Mac lending to others runs checks inside a Linux VM, through Apple's Virtualization framework, or a wasm guest after the unkernel spike. A Mac running its owner's own forge's checks can run them as today.
  • Honest results. A lent runner could report a fake green. Results carry the runner's identity. A sample of jobs is re-run on a trusted runner, and disagreement drops the runner's score and pauses it. A check that gates a merge on a protected branch takes a trusted runner's result, or two agreeing runners'.

Metrics, which an SLA rests on

Measured per runner and per pool, shown on the runner page and the network's public board:

  • Queue wait: queued → claimed, p50 and p95.
  • Speed: run time normalized by a small reference benchmark each runner runs at enrolment and daily.
  • Availability: the share of the hours it said it would be there when it was connected.
  • Completion: jobs finished ÷ jobs claimed (lost, abandoned and timed out count against it).
  • Agreement: the share of sampled re-runs that matched.

An SLA states the tier, such as "own: best effort", "trusted lent: measured p95 wait", "rented: capacity you reserved" and "network pool: p95 wait under X, measured last 30 days". The number on a sales page is the measured one, linked to its board.

Phases (add to D-list)

  • R1 Runner metrics (wait, speed reference, availability, completion) on Settings → Runners and the terminal. They are useful today, before any lending.
  • R2 The Mac as a runner for its owner's forge (an agent is on this already). Report its numbers through R1.
  • R3 A runner serving several forges with shares, plus a "lend to <forge>" enrolment and the repository's opt-in for lent runners. No secrets go to them.
  • R4 Ephemeral rented runners from your own cloud behind the slider, with lifetimes and plans.
  • R5 Credits, sampled re-runs and scores, then the network pool and its public board.
commented

Too large for one run: 6509 characters, more than 6000. It is a person's ask and stays: the planner will split it into smaller issues before a builder starts it, and it is not dropped.

commented

Split: one run each, all P4. D1 boot memory: #16851 (budget test), #16852 (nothing optional loads at boot), #16853 (bundle, with --bytecode measured). D2 sleep and wake: #16854 (router wakes, "waking…"), #16855 (idle sleep, a setting). D3 many on one machine: #16856 (cgroup + bwrap/Landlock walls), #16857 (shared tier sold, numbers from a test). D4: #16858 (continuous stream to a bucket), #16859 (move + machine-kill test). D5: #16860 (heartbeat placement, route table). D6: #16861 (forge boots in the tab), #16862 (one-button move to a shared forge).

Sign in to join this conversation.

Search
↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs