Most articles about AI and jobs give you one number ("300 million jobs exposed!") and no way to check it. I wanted the opposite: a model where every figure can be traced back to its data and assumptions, and where anyone can change those assumptions and see what happens.
That turned into three browser simulators and a free book, The ReplaceMind. This post is about how the tools are built.
The economic model runs in your browser tab
The core is a macroeconomic model in plain Python and NumPy: about 1,500 lines that simulate three regions (advanced, emerging and low-income economies) from 2026 to 2046, with AI and robot adoption curves, labor demand, wages, unemployment and public finances.
I didn't want a server, so the Economy Model page loads Pyodide (CPython compiled to WebAssembly), installs NumPy, fetches the model's .py files and imports them like a normal package:
py = await loadPyodide();
await py.loadPackage("numpy");
const texts = await Promise.all(FILES.map(f => fetch("py/" + f).then(r => r.text())));
// write each file into Pyodide's virtual filesystem, then:
py.runPython("import sys; sys.path.insert(0, '/home/pyodide'); import dashboard");
From there, JavaScript calls Python functions and gets JSON back. You can fix any of the 21 parameters, pick a policy (retraining, an AI dividend fund, profit-sharing, a slower rollout…) and rerun a Monte Carlo of 4,000 draws, all on your own machine. The first load is a few seconds while Pyodide downloads; after that it's fast.
What I like about this setup: the code that produced the book's numbers is the same code you run in the page. Not a JavaScript rewrite, not a summary. The same files.
A world map of social tension
The third tool asks a question the model doesn't answer directly: where will replacing human work create the most social pressure?
The rule is deliberately simple and written on the page:
- work taken by AI and robots in a region, from 19 professions weighted by employment;
- split among countries by how much each adopts AI and robots;
- multiplied by
1 + 0.5 × starting risk / 100, where starting risk comes from the World Bank's political stability index; - growing at a quarter of the speed until robots take 3 points of work, at full speed after.
It's drawn with d3 and topojson: 207 countries, the 50 US states plus DC weighted by their own job mix (BLS data), and large cities for China, Russia, Canada, Australia, Brazil and India.
The result surprised me. The biggest increases are not in fragile states but in rich ones, where machines replace the most work:
[IMMAGINE: social_tension_2046_US_EN.png]
It's an index, not a forecast of riots, and the page says so. But it makes a point that single headline numbers hide: the effect depends on where the machines actually go.
One source of truth
The part that took the most discipline: the book, the simulators and the analysis all read the same JSON files produced by the same Python module. If I change an assumption, I regenerate the outputs, and the book's tables, the job simulator and the map all change together. No numbers typed by hand into a chapter.
The boring but useful parts
- Static site on Cloudflare Workers with static assets; a tiny Worker only for downloads.
- The download counter is a Durable Object that stores one number per file and per day: no IP, no cookies. Search engines and AI assistants (GPTBot, ChatGPT-User, Claude-User…) are counted apart from readers, which on day one turned out to be about a third of all downloads.
- Bilingual (Italian and English) with a 60-line i18n helper instead of a framework.
What I'd like feedback on
The model has assumptions I'm not sure about, and I'd rather hear criticism now:
- the adoption curves for AI and robots, by region;
- how much of each profession's work can actually be replaced;
- the social-tension rule, which is a choice, not an estimated coefficient.
Try it: thereplacemind.com
The book (free, PDF and EPUB, Italian and English): thereplacemind.com/book
Code and data: github.com/0xENX/aimodel_replication

Top comments (0)