Dataset Viewer
Duplicate
The dataset viewer is not available for this split.
Cannot load the dataset split (in streaming mode) to extract the first rows.
Error code:   StreamingRowsError
Exception:    CastError
Message:      Couldn't cast
[x]: int64
[+]: int64
[O-O-O]: int64
[O-O]: int64
[=Q]: int64
[h2]: int64
[b6]: int64
[b2]: int64
[f5]: int64
[g2]: int64
[f6]: int64
[e3]: int64
[e6]: int64
[g7]: int64
[e4]: int64
[c7]: int64
[a7]: int64
[g5]: int64
[f4]: int64
[h4]: int64
[d4]: int64
[b5]: int64
[d5]: int64
[e7]: int64
[c6]: int64
[e2]: int64
[d2]: int64
[g6]: int64
[c4]: int64
[b3]: int64
[f3]: int64
[d3]: int64
[h6]: int64
[b7]: int64
[c5]: int64
[b4]: int64
[c2]: int64
[f7]: int64
[f2]: int64
[a3]: int64
[a2]: int64
[g4]: int64
[h5]: int64
[a6]: int64
[h3]: int64
[a5]: int64
[c3]: int64
[e5]: int64
[a4]: int64
[d6]: int64
[h7]: int64
[d7]: int64
[g3]: int64
[?!]: int64
[??]: int64
[?]: int64
[=R]: int64
[=N]: int64
[g8]: int64
[b8]: int64
[f8]: int64
[d8]: int64
[a8]: int64
[e8]: int64
[c8]: int64
[h8]: int64
[fg5]: int64
[ab3]: int64
[bc7]: int64
[cb3]: int64
[cb2]: int64
[dc3]: int64
[ef2]: int64
[fe3]: int64
[gh2]: int64
[gh5]: int64
[ab5]: int64
[aa3]: int64
[cb5]: int64
[bc5]: int64
[de7]: int64
[fe7]: int64
[hh7]: int64
[cd3]: int64
[aa6]: int64
[hg7]: int64
[hh6]: int64
[ef7]: int64
[ef4]: int64
[ed3]: int64
[de6]: int64
[ef5]: int64
[cb6]: int64
[hg5]: int64
[cd4]: int64
[fg6]: int64
[cd7]: int64
[bc4]: int64
[ba4]: int64
[ed2]: int64
[de4]: int64
[fg7]: int64
[gh4]: int64
[aa5]: int64
[ed7]: int64
[ef3]: int64
[fe5]: int64
[dc4]: int64
[de5]: int64
[ba6]: int64
[fe6]: int64
[aa7]: int64
[dc5]: int64
[gf3]: int64
[bc6]: int64
[ba3]: int64
[bc3]: int64
[ab4]: int64
[gf7]: int64
[ba7]: int64
[cb7]
...
h6]: int64
[Rha1]: int64
[Q4c1]: int64
[Nah8]: int64
[R2g8]: int64
[B6h6]: int64
[R3g5]: int64
[K1h2]: int64
[R2g3]: int64
[Rch5]: int64
[Kfh6]: int64
[N7a6]: int64
[Nhf7]: int64
[Rch3]: int64
[Nga1]: int64
[K8b4]: int64
[Qhb4]: int64
[N4d8]: int64
[Q5d4]: int64
[B3b6]: int64
[N7f5]: int64
[Ndb6]: int64
[Rfa6]: int64
[Q4f4]: int64
[K8d3]: int64
[Bbb8]: int64
[Q5a6]: int64
[Qab8]: int64
[N1g6]: int64
[Rde8]: int64
[R8e1]: int64
[Bgh1]: int64
[Rfb5]: int64
[Nec5]: int64
[Kfg4]: int64
[Kcd2]: int64
[Kgb1]: int64
[B8c5]: int64
[Nhf8]: int64
[Kgh2]: int64
[Nca3]: int64
[Rfd1]: int64
[R2g2]: int64
[R6a6]: int64
[Qae2]: int64
[Naa3]: int64
[Bah1]: int64
[Q2f2]: int64
[N1b7]: int64
[Kdf7]: int64
[Bah4]: int64
[Nah3]: int64
[Rbe2]: int64
[Bhg7]: int64
[R8c4]: int64
[Bec6]: int64
[R1h5]: int64
[B1f5]: int64
[Q1f6]: int64
[Rhh1]: int64
[N7h2]: int64
[Bca5]: int64
[Qcf3]: int64
[Kda4]: int64
[N1a5]: int64
[R7b5]: int64
[N6e8]: int64
[Kdh2]: int64
[Qfe7]: int64
[K7d3]: int64
[Qhb3]: int64
[Kfh7]: int64
[Red3]: int64
[Rfd8]: int64
[Qgf3]: int64
[Keg3]: int64
[N1d3]: int64
[K1f3]: int64
[Nce6]: int64
[Bca6]: int64
[Nhd3]: int64
[K1f7]: int64
[Rea5]: int64
[Q8a6]: int64
[Rfh5]: int64
[Khd3]: int64
[R1f5]: int64
[Rba5]: int64
[Kab2]: int64
[Q4b7]: int64
[Kgc8]: int64
[R5f4]: int64
[Qfh4]: int64
[R8c3]: int64
[B3c2]: int64
[K2a1]: int64
[Ndh3]: int64
tokens: int64
elapsed_sec: double
plies: int64
games: int64
vocab_size: int64
glyph_vs_computed_disagreement_plies: int64
san_parse_errors: int64
to
{'games': Value('int64'), 'plies': Value('int64'), 'tokens': Value('int64'), 'vocab_size': Value('int64'), 'san_parse_errors': Value('int64'), 'glyph_vs_computed_disagreement_plies': Value('int64'), 'elapsed_sec': Value('float64')}
because column names don't match
Traceback:    Traceback (most recent call last):
                File "/src/services/worker/src/worker/utils.py", line 149, in get_rows_or_raise
                  return get_rows(
                      dataset=dataset,
                  ...<4 lines>...
                      column_names=column_names,
                  )
                File "/src/libs/libcommon/src/libcommon/utils.py", line 272, in decorator
                  return func(*args, **kwargs)
                File "/src/services/worker/src/worker/utils.py", line 129, in get_rows
                  rows_plus_one = list(itertools.islice(safe_iter(ds, dataset=dataset), rows_max_number + 1))
                File "/src/services/worker/src/worker/utils.py", line 489, in safe_iter
                  yield from ds.decode(False) if ds.features else ds
                File "/usr/local/lib/python3.14/site-packages/datasets/iterable_dataset.py", line 2818, in __iter__
                  for key, example in ex_iterable:
                                      ^^^^^^^^^^^
                File "/usr/local/lib/python3.14/site-packages/datasets/iterable_dataset.py", line 2355, in __iter__
                  for key, pa_table in self._iter_arrow():
                                       ~~~~~~~~~~~~~~~~^^
                File "/usr/local/lib/python3.14/site-packages/datasets/iterable_dataset.py", line 2380, in _iter_arrow
                  for key, pa_table in self.ex_iterable._iter_arrow():
                                       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^
                File "/usr/local/lib/python3.14/site-packages/datasets/iterable_dataset.py", line 536, in _iter_arrow
                  for key, pa_table in iterator:
                                       ^^^^^^^^
                File "/usr/local/lib/python3.14/site-packages/datasets/iterable_dataset.py", line 419, in _iter_arrow
                  for key, pa_table in self.generate_tables_fn(**gen_kwags):
                                       ~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^
                File "/usr/local/lib/python3.14/site-packages/datasets/packaged_modules/json/json.py", line 343, in _generate_tables
                  self._cast_table(pa_table, json_field_paths=json_field_paths),
                  ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                File "/usr/local/lib/python3.14/site-packages/datasets/packaged_modules/json/json.py", line 132, in _cast_table
                  pa_table = table_cast(pa_table, self.info.features.arrow_schema)
                File "/usr/local/lib/python3.14/site-packages/datasets/table.py", line 2369, in table_cast
                  return cast_table_to_schema(table, schema)
                File "/usr/local/lib/python3.14/site-packages/datasets/table.py", line 2297, in cast_table_to_schema
                  raise CastError(
                  ...<3 lines>...
                  )
              datasets.table.CastError: Couldn't cast
              [x]: int64
              [+]: int64
              [O-O-O]: int64
              [O-O]: int64
              [=Q]: int64
              [h2]: int64
              [b6]: int64
              [b2]: int64
              [f5]: int64
              [g2]: int64
              [f6]: int64
              [e3]: int64
              [e6]: int64
              [g7]: int64
              [e4]: int64
              [c7]: int64
              [a7]: int64
              [g5]: int64
              [f4]: int64
              [h4]: int64
              [d4]: int64
              [b5]: int64
              [d5]: int64
              [e7]: int64
              [c6]: int64
              [e2]: int64
              [d2]: int64
              [g6]: int64
              [c4]: int64
              [b3]: int64
              [f3]: int64
              [d3]: int64
              [h6]: int64
              [b7]: int64
              [c5]: int64
              [b4]: int64
              [c2]: int64
              [f7]: int64
              [f2]: int64
              [a3]: int64
              [a2]: int64
              [g4]: int64
              [h5]: int64
              [a6]: int64
              [h3]: int64
              [a5]: int64
              [c3]: int64
              [e5]: int64
              [a4]: int64
              [d6]: int64
              [h7]: int64
              [d7]: int64
              [g3]: int64
              [?!]: int64
              [??]: int64
              [?]: int64
              [=R]: int64
              [=N]: int64
              [g8]: int64
              [b8]: int64
              [f8]: int64
              [d8]: int64
              [a8]: int64
              [e8]: int64
              [c8]: int64
              [h8]: int64
              [fg5]: int64
              [ab3]: int64
              [bc7]: int64
              [cb3]: int64
              [cb2]: int64
              [dc3]: int64
              [ef2]: int64
              [fe3]: int64
              [gh2]: int64
              [gh5]: int64
              [ab5]: int64
              [aa3]: int64
              [cb5]: int64
              [bc5]: int64
              [de7]: int64
              [fe7]: int64
              [hh7]: int64
              [cd3]: int64
              [aa6]: int64
              [hg7]: int64
              [hh6]: int64
              [ef7]: int64
              [ef4]: int64
              [ed3]: int64
              [de6]: int64
              [ef5]: int64
              [cb6]: int64
              [hg5]: int64
              [cd4]: int64
              [fg6]: int64
              [cd7]: int64
              [bc4]: int64
              [ba4]: int64
              [ed2]: int64
              [de4]: int64
              [fg7]: int64
              [gh4]: int64
              [aa5]: int64
              [ed7]: int64
              [ef3]: int64
              [fe5]: int64
              [dc4]: int64
              [de5]: int64
              [ba6]: int64
              [fe6]: int64
              [aa7]: int64
              [dc5]: int64
              [gf3]: int64
              [bc6]: int64
              [ba3]: int64
              [bc3]: int64
              [ab4]: int64
              [gf7]: int64
              [ba7]: int64
              [cb7]
              ...
              h6]: int64
              [Rha1]: int64
              [Q4c1]: int64
              [Nah8]: int64
              [R2g8]: int64
              [B6h6]: int64
              [R3g5]: int64
              [K1h2]: int64
              [R2g3]: int64
              [Rch5]: int64
              [Kfh6]: int64
              [N7a6]: int64
              [Nhf7]: int64
              [Rch3]: int64
              [Nga1]: int64
              [K8b4]: int64
              [Qhb4]: int64
              [N4d8]: int64
              [Q5d4]: int64
              [B3b6]: int64
              [N7f5]: int64
              [Ndb6]: int64
              [Rfa6]: int64
              [Q4f4]: int64
              [K8d3]: int64
              [Bbb8]: int64
              [Q5a6]: int64
              [Qab8]: int64
              [N1g6]: int64
              [Rde8]: int64
              [R8e1]: int64
              [Bgh1]: int64
              [Rfb5]: int64
              [Nec5]: int64
              [Kfg4]: int64
              [Kcd2]: int64
              [Kgb1]: int64
              [B8c5]: int64
              [Nhf8]: int64
              [Kgh2]: int64
              [Nca3]: int64
              [Rfd1]: int64
              [R2g2]: int64
              [R6a6]: int64
              [Qae2]: int64
              [Naa3]: int64
              [Bah1]: int64
              [Q2f2]: int64
              [N1b7]: int64
              [Kdf7]: int64
              [Bah4]: int64
              [Nah3]: int64
              [Rbe2]: int64
              [Bhg7]: int64
              [R8c4]: int64
              [Bec6]: int64
              [R1h5]: int64
              [B1f5]: int64
              [Q1f6]: int64
              [Rhh1]: int64
              [N7h2]: int64
              [Bca5]: int64
              [Qcf3]: int64
              [Kda4]: int64
              [N1a5]: int64
              [R7b5]: int64
              [N6e8]: int64
              [Kdh2]: int64
              [Qfe7]: int64
              [K7d3]: int64
              [Qhb3]: int64
              [Kfh7]: int64
              [Red3]: int64
              [Rfd8]: int64
              [Qgf3]: int64
              [Keg3]: int64
              [N1d3]: int64
              [K1f3]: int64
              [Nce6]: int64
              [Bca6]: int64
              [Nhd3]: int64
              [K1f7]: int64
              [Rea5]: int64
              [Q8a6]: int64
              [Rfh5]: int64
              [Khd3]: int64
              [R1f5]: int64
              [Rba5]: int64
              [Kab2]: int64
              [Q4b7]: int64
              [Kgc8]: int64
              [R5f4]: int64
              [Qfh4]: int64
              [R8c3]: int64
              [B3c2]: int64
              [K2a1]: int64
              [Ndh3]: int64
              tokens: int64
              elapsed_sec: double
              plies: int64
              games: int64
              vocab_size: int64
              glyph_vs_computed_disagreement_plies: int64
              san_parse_errors: int64
              to
              {'games': Value('int64'), 'plies': Value('int64'), 'tokens': Value('int64'), 'vocab_size': Value('int64'), 'san_parse_errors': Value('int64'), 'glyph_vs_computed_disagreement_plies': Value('int64'), 'elapsed_sec': Value('float64')}
              because column names don't match

