Fully Insightful Superhuman Hold'em Bot with Artificially Intelligent Thought. An AI agent designed to play poker. Inspired by the Pluribus poker bot developed by CMU and Facebook.
From the root directory:
- Create the build folder:
mkdir -p build
- Create the hyperparameters file:
cp src/ai/mccfr/hyperparameters.h.dev src/ai/mccfr/hyperparameters.h
- Navigate to the build folder:
cd build
- Generate the build files:
cmake <options> ..
- Possible Options:
-DCMAKE_C_COMPILER=<c-compiler>
and-DCMAKE_CXX_COMPILER=<cpp-compiler>
-DCMAKE_BUILD_TYPE=Debug
to debug with gdb or lldb.-DCMAKE_BUILD_TYPE=Release
to run in release mode. Release mode will add optimizations that makes the code run faster.-DTGT_SYSTEM=Graviton2
for AWS Graviton2 optimizations.-DCORES=<core_count>
to instruct parallel algorithms to use<core_count>
cores.
- Possible Options:
- Build the code:
cmake --build .
cmake --build . -- -j CORES
to run a parallel build.
- Download the card cluster files to
build/out/ai/clustering
- Generate the dev strategy:
./bin/blueprint.out
- Convert the dev strategy to the hdf5 format:
./bin/avg_to_hd5.out out/ai/mccfr/dev/average_final.cereal out/ai/mccfr/dev/blueprint_dev.hdf
- Create the api config file:
cp ../src/api/src/settings.py.example ../src/api/src/settings.py
- Start the API:
./bin/api.sh
- Start the interface:
./bin/interface.sh
All executables will now be located in build/bin
. So, for example, to execute
poker_demo.out
, simply run ./bin/poker_demo.out
from the build
directory.
- Build the project as detailed above.
- Copy
fishbait.nginx.example
to/etc/nginx/sites-available/fishbait.nginx
and replace the placeholders- Set the
host
property to the absolute path ofbuild/src/interface/build
- Set the
server_name
property to be whatever url the interface is to be deployed on.
- Set the
sudo ln -s /etc/nginx/sites-available/fishbait.nginx /etc/nginx/sites-enabled/fishbait.nginx
sudo systemctl reload nginx
- Configure
src/api/src/settings.py
- Copy
src/api/fishbait.api.service.example
to/etc/systemd/system/fishbait.api.service
and replace the placeholders- Set the
WorkingDirectory
to the absolute path ofsrc/api/src
- Set the placeholder in
ExecStart
to be the absolute path ofbuild/src/api/venv/bin/gunicorn
- Set the
- Copy
src/interface/fishbait.depot.service.example
to/etc/systemd/system/fishbait.depot.service
and replace the placeholders- Set the
WorkingDirectory
to the absolute path ofsrc/api/src
- Set the placeholder in
ExecStart
to be the absolute path ofbuild/src/api/venv/bin/python
- Set the
sudo systemctl daemon-reload
sudo systemctl start fishbait.api
- Setup https/ssl with the appropriate certbot instructions
Unit tests can be run with ./bin/tests.out
from the build
directory.
If the project is built in debug mode, a code coverage report can be generated
with make coverage
from the build
directory. gcov
and lcov
need to be
installed for code coverage.
- C++17
- CMake >= 3.20
- Gcov (for code coverage)
- LCOV (for code coverage)
- Python 3.10
- cpplint (runs during the pre-commit hook)
- pylint (runs during the pre-commit hook)
- nginx (to deploy the interface)
- Do not put commas in the Catch2 tester descriptions
- This project follows the Google C++ Style guide
with the following exceptions:
- Exceptions are allowed
- Constructors are allowed to do work and fail
- Integer types other than
int
are allowed - Type names with acronyms (like
OCHS_N
) may have underscores.
- This project follows the Google Python Style guide
with the following exceptions:
- 2 spaces are used for indentation
- Needs to be run on a processor where 32 bit integer reads and writes are atomic.