Wiki race: Jev walks Wikipedia link by link

Date: 2026-09-19  ·  Code: wiki/wiki.mjs  ·  Page: http://localhost:3001 when the server runs  ·  Model: typesafe-ai/jev through the Vercel AI Gateway

1. What Jev decides

From the links on the current Wikipedia page, which one leads to the target article in the fewest hops. One choice question per hop. The link titles are the option names; the descriptions are empty strings, so Jev reads only the titles. The state is two fields: the current page title and the target title. No browser, no DOM: the Wikipedia API returns the links as text.

2. The questions

The questions and limits, from the top of wiki.mjs. This is the block a reviewer must read; the rest of the file is plumbing.

// ---- Review these. Everything else is plumbing. ----
const QUESTION = {
  type: "choice",
  instructions: "Which linked article is most likely to lead to the target article in the fewest hops?",
  // criteria: one option per link title, empty description. Jev reads the title. Filled per hop.
};
const MAX_HOPS = 12;
const MAX_OPTIONS = 255; // gateway refuses 256
const SKIP = /^(List of |Lists of |Index of |Outline of |Timeline of |\d{1,4}( BC)?$)|\(disambiguation\)|identifier$/;

3. What the page shows

A form with a start and a target. Below it, the chain of page titles left to right, then one card per hop with the top five candidates as probability bars, Jev's pick in orange, the Wikipedia fetch time and the Jev time for that hop, and the running cost. The page polls /state every 300 ms.

4. Run it

node --env-file=.env wiki/wiki.mjs Coffee Napoleon      # command line
node --env-file=.env wiki/wiki.mjs                       # http://localhost:3001
node --env-file=.env wiki/wiki.mjs --check               # 5 races, pass if 3 reach the target in 12 hops

5. The check, verbatim

run 1: reached in 4 hops, 4.6 s, $0.00038  Coffee → Frederick II of Prussia → French Revolution → Bonaparte at the Council of Five Hundred at Saint-Cloud → Napoleon Bonaparte
run 2: reached in 7 hops, 3.3 s, $0.00064  Coffee → Gustav III of Sweden's coffee experiment → History of coffee → Gabriel de Clieu → Saint-Domingue → Haitian Revolution → French Revolutionary and Napoleonic Wars → Napoleon Bonaparte
run 3: reached in 5 hops, 4.8 s, $0.00048  Coffee → Gustav III of Sweden's coffee experiment → Gustav III → French Revolution → Bonaparte at the Council of Five Hundred at Saint-Cloud → Napoleon Bonaparte
run 4: reached in 7 hops, 5.7 s, $0.00064  Coffee → Gustav III of Sweden's coffee experiment → History of coffee → Gabriel de Clieu → Saint-Domingue → Haitian Revolution → French Revolutionary and Napoleonic Wars → Napoleon Bonaparte
run 5: reached in 4 hops, 2.3 s, $0.00038  Coffee → Frederick II of Prussia → French Revolution → Bonaparte at the Council of Five Hundred at Saint-Cloud → Napoleon Bonaparte
5/5 reached the target

One hop, printed by the command-line mode, shows the split between the two network calls:

Coffee → Frederick II of Prussia (p 0.36, 255 links, wiki 177 ms, jev 354 ms)
Frederick the Great → French Revolution (p 0.59, 255 links, wiki 245 ms, jev 2523 ms)
French Revolution → Bonaparte at the Council of Five Hundred at Saint-Cloud (p 0.36, 255 links, wiki 162 ms, jev 541 ms)
Bonaparte at the Council of Five Hundred at Saint-Cloud → Napoleon Bonaparte (p 0.98, 26 links, wiki 145 ms, jev 262 ms)
reached Napoleon in 4 hops, 4.9 s, $0.00038

A second pair, Cheese to Moon, took 9 hops: Legend, Myth, Greek mythology, Apollo, Apollo program, Moon landing, Apollo 11, Exploration of the Moon, Moon.

6. Findings

7. Cost and latency

One hop with 255 options is about 2,000 input tokens, $0.00008 to $0.0001. A race is $0.0004 to $0.0006.

Every number above was measured from one machine on 2026-09-19 through the Vercel AI Gateway. The source videos show demos from machines close to the model; this page shows what the same idea costs from here.