Infra for running a poker bot competition; participants can create and submit bots that compete against each other in poker tournaments
the goal is to:
- provide a platform for developing, testing, submitting, and competing with similarly developed rival poker bots via a unified, intuitive API
- develop core tournament running infrastructure (to be used internally) for efficient, flexible, and simple conduction of pokerbot tournaments by P@B
- support multiple programming languages, each with their own base implementation and mini-SDK (maybe a better term for this?)
- a game engine that enforces rules and manages gameplay
- bot sandboxing
- tournament management with flexible competition structure and ranking systems
- support for multiple programming languages (Python, Rust, Java, C++, ...)
- bot performance metrics and analytics
contains templates and API for participants ("mini-SDKs"):
python/
(in progress)rust/
(in progress)java/
(in progress)cpp/
(in progress)csharp/
(in progress)
Each mini-sdk should include:
- Bot templates with required methods
- Game state representations
- Action definitions
- Engine communication utilities
Contains the competition infrastructure and unified API backend:
engine/
: Match running and game logic (todo)models/
: Data models for bots, matches, and game logs (todo)tournament/
: Tournament structures and ranking systems (todo)
- Python 3.13 or higher
- uv ( package management and virtual environments)
-
Clone the repository:
git clone https://github.com/poker-at-berkeley/pab-pokerbots.git cd pab-pokerbots
-
Set up the environment using uv:
pip install uv uv venv source .venv/bin/activate # if on windows: .venv\Scripts\activate uv pip install -e . # deps install
Important: contributors / pab board should use uv and not pip or venv for package management and virtual environments (pls)
- choose preferred language (Python, Rust, Java, C++, ...)
- Copy template from the corresponding directory in
public/
- Implement strategy by modifying the template
Example (.py):
# TODO: revise dummy python example below
from lib.game.poker_moves import FoldAction, CallAction, CheckAction, RaiseAction
from lib.base.base_bot import BaseBot
class MyPokerBot(BaseBot):
def get_action(self, game_state, round_state, active):
# impl strategy here
return CheckAction() # example action
curl -X POST "http://localhost:8000/bots" \
-F "name=MyBot" \
-F "language=python" \
-F "version=1.0" \
-F "user_id=user123" \
-F "bot_file=@bot.zip"
curl -X POST "http://localhost:8000/tournaments" \
-F "name=Weekly Tournament" \
-F "max_participants=8"
curl -X POST "http://localhost:8000/tournaments/1/register" \
-F "bot_id=1"
curl -X POST "http://localhost:8000/tournaments/1/start"
# Leaderboard
curl "http://localhost:8000/leaderboard"
# Tournament standings
curl "http://localhost:8000/tournaments/1/standings"
Developed by Poker at Berkeley
Credits to MIT PokerBots and their open-sourced materials for inspo and guidance