Skip to content

Repository files navigation

Table Stakes

No-limit Texas hold'em where the chips are LLM tokens. Bring your OpenRouter API key — your stack is inference. Claude Code and Codex sit at the table as players over ACP, any MCP-capable agent can bring itself, humans play from the browser, and everyone trash-talks.

Full design: PROPOSAL.md. Status: M1–M4 built and E2E-tested (model seats, ACP agent seats, human web seat, MCP guest seat, staking with a redemption proxy, fairness verifier, stats).

Quickstart

pnpm install
cp .env.example .env   # add your OPENROUTER_API_KEY
pnpm demo up --config table.config.json --hands 3

up prints a spectator URL (http://127.0.0.1:7787), a join URL per human seat, and an MCP endpoint + seat token per BYO-agent seat.

Seat types (table.config.json / table.agents.config.json)

type who notes
model any OpenRouter model billed to the table's key; exact usage metering
acp Claude Code ("agent":"claude"), Codex ("codex"), or any cmd speaking ACP pays with its owner's account; needs auth in env: ANTHROPIC_API_KEY/CLAUDE_CODE_OAUTH_TOKEN for Claude, ~/.codex login or CODEX_API_KEY for Codex; gets a private notes workspace
human you, in the browser join URL with seat token; same clock, same stakes
mcp any MCP client (claude mcp add --transport http …) pull-based: loop wait_for_turn → act; needs its own driving loop

Staking (Tier 1 — capped IOU, not escrow; see proposal small print)

# each player stakes a spend-capped OpenRouter key (verified: limit set, no reset, no BYOK)
TABLE_STAKES_VAULT_PASSPHRASE=... STAKE_KEY=sk-or-... pnpm demo stake --player DeepSeek

# after a session: winners redeem their claims through the metering proxy
TABLE_STAKES_VAULT_PASSPHRASE=... pnpm demo redeem --run runs/<dir>

The proxy is an OpenAI-compatible endpoint on localhost: winners route their own LLM calls through it with a claim token; it spends the debtor's staked key, metered per request, capped at exactly what was lost.

Verify a run

pnpm demo verify --run runs/<dir>

Recomputes every hand's deck from the revealed seed against the pre-hand commitment, replays the deal against the actually-dealt cards, and checks token conservation.

Run artifacts (runs/<table>-<ts>/)

events.jsonl (append-only session record) · ledger.jsonl (buy-ins, deltas, inference spend, burns) · hands/*.phh (PHH hand histories with table talk as commentary) · summary.md (stacks, settlement, thinking cost, VPIP/PFR stats) · workspaces/<seat>/ (agent notebooks + logs) · claims.jsonl after redeem.

Layout

package job
packages/engine commit–reveal dealing + verifiers, engine wrapper, event log, PHH
packages/bank OpenRouter client, peg pricing, ledger, vault, claims, redemption proxy
packages/table config, seats (model/acp/human/mcp), session, web+WS server, MCP bridge, stats
packages/cli up · stake · redeem · verify

pnpm test (unit + integration) · pnpm typecheck.

How the money works (short version)

Chips are tokens on the felt, USD in the ledger: 1 chip = 1,000 tokens of the table's reference model, priced from live OpenRouter metadata and frozen at table open. OpenRouter credits can't move between accounts, so winning means winning inference rights — a claim redeemed through the proxy against the loser's spend-capped staked key. Keep it invite-only among people who trust the host: the host machine is dealer and banker.

About

Poker, but the chips are LLM tokens. Humans on mobile, Claude Code & Codex at the table via ACP.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages