A No-Limit Poker bot with advanced decision making, hand evaluation, and opponent modeling.
- Hand strength and equity calculation
- GTO + exploitative strategy
- Opponent profiling (TAG, LAG, Fish, Rock, etc.)
- Position and pot odds awareness
- Dynamic aggression and bluffing
- Python 3.7+
- websockets, numpy, pandas, torch, scikit-learn, tqdm
# Install package in development mode
pip install -e .
# Or install dependencies only
pip install -r requirements.txt# Terminal 1: Start test server
python scripts/run_test_server.py
# Terminal 2: Start bot
python scripts/run_bot.py dev table-1 TestBot ws://localhost:8080# Standard entry point
python scripts/run_bot.py [apiKey] [table] [player] [serverUrl]
# Example
python scripts/run_bot.py dev table-1 bot1 ws://localhost:8080
# Alternative: Python module
python -m poker_bot.core.bot dev table-1 bot1 ws://localhost:8080For compatibility with the class Texas-HoldEm-Infrastructure:
python scripts/run_competition.py dev table-1 MyBot ws://localhost:8080# Start the test server (replays historical hands)
python scripts/run_test_server.py
# Or set custom log file
TEST_SERVER_LOG=historical_logs/sample_real_hands.jsonl python scripts/run_test_server.py-
Collect decisions – Logging is enabled by default. Run the bot and it will write JSON lines to
logs/training_decisions.jsonl. Customize the path withPOKER_TRAINING_LOG=/tmp/decisions.jsonl. -
Train models – Once you have data, run:
python -m poker_bot.training.train_agent --log-path logs/training_decisions.jsonl --agent-name gto --epochs 20
Trained weights are stored under
models/for easy loading later. -
Key modules:
src/poker_bot/training/data_collector.py- Decision loggingsrc/poker_bot/training/state_encoder.py- Feature normalizationsrc/poker_bot/training/train_agent.py- PyTorch training loop
AI-Texas-Holdem-CSC4444/
├── scripts/ # Entry point scripts
│ ├── run_bot.py
│ ├── run_competition.py
│ └── run_test_server.py
├── src/poker_bot/ # Main package
│ ├── core/ # Bot infrastructure
│ ├── agents/ # Strategy agents (GTO, Exploiter, Defender)
│ ├── evaluation/ # Hand & opponent evaluation
│ └── training/ # ML training infrastructure
├── tests/ # Test infrastructure
├── tools/ # Utility scripts
├── docs/ # Additional documentation
└── logs/ # Training logs (runtime)
- docs in docs/