A simulation where 5 personas (distinct personalities/memories) compete using a single local LLM. Each round consists of discussion, scoring, and elimination phases.
-
Discussion Phase: Each persona responds to a given situation/scenario. Responses are saved to
round_X_discussion/*.txtfiles. -
Scoring Phase: Each persona evaluates and scores all other personas' responses based on their own values/propaganda. Scores are saved to
round_X_scoring/*.jsonfiles. -
Elimination Phase: Average scores are calculated, the lowest-scoring persona is eliminated, and remaining personas react to the elimination. Results are saved to
round_X_output/with reactions in.txtfiles.
The game continues until only one persona remains.
This project uses uv for package management. Make sure you have uv installed:
# Install uv if you haven't already
curl -LsSf https://astral.sh/uv/install.sh | shInstall dependencies:
uv syncMake sure you have Ollama installed and running:
# Install Ollama (if not already installed)
# Visit https://ollama.ai or use: curl -fsSL https://ollama.ai/install.sh | sh
# Start Ollama service
ollama serve
# Pull a model (in another terminal)
ollama pull llama3.1:8b
# or any other model you preferRun with a single situation:
uv run llm-hunger-games run \
--model llama3.1:8b \
--situation "A group must decide how to allocate limited resources during a crisis"Create a file with situations (one per line):
# situations.txt
A group must decide how to allocate limited resources during a crisis
A conflict arises between individual freedom and collective safety
A difficult choice between two equally important values must be madeThen run:
uv run llm-hunger-games run \
--model llama3.1:8b \
--situations-file situations.txt \
--output my_game_outputuv run llm-hunger-games list-modelsThe game creates an output directory (default: game_output/) with the following structure:
game_output/
├── round_1_discussion/
│ ├── the_pragmatist.txt
│ ├── the_idealist.txt
│ ├── the_strategist.txt
│ ├── the_empath.txt
│ └── the_maverick.txt
├── round_1_scoring/
│ ├── the_pragmatist.json
│ ├── the_idealist.json
│ ├── the_strategist.json
│ ├── the_empath.json
│ └── the_maverick.json
├── round_1_output/
│ ├── elimination.json
│ ├── the_pragmatist_reaction.txt
│ ├── the_idealist_reaction.txt
│ └── ...
├── round_2_discussion/
│ └── ...
└── final_results.json
The game includes 5 default personas:
- The Pragmatist: Values efficiency, practical solutions, and data-driven decisions
- The Idealist: Values principles, ethics, and moral correctness
- The Strategist: Values long-term planning, calculation, and achieving goals
- The Empath: Values human connection, compassion, and harmony
- The Maverick: Values independence, innovation, and challenging norms
llm_hunger_games/
├── cli.py # Typer CLI interface
├── models.py # LLM model wrapper (Ollama API)
├── persona.py # Persona class with personality and memory
├── game.py # Game engine with discussion/scoring/elimination
└── main.py # Entry point
You can modify the personas in cli.py to create your own set of competing personalities with different values and characteristics.