Docs· Understand it

Why Lifo

View as Markdown

Coding agents write programs. Somebody has to run them: install the packages, start the dev server, show the preview, run the tests. The usual answer is a cloud sandbox, a small VM per user or per session, booted on demand and billed by the minute.

Lifo is the other answer for a lot of that work: run it where the user already is. A Lifo box is a small Unix-like system written in TypeScript, so it runs inside the browser tab (or the Node.js process) that needs it, boots in milliseconds and costs nothing to keep around.

What it's good at

  • Previews of generated apps. An agent writes a Vite or Expo app; the box installs and runs it in the user's tab and the page shows it. No server per user.
  • A shell for an agent. One bash tool backed by a box: the agent runs commands, reads files, starts servers, and the box is thrown away afterwards.
  • Interactive docs and tutorials. A real terminal in the page, with no backend.
  • Tests and scripts that need a filesystem, a shell or a fresh node_modules without touching the real disk.
  • Moving between client and server. The same box runs in the browser and in Node, and a snapshot moves it from one to the other.

What it isn't

  • Not Linux. It reimplements the Unix and Node.js APIs in TypeScript. It doesn't run Linux binaries, so no apt, gcc or native npm addons. WebAssembly builds of tools do run: esbuild, ffmpeg, and CPython through Pyodide (Python: pure-Python and Pyodide-built packages only, no native extensions).
  • Not a security boundary. Programs in a box are kept apart from each other, not from the page or process that runs the box. See Security and isolation.
  • Not a full Node.js. The Node.js layer covers what real projects use (fs, http, streams, child_process, crypto and more) and grows as projects need more; some corners are missing. See Limitations.

When you need real Linux, real isolation or native binaries, use a cloud sandbox. Lifo and a cloud sandbox work well together: the box handles everything that runs fine in the tab, and the cloud only gets the work that needs it.

How it compares

LifoWebContainersCloud microVM (E2B, Vercel Sandbox, ...)
Runs ina browser tab or your Node processa browser taba VM in someone's cloud
Cold start~27 ms in a tab, under 1 ms in Node~6.6 s~150 ms to seconds, plus the network
Size~0.3 MB~75-85 MBa VM
Needs special headers (COOP/COEP)noyesn/a
Node.js fidelitya compatibility layercloser to real Nodereal Node
Isolationnone from the host page or processthe browser's, in a workerhardware
Cost$0commercial licenseper use
LicenseMITproprietaryservice

The Lifo and WebContainers cold starts are measured with bench/ in this repo, in the same browser; WebContainers' size and the cloud figures are the vendors' own. See Performance.

Edit this page on GitHub