Ranges

The exact solver's strategy for 22 river hands next to the moves Claude Haiku and Claude Sonnet chose: one checks almost every hand, the other always bets big

Overview

A study in computer vision and game theory: a macOS assistant that reads a poker table from screen captures and suggests the move.

Stack

Python, Rust, Gemini vision, Claude (benchmarks only), macOS screen capture

What I built

  • Calibrated screen capture: the table regions are cropped, combined into one image and sent to a vision model that returns the table state as JSON.
  • Local checks on what the model reads: card backs, the dealer button and the pot are verified from the pixels before anything is decided.
  • Exact preflop decisions from cached solver charts, looked up rather than computed.
  • Heads-up postflop spots solved by a pinned Rust solver, with an optional remote solve server for heavier spots.
  • Offline benchmarks that score Claude Haiku and Sonnet against the exact solver, with paid model calls off by default.

Key decisions

  • The first version asked the model for the move, and it failed. Benchmarked against an exact solver, Claude Haiku and Sonnet collapsed to almost constant actions: on one river spot one checked 21 of 22 hands and the other bet all 22, and on 100 cases they matched the solver only 57 to 61% of the time.
  • So the model now only reads the table, and the move is computed from verified solver data. In strict mode no language model is ever asked for the move.
  • Fail closed: when a spot is unsupported or only approximate, it says so instead of guessing.

A study project, not meant for live play where room rules forbid assistance.