TokenForge
The factory must grow. The text must flow.
A browser factory-building game where text is the resource. Packets of words ride conveyor belts through machines that split, template, regex, script, and LLM-transform them โ until your factory is a living pipeline of language machines.
runs entirely in your browser ยท MIT licensed ยท zero deps, zero build step
one packet per tile, one tile per tick โ backpressure included
Features
Heavy industry for light reading
Everything is a physical building on a grid. If it computes, it has a footprint, ports, and a queue.
Belts & machines
Lay conveyor belts, rotate machines, mind your in-ports and out-ports. Full belts jam, queues back up, and your beautiful factory grinds until you re-route the flow.
Prompt Forge โ real LLMs, your key
Drop LLM machines into the line. Bring your own key โ OpenAI, Anthropic, OpenRouter, or
any compatible endpoint. Keys live in your browser's localStorage; calls go
straight to the provider.
Script Engine
A building that runs your JavaScript in a sandbox โ packet in, code runs, packets out. For when regex isn't enough and an LLM is too much.
Agent Core + Toolbox
Build tool-calling agents out of bricks. Any tool building touching an Agent Core becomes one of its tools โ and docking agents together turns them into sub-agents.
Fully playable offline
The deterministic Mock LLM ships in the box: translate, classify, summarize, haiku โ no network, no key, no account. Same factory, swap in a real model whenever you like.
Headless API mode
Any factory doubles as a text-processing endpoint. Run your blueprint from Node or behind HTTP: packets in through the API Inbox, results out the Delivery Depot.
How it plays
Place. Wire. Watch it flow.
Place machines
Pick a building, drop it on the grid, rotate it so the ports face the right way. A freshly placed machine works out of the box.
Wire the line
Run belts between out-ports and in-ports โ or butt machines directly against each other and skip the belts entirely.
Watch it flow
Hit run. Packets march one tile per tick, machines chew through their queues, and the Signboard shows you what just went past.
Campaign mode: learn by shipping orders. Each level hands you a text-processing contract โ deliver the goods and you unlock the next tier of machinery, from humble belts all the way up to agent swarms.
Machine gallery
The catalog
A sampling from the factory floor. Every machine has ports, a config panel, and an opinion about backpressure.
Text Well
Emits a configured text packet on a timer. Where all words begin.
Case Forge
Hammers text into UPPER, lower, or Title Case. Honest work.
Splitter Saw
Rips one packet into many along a delimiter. Mind the sawdust.
Templater
Slots incoming text into a fill-in-the-blanks template.
Regex Lathe
Turns text on a pattern โ find, replace, extract with precision.
Switch Yard
Routes packets down different tracks based on what they say.
JSON Smelter
Melts raw text into structured JSON and pours out the fields.
Math Mill
Grinds numbers: sum, count, compare. Text in, arithmetic out.
Prompt Forge
The LLM furnace. System prompt in the config, transformed text out the port.
Sorting Sage
An LLM classifier that reads each packet and points it at the right exit.
Script Engine
Runs your sandboxed JavaScript on every packet. The duct tape of the factory.
Agent Core
A tool-calling agent whose tools are whatever buildings you dock against it.
๐ Your keys never leave your machine
API keys are stored in your browser's localStorage and sent directly to the provider you chose โ OpenAI, Anthropic, OpenRouter, or any compatible endpoint. There is no TokenForge server in the middle, no telemetry, no account. Don't want a key at all? The offline Mock LLM plays the whole game, deterministically.