typesafe-chess
Jev-versus-Jev chess where every move is a Choice over legal moves, with optional MCTS using Jev's distributions as policy and value.
Overview
This project has two chess players, both powered by Jev. chess.js generates legal moves, so the model can only pick a legal one, and the server annotates each candidate with rule-engine facts: piece, captures, checks, castling, promotion and whether the destination is defended. Jev sees the board, material, recent moves, the player's style and the annotated options, and returns a probability distribution over moves.
Each request also includes a Score question for a position evaluation and a Noul question for whether the position is tactically sharp, all answered in parallel; a move takes about 350 ms end to end in fast mode. Optionally, a Monte Carlo Tree Search uses Jev's distributions as policy and value, AlphaZero-style, to play noticeably better. The project is a clear illustration of keeping rules in code and asking the model only for judgment.
What the decision model decides
| Type | Question | Answers |
|---|---|---|
| Choice | Which legal move should be played? | — |
| Score | How good is this position for the side to move? | — |
| Yes / no | Is this position tactically sharp? | yes · no |
How it works
- chess.js lists legal moves; code annotates each with facts.
- One request asks Choice, Score and Noul questions together.
- The top move is played, or MCTS uses the distributions to search.
- Distribution, score and sharpness are shown in the UI.
Strengths
- Illegal moves are impossible by construction.
- About 350 ms per move in fast mode, per the README.
- MCTS mode improves play using the same calls.
Caveats
- Chess strength is not benchmarked in the excerpt.
- Requires a TypeSafe key.
At a glance
- Type
- Project
- Status
- prototype
- Runtime
- Node server + web UI
- Has code
- yes
Use cases and integrations
How curated lists describe it
Chess where both players are TypeSafe's Jev model: every move is a typed Choice decision.
hellogumbo/awesome-jev
Frequently asked questions
Can Jev make an illegal move?
No, it can only choose among legal moves listed by chess.js.
What is the MCTS mode?
A tree search that uses Jev's move probabilities and evaluations as policy and value.
How fast is a move?
About 350 ms end to end in fast mode.
Related projects
Source for browser chess and Chess960 where code computes each legal move's facts and Jev picks one per turn as a typed Choice.
ProjectproductionTypeScriptBrowser 1v1 sniper arena where Jev reads match state about 9 times a second and chooses movement, aim, ADS, firing and jumping.
ServicebetaTypeScriptInstrumented 2048 web lab where every move is a Jev Choice over four directions, with probabilities, latency and cost shown live.
ProjectbetaTypeScriptFifteen live arcade games where Jev and LLMs play each other, led by WikiRace in which Jev picks only real links.
ProjectbetaTypeScriptReal-time bot battles where you write a fighter's strategy in plain English and a System One model pilots it several times a second.
ProjectbetaTypeScriptBrowser extension that lets Jev, local Laya or an OpenAI-compatible model take over a running ra2web (WannaFire) RTS match.
ProjectbetaTypeScript