Skip to content

A Python implementation of the board game Secret Hitler, with the ability to play with different LLMs.

Notifications You must be signed in to change notification settings

kwonathan/secret-hitler

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

23 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Secret Hitler

CAN YOU FIND AND STOP THE...

Secret Hitler Logo

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.

🎲 Table of Contents

πŸ§‘β€πŸ’» Installation

  1. Clone the repository:

    git clone https://github.com/kwonathan/secret-hitler.git
    
  2. Navigate to the project directory:

    cd secret-hitler
    
  3. Make sure that the OpenAI Python SDK is installed, and that you have created and exported an API key by following the instructions here.

πŸ’» Usage

To start the game, run the following command:

python main.py

The following options are available:

  • -P or --players (default: 5): specify the number of human and/or LLM players (options: 5 to 10).
  • -H or --humans (default: 0): specify the number of human players (options: 0 to 10).
  • -S or --strategy (default: False): specify whether the LLMs should use an optional strategy prompt (options: True or False).
  • -M or --model (default: gpt-4o-mini): specify the model to use for the LLMs (gpt-4o or gpt-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.

πŸ“ Notes

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!

About

A Python implementation of the board game Secret Hitler, with the ability to play with different LLMs.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages