CAN YOU FIND AND STOP THE...
The year is 1932. The place is pre-WWII Germany. In Secret Hitler, players are German politicians attempting to hold a fragile Liberal government together and stem the rising tide of Fascism. Watch out thoughβthere are secret Fascists among you, and one player is Secret Hitler.
This is a Python implementation of the board game Secret Hitler, the game rules for which are available here.
In this implementation, players can either play amongst themselves, play with different LLMs, or simply watch the LLMs play with each other.
-
Clone the repository:
git clone https://github.com/kwonathan/secret-hitler.git -
Navigate to the project directory:
cd secret-hitler -
Make sure that the OpenAI Python SDK is installed, and that you have created and exported an API key by following the instructions here.
To start the game, run the following command:
python main.py
The following options are available:
-Por--players(default:5): specify the number of human and/or LLM players (options:5to10).-Hor--humans(default:0): specify the number of human players (options:0to10).-Sor--strategy(default:False): specify whether the LLMs should use an optional strategy prompt (options:TrueorFalse).-Mor--model(default:gpt-4o-mini): specify the model to use for the LLMs (gpt-4oorgpt-4o-mini).
Tip
The LLMs can have a tendency to hallucinate conversations between the players. If this happens consistently, or you find that they are not following some of the game rules (for example, on re-election eligibility), consider switching to the gpt-4o model, which is more powerful but still relatively inexpensive to run.
This work was done as part of the Cooperative AI: Foundations & Frontiers module for the AIMS CDT. I hope you have fun watching the LLMs play against each other and playing with them!