GitHub - christianmat/jev-pokemon: Jev, an AI decision model, plays Pokémon Red. It beat the game in 37h 40m.
Short summary
TypeSafe AI's decision model Jev autonomously completed Pokémon Red by reading game memory, evaluating legal moves with game facts, and making every decision—from battle tactics to menu choices—over 37 hours and 16,150 decisions. The entire run cost $1.65 in API tokens, with full source code and setup instructions open on GitHub.
- Jev made every game decision (battles, catching, team swaps, navigation) based on legal options and contextual facts, while the harness only handled emulation and button presses—no cheats or memory writes.
- The project cost $1.65 total at $0.042 per million input tokens, with typical calls around 1,200 tokens and median decision time of 0.4 seconds; the full run consumed ~39.2M input tokens.
- All code is open-source (GPL-2.0) and reproducible locally with your own legally obtained Pokémon Red ROM, Node 20+, and macOS or Linux—no Nintendo assets or ROMs are distributed.
Full summary
Jev, an AI decision model built by TypeSafe AI, completed Pokémon Red in 37 hours and 40 minutes across a livestream in September 2026. The system reads the game's memory to understand the current state, presents legal options with relevant facts (type matchups, damage estimates, progress toward objectives), and then makes a decision—all without scripts, cheats, or memory manipulation. It burned through 16,150 decisions, used about 39.2 million input tokens, and cost roughly $1.65 to run. The median time per decision was 0.4 seconds. The AI wiped 16 times total, struggled particularly at the Elite Four (15 attempts), and finished with a team of Charizard, Graveler, Nidoqueen, Beedrill, Haunter, and Primeape.
The harness handles mechanics like pathfinding and menu navigation, but Jev itself controls everything strategic: menu answers, which Pokémon to catch and train, where to go, and every battle action. The system knows only story milestones and checks progress against the game's real event flags—it doesn't see hidden items since a human wouldn't know where they are. The setup enforces house rules like fast text speed, custom nicknames spelled letter-by-letter, and loop protection to prevent the AI from getting stuck retrying the same failing choice.
Running this locally requires macOS or Linux, Node 20+, your own legally dumped copy of Pokémon Red (US/EU release), and a Vercel AI Gateway key for the real Jev model. The codebase is open source under GPL-2.0, split into modules for emulation, game data, the AI client, agent logic, and story knowledge. You can run it at real-time speed with a local viewer, resume from checkpoints, or go headless at maximum speed. The economics work out cleanly: at $0.042 per million input tokens with output free, running the bot costs about $1–$1.70 per day at normal speed, capping out at $7 daily if throttled to its maximum 90 calls per minute.