model-graph

Run a micro model as an agent — in your browser.

A finite state machine drives a language model through an explicit agent loop — think → decide → call a tool → observe → repeat — and you watch it move through every state, live. The model runs entirely on your device (WebGPU via transformers.js); the tools run in this page. Nothing is sent to a server.

Reality check: the micro models here (135M–500M) are at the very edge of agentic ability. They will often ramble, loop, or ignore the format — and the harness shows you exactly where and how they break. That is the lesson. Press Watch a scripted demo first (step 3) to see what a clean run looks like — it needs no GPU and no download — then run a real model and watch it struggle. Nothing is faked: a real run that fails is shown as a failure.

1 Pick a micro model

SmolLM2 · 135M

135M params~90 MB q4 fastest

Fastest to load. It almost always rambles instead of emitting a tool call — the clearest look at why structured output is hard at 135M.

click to load in your browser

SmolLM2 · 360M

360M params~230 MB q4 balanced

A little steadier than 135M, but it still usually misses the tool format.

click to load in your browser

Qwen2.5 · 0.5B

500M params~340 MB q4 best shot

Your best chance at a real tool call here — still slips often. Give it a single-tool task.

click to load in your browser

Server · LFM2 · 1.2B

1.2B hookedMPS/CUDA capable

The hooked Python model (needs api_server.py). Tool-trained and capable — this is where a real agent loop actually succeeds. Full per-layer internals stream in the chat.

click to connect to the server

2 Pick a task & tools

step cap

3 Watch the machine run

tool call no action final answer observe → think give up retry task think route? act · tool observe guard stop answer done
idle — pick a model, then Run
the harness

What drives a tiny model

Each state is a decision point. The harness — not the model — owns the control flow: it prompts, parses, runs the tool, and feeds the result back. That scaffolding is what lets a 135M model act like an agent.

The run appears here, turn by turn — each labelled with the state that produced it.

state transitions

  1. no run yet

Want the per-layer internals behind these tokens — norms, logit lens, attention, residual trajectories? Open a task in the chat (same in-browser engines), or read the intro for how transformers work under the hood.