Need help to make the dataset viewer work? Make sure to review how to configure the dataset viewer, and open a discussion for direct support.

YAML Metadata Warning:empty or missing yaml metadata in repo card

Check out the documentation for more information.

chess-gpt

A static-site harness for testing a chess AI that plays by predicting the next token of a chess game. The AI isn't here yet — a mock model stands in behind the exact interface the real one will use. No build step, no dependencies, hostable on GitHub Pages as-is.

Run it

node tools/serve.mjs        # -> http://localhost:4173

(any static server works; ES modules just can't load from file://)

GitHub Pages: push, then Settings → Pages → Deploy from a branch → main / root. The site is fully static.

How a computer move happens

  1. Legal moves come from chess.js and are tokenized into the scheme below.
  2. The model is asked for a next-token distribution over the whole vocabulary.
  3. Mask: every token that cannot continue a legal move sequence is set to probability zero. (On the first token of a move, the three nerf tokens are also allowed.)
  4. Renormalize, then sample.
  5. If a nerf token was drawn, the whole move is re-decoded with quality set — the model is now conditioned on "this move is an inaccuracy / mistake / blunder". Nerf tokens are masked out on the retry.
  6. Steps 2–4 repeat per token until a core move token completes the sequence; the matching SAN is played. The move gets a ?! / ? / ?? glyph in the move list if it was nerfed.

The Model output panel in the UI shows the sampled chain and the top of the masked distribution at every step of the last computer move.

Tokenization

A move is a sequence of modifier tokens followed by one core move token — the core token is what ends a move:

[#|+]?  [x]?  [=Q|=R|=B|=N]?  [core]

fxe8=Q+   ->  [+] [x] [=Q] [fe8]
Nxf3      ->  [x] [Nf3]
Raxe1#    ->  [#] [x] [Rae1]
e4        ->  [e4]
O-O       ->  [O-O]

Cores keep SAN's disambiguation so nothing is lossy: fe8 is a pawn capture core (source file + destination), piece cores may carry file / rank / square disambiguators (Nbd7, R1e2, Qh4e1). sanToTokens() / tokensToSan() in js/vocab.js convert both ways.

The vocabulary is 5,252 tokens:

group count
core moves (pawn 176, N/B/R/Q/K 5,064, castling 2, generated geometrically) 5,242
modifiers + # x =Q =R =B =N 7
nerf <inaccuracy> <mistake> <blunder> 3

Core generation is a deterministic, slightly loose superset of real SAN (every core is geometrically possible on an empty board; impossible ones are just permanently masked). tools/vocab-check.mjs plays random games and asserts every legal move tokenizes into the vocabulary and round-trips:

node tools/vocab-check.mjs 500

Plugging in the real AI

A model is any object with an async predict(ctx) returning either a Float32Array / number[] of length VOCAB_SIZE (index i = probability of TOKENS[i]) or a plain {token: probability} map. It is called once per token:

{
  fen,            // current position
  moves,          // SAN history: ['e4', 'c5', ...]
  historyTokens,  // same history as a flat token stream, nerf tokens included
  moveTokens,     // tokens emitted so far for the move being decoded
  turn,           // 'w' | 'b' — the side the model plays
  opponent,       // { rating: 1500 | null, site: 'lichess' | null }
  legalMoves,     // SAN list, provided for convenience — free to ignore
  quality,        // null, or 'inaccuracy'|'mistake'|'blunder' after a nerf
  vocab,          // the token list
}

Outputs don't need to be pre-masked or normalized — the engine masks illegal tokens to zero and renormalizes whatever you return.

Swap the model by replacing js/mock-model.js (imported in js/app.js), or at runtime — useful while weights load asynchronously:

window.chessGpt.setModel({ name: 'the real one', async predict(ctx) { ... } });

Other seams: window.chessGpt.loadFen(fen) jumps to a position, window.chessGpt.config exposes ENGINE_CONFIG (sampling temperature, disable nerf tokens, think-delay).

Files

index.html          page shell
style.css           minimalist theme
js/vocab.js         token vocabulary + sanToTokens / tokensToSan   <- swap for your tokenizer
js/engine.js        mask -> renormalize -> sample decode loop      <- the AI's socket
js/mock-model.js    placeholder model                              <- replace with the real AI
js/app.js           game flow, UI wiring
js/board.js         SVG board rendering + input
js/pieces.js        geometric piece shapes
lib/chess.js        vendored chess.js 1.4.0 (rules, legality, SAN)
tools/serve.mjs     dev server:  node tools/serve.mjs
tools/vocab-check.mjs  vocabulary/round-trip validation

Training the real model

TRAINING.md is the plan for building the training set from evaluated Lichess games (eval-derived nerf labels, this vocabulary, nanoGPT packing).

Notes

  • The mock scores moves with a shallow greedy heuristic, answers each predict() call with exact next-token marginals of that distribution, and emits nerf tokens more often the lower the opponent's rating (900 lichess blunders a lot; leave rating empty for a middling default). The rating site is plumbed through but unused by the mock — a real model might embed it, since ratings aren't comparable across sites.
  • Sampling is plain categorical over the masked distribution (ENGINE_CONFIG.temperature, default 1.0).
  • If the model puts zero mass on every allowed token, the engine falls back to uniform over legal continuations and logs a console warning.
Downloads last month
52