shipwithjev

Catalog / Games & real time

0347GitHub

typesafe-mario

Super Mario Bros.

Super Mario Bros. agent choosing actions from structured emulator state.

fhshaik/typesafe-marioREADME ↗
# TypeSafe Mario

An experimental controller that lets TypeSafe's Jev model directly choose NES
controller inputs for the original Super Mario Bros.

The model does **not** receive screenshots. The harness translates emulator telemetry
and RAM into compact, object-centric JSON containing Mario's motion, jump trajectory,
upcoming enemies, terrain, measured response delay, recent-control results, and episode
progress. Jev chooses one of the legal controller actions, the emulator advances several
frames, and the loop repeats. The raw local tile grid remains available in debug logs
and the UI, but is not duplicated in the model input.

## Architecture

```text
NES emulator -> telemetry/RAM parser -> structured JSON -> Jev Choice -> controller input
```

The initial action set is intentionally small:

- `noop`
- `right`
- `right_jump`
- `right_run`
- `right_run_jump`
- `jump`
- `left`

## Requirements

- Python 3.13 or newer
- A TypeSafe API key in `TYPESAFE_API_KEY`
- A legal local setup for Super Mario Bros.

This repository contains no Nintendo ROM or other copyrighted game data. You are
responsible for ensuring that your emulator and game files are obtained and used
lawfully.

## Setup

```powershell
py -3.13 -m venv .venv
.venv\Scripts\python -m pip install -e ".[mario,dev]"
$env:TYPESAFE_API_KEY = "your-key"
```

Inspect the exact JSON and text that will be sent to TypeSafe without launching the
game or calling the API:

```powershell
.venv\Scripts\typesafe-mario state-demo
```

Run World 1-1 with Jev making a decision every eight emulator steps. The default
display is a single recordable window with the live game and model telemetry:

```powershell
.venv\Scripts\typesafe-mario play --env SuperMarioBros-1-1-v0 --frames-per-decision 8
```

The dashboard shows the select

Also filed under Games & real time

  1. 0607

    2048Jev: Jev plays 2048

    Built a demonstration of Jev playing 2048. Note: It might not always win. :)

    @TheRealRajdeep · Games & real time

  2. 0603

    System 1 Speedcuber: a Rubik's cube agent

    A speedcubing agent built on Jev and Laya ModernBERT-421M, with real-time 3D state, temporal memory and calibrated move probabilities instead of a solver.

    @harsha_varma02 · Games & real time

  3. 0597

    Astra and Jev play Minecraft

    A video letting Astra plan and Jev act inside Minecraft, with an outcome the creator didn't expect.

    @MatinSenPai · Games & real time

  4. 0593

    Jev Kitchen

    Inspired by @heystefan_: name a dish or a cocktail, and its ingredients rise out of a pile of stickers. ⚡ Jev judges every search in half a second 🎨 ~1,000 illustrations by FLUX.1 [dev], run locally through ComfyUI 🧠 Claude Opus 5.5 built it all and redrew the illustrations

    @nelsonpklark · Games & real time