How Does the Shark AI Decide Each Move? Its Decision Process, From the Source
No peeking and no language model: certain answers first, a preflop solver table, time-boxed turn and river solves, then small adjustments from your own public history. Each step checked against the code and strategy data.
Learn by playing: open Texas Hold’em in your browser, no download needed.
Play Texas Hold’emShark is not a chat model, and it cannot see your hole cards. Each time it acts, the server runs the same sequence: look for answers that need no guessing; preflop, look up a precomputed solver table; on the turn and river, solve a small game during its think pause; when none of that applies, use range rules. Then it makes small adjustments from your own comparable public history, and runs a few final checks. Below we walk through that sequence against the source code. Every number comes from the code or the strategy data files.
What it knows when it acts
Its inputs are its own two hole cards, the board, the pot, every player’s stack, and this hand’s public actions. Other players’ hole cards and the undealt cards are not among them. When it estimates equity, it treats every card outside its own hand and the board as possible, enumerating or sampling them. For the full input list and a real hand, see Can the AI See My Hole Cards?
Squid, run it twice and 7-2 or premium-hand bounties change how a hand pays out, so none of the first three steps run at those tables; Shark goes straight to the range rules in step four. With a straddle, most of step one still runs, but the solver tables and solvers in steps two and three do not.
Step 1: look for answers that need no guessing
In some spots, the right answer is the same whatever the opponent holds. Shark checks these first:
- When a call ends the betting: it evaluates every possible opposing holding against every remaining runout, up to 45,540 combinations heads-up on the turn. If every possibility says call, it calls; if every one says fold, it folds. If any possibility disagrees, this step gives no answer (
server/src/bot/terminal.rs). - Heads-up preflop, when only call or fold remain: it uses precomputed exact equity tables, each starting-hand matchup evaluated over all 1,712,304 boards. With no voluntary bet, it calls if its equity against a random hand covers the price. After a voluntary raise, it calls only if its equity against the opponent’s strongest possible hand covers the price; otherwise it passes the decision on (
forced_blind.rs). - When the board is the best hand: nobody can beat the five river cards, so everyone splits. Shark checks or calls; it bets half pot only when the next player has a record of folding often to half-pot river bets (
shark.rs). - Sole nuts, last to act: everyone checked the river to Shark, no possible holding ties or beats it, and its only choices are check or all-in. It goes all-in (
multiway_exploit.rs).
Step 2: look up the preflop solver table
Most preflop play is computed offline. We trained a separate policy for each table size from 2 to 9 players with the open-source GTOpen solver (Apache-2.0), and the results ship with the server as compressed data files. Heads-up covers every whole big blind from 10 to 150, every half big blind from 80 to 120, and 200 big blinds. Three to nine players cover 100 big blinds, plus a set of stack combinations such as one short stack.
When Shark acts, it matches the hand’s player count, positions, blinds, stacks and every raise size against the data. If they match, it draws one action at random using the table’s mixed frequencies for its hand. If not, for example a raise size the table doesn’t have or a re-raise beyond the tree, it skips this step. The lookup runs locally; nothing is solved in real time.
Some 6-max, 100 big blind examples (data file ring6.json.gz):
| Spot | Hand | Table frequencies |
|---|---|---|
| Folded to the button | A A | Raise to 3BB 90.8%, to 2.5BB 8.8% |
| K 9 offsuit | Raise about 97.6%, mostly to 3BB | |
| J 8 offsuit | Fold 96.7% | |
| LJ, first to act | 5 5 | Raise about 96%: 2BB 37.8%, 2.5BB 56.2%, 3BB 1.7% |
| 7 6 suited | Fold 64.3% | |
| Button opens 2.5BB, small blind folds, big blind to act | Whole range | Fold 48.7%, call 38.1%, re-raise to 7.5BB 13.1% |
| K 10 offsuit | Call 91.3% | |
| Q J suited | Re-raise 99.4% |
So Shark doesn’t play the same hand the same way every time: on the button, aces raise smaller than 3BB about one time in ten. That mix is in the table. It is not Shark “reading you”.
These tables have stated limits. At export, every seat’s best-response gain in the simplified model is at most 0.01 big blinds; the six 6-max seats measure 0.0016 to 0.0073. The simplified model has no rake, antes or straddles, and values after the flop come from GTOpen’s estimate models. The result is “near equilibrium within this model”, not optimal play for full Hold’em. We covered the difference between a lookup and a solve in Preflop Charts and GTO Solvers.
Step 3: on the turn and river, solve a small game during the think pause
After the flop, Shark estimates a range for each opponent. It replays the preflop solver table, weighting each hand by how often it takes the action the opponent actually took. Postflop checks, calls and bets then multiply by hand-set factors: after a call, for example, strong hands keep 0.65 of their weight and air keeps 0.10. The code comment calls these “authored likelihoods, not an equilibrium solve” (strategy.rs).
In a few common short-handed spots, Shark runs a small solve during its pause before acting:
- Heads-up river: check or bet half pot, then the opponent calls or folds; no raises. Every possible opposing holding (up to 1,081) is listed, and CFR+ runs up to 256 iterations. The result is used only when neither player can gain more than 0.25% of the pot by changing strategy (
river_model.rs). - Three-way river: the first two players check, the button checks or bets half pot, and the other two each call or fold. Hands are grouped into 20 strength buckets, up to 512 iterations, with the same per-hand 0.25%-of-pot check (
multiway_river_model.rs). - Heads-up turn, stacks no more than half the pot: the only choices are check or all-in. Discounted CFR from the open-source postflop-solver deals every river card, up to 80 iterations, targeting 0.75% of the pot (
turn_model.rs).
The solve runs on a background thread with a 400 ms limit. Only one runs at a time across the whole server, and none starts when the CPU is busy. If the result isn’t ready when it is time to act, Shark doesn’t wait; it uses the range rules in the next step (postflop_work.rs). A solve can only improve the decision; it never makes you wait longer. There is no flop solver; flop play is entirely rules.
Step 4: range rules when there is no solve
Most flops, bigger multiway pots and solves that didn’t finish in time go to a set of hand-written range rules (postflop.rs; its comment says “not solver output”). They aren’t “holding X, do Y”. Instead, Shark ranks its hand within its current range on a 10-tier strength scale, then decides what top share of the range bets or continues, mixing linearly within 5 percentage points of the cutoff.
- Bet sizes: chosen from 1/4, 1/3, 1/2, 2/3, 3/4 pot and pot, randomised between the two nearest sizes.
- River bets: big bets and thin value bets are separate. Bluffs are set at b/(p+b) times the value bets, where b is the bet and p the pot. At a 3/4-pot bet, that is about 3 bluffs for every 7 value hands, aiming to leave a caller break-even.
- Facing a heads-up river bet: it computes exact equity against the opponent’s range and compares it with the price. At least 1.5 percentage points above, it always calls; at least 1.5 below, it always folds; in between, it mixes proportionally. A separate minimum-defence floor keeps the top of its range from folding to every river bet.
- Facing an all-in: it splits main and side pots by each player’s actual contributions and estimates with 512 random deals. It calls only if the average gain beats 1.5 standard errors plus 2% of the call for each player still to act (
all_in.rs).
Step 5: adjusting to you, using only your own comparable public history
With no record of you, every step plays the same for everyone; the split-board bet in step one also uses these records. Reads are described together here. After each hand, Shark records the public actions of each human at the table. For example, heads-up, when the other player makes the first bet, does your next action fold or continue? That is tracked separately by street and bet size: up to half pot, up to pot, and overbet.
It is conservative:
- A read is used only after at least 20 observations at the same street and size.
- Sixteen “virtual observations” at a 40% fold rate are mixed in first, to damp small-sample noise. A fold rate of at least 62% counts as over-folding, at most 22% as a calling station, and anything between changes nothing.
- Flop folds are not carried to the river, and VPIP or aggression is never used to guess whether you bluff.
Example: heads-up on the river, you faced a half-pot bet 20 times and folded 16. Smoothed, that is (16 + 6.4) ÷ (20 + 16) ≈ 62.2%, so you count as over-folding. Folding 15 gives 59.4%, and nothing changes.
The main changes a read makes are small:
- Against a calling station: heads-up after the flop, when Shark is about to bet with air and fewer than 8 outs, it checks instead half the time. This rule leaves value bets unchanged.
- Against an over-folder: heads-up after the flop, when Shark would check a draw with 8 or more outs, it semi-bluffs 10% of the time (1/3 pot on the flop, 2/3 pot on the turn). When Shark bet the turn, its river value-bet frequency at the matching size is multiplied by 1.10, with bluffs scaled to match.
- Solver results: heads-up on the river, only hands mixing between 10% and 90% move, by at most 10 percentage points. Three-way on the river, the shift is at most 1 percentage point.
- Blind steals: when it is folded to the small blind and that big blind has clearly folded often to 2.5 big blind opens over at least 20 spots, Shark steals in 1.5% of the hands it would otherwise fold, only with hands the table already mixes as a raise.
- Multiway river nuts: when everyone checks to Shark, it holds the sole nuts, and the next player often calls half-pot bets, it bets half pot for value instead of checking.
- Repeated all-ins: after at least 12 comparable spots, Shark estimates your range from how wide you have been shoving, and turns a fold into a call only when its equity beats the price plus a safety margin.
Another kind of read looks at results. If a betting line of yours keeps winning pots without a call, Shark defends wider against it. If you keep calling Shark’s opening bets and winning, it opens less often with hands weaker than top pair. This read moves only a little each hand, and Shark first subtracts the largest effect one hand can have, so a single hand can’t change it.
These records follow your account, so Shark picks them up again at another table. Hold’em practice, Gold Bean tables, Short Deck and tournaments are tracked separately, so how you play at practice tables doesn’t affect Gold Bean tables. Older records are scaled down and fade out, and are deleted after 180 days without another meeting. Reads are used only inside the computer opponents and are never shown to any player. The same rules apply to everyone, with no special cases by leaderboard rank or nickname.
Step 6: checks before acting
- Big-pot discipline: when an action adds 20 big blinds or more, Shark reviews it against the range each opponent’s public line leaves. The bigger the commitment, the stronger the hand must be, and the review only makes the action smaller: a call becomes a fold, a raise a call, a bet a check. Value hands ahead of the opponents’ ranges are unaffected. This rule came from a November production review: after topping up, bots sat very deep, and lines designed for 100 big blinds paid off too much.
- Squid and bounty tables: when a token or bounty has value, some folds become calls, or Shark bets for the token when everyone else checks. At ordinary tables these layers do nothing.
- Legal actions: when the engine allows no raise (for example, the opponent is already all-in), a raise becomes a call or check, so a rejected action can’t lead the system to fold a strong hand automatically.
Preflop table lookups, the certain answers in step one and turn/river solver results are already priced for the spot, so they don’t go through big-pot discipline.
Fast or slow doesn’t mean strong or weak
Shark pauses 0.7 to 6 seconds each time. The pause is drawn before the strategy runs, and it never reads the hole cards or the chosen action. Facing a bet, later streets, more players and more re-raises allow longer pauses. Each Shark identity has a fixed pace, between 85% and 117% of the base time (server/src/session/timing.rs). A snap call isn’t a strong hand, and a long think isn’t hesitation.
Where you’ll meet Shark
Every computer opponent at public Hold’em tables is a Shark. Gold Bean AI practice is also all-Shark: beans the AI loses aren’t taken from anyone, so a weaker roster would let players farm beans. We wrote about that in How Our Top Three Gold-Bean Winners Crushed the AI. Points practice and friend rooms let you choose opponent styles, and empty seats default to Shark.
What it doesn’t do
- It doesn’t call GPT, Claude or any other large language model. Everything is local computation on the server.
- It doesn’t see your hole cards, and it doesn’t know which cards come next.
- There is no flop solve, and the turn and river solves have no raises; the river solves use a single half-pot bet size.
- The daily automatic parameter tuning adjusts only the other styles, never Shark.
- The tables and solvers approximate equilibria in their simplified models. Our review of the top gold-bean players explains the strategy flaws players found and how we fixed them.
To try it yourself, start an AI table without signing up. The default opponent is Shark.