Skip to main content

Snow Globe

Open-Ended Wargames with Large Language Models

Snow Globe, an ongoing applied research project and resulting software package, uses large language models (LLMs) for automated play of "open-ended" text-based wargames, such as seminar games and political wargames. LLMs enable a light, flexible architecture in which player actions are not restricted to predefined options. The system allows humans to play against or alongside AI agents with specific personas. Every stage of the wargame from scenario preparation to post-game analysis can be optionally carried out by AI, humans, or a combination thereof.

Read more here.

Installation

Build the Docker image and run a container.

./docker_setup.sh

Or, install Snow Globe from PyPI. For CPU only:

pip install llm-snowglobe

For GPU support:

CMAKE_ARGS="-DGGML_CUDA=on" pip install llm-snowglobe

AI Simulations

After installation, you can simulate a tabletop exercise about an AI incident response.

examples/haiwire.py

Or, simulate a political wargame about a geopolitical crisis.

examples/ac_sim.py

Human+AI Wargames

To play a game between a human and an AI player, launch the server and start a game:

snowglobe_server &
examples/ac_game.py

Then, open a browser window and navigate to:

http://localhost:8000

The terminal output will begin with the ID number for the human player. Type that number into the ID box in the browser window and click Log In.

Make sure to run snowglobe_server from the same file system location where you run the game. Game-related files will be stored in that location.

Custom Games

By default, Snow Globe uses a light LLM that runs locally. For better results, try the OpenAI API:

  • Create an environment variable called OPENAI_API_KEY with your OpenAI API key in it. In a bash shell, for example: export OPENAI_API_KEY=your0key0here
  • In the example game you want to use with OpenAI, find the line that says super().__init__() and change it to this: super().__init__(source='openai', model='gpt-4o') or similarly for whatever model you want to try.

Beyond that, you can use the examples as starting points for developing your own games, or you can create entirely new game formats using the Python classes provided by Snow Globe.

License

This repo is released under the Apache License Version 2.0, except for jQuery which is released under the MIT License.

Metadata

Release files for llm-snowglobe 1.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for llm-snowglobe 1.0.0
File Size Uploaded
llm_snowglobe-1.0.0.tar.gz 179.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for llm-snowglobe 1.0.0
File Interpreter ABI Platform
llm_snowglobe-1.0.0-py3-none-any.whl Python 3 none any Details

Total release size: 358.0 kB

Release files / llm_snowglobe-1.0.0.tar.gz

Download URL llm_snowglobe-1.0.0.tar.gz
Size 179.6 kB
Tags Source
SHA-256 checksum
How to use checksums
5869216ba097515a585dd66a866638d476e63361ed3e11b476e29d7b885c148a
BLAKE2b-256 checksum
How to use checksums
efce357a6b3916f25e3fffe3dc9eea79c927bdc0776f997ad6406e9f8a1569e8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.3

Release files / llm_snowglobe-1.0.0-py3-none-any.whl

Download URL llm_snowglobe-1.0.0-py3-none-any.whl
Size 178.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e126cda2fafcb0c4d1eda1f0af29b6c3eaa4d1435751c735d5791af206c98794
BLAKE2b-256 checksum
How to use checksums
260ac7c153107a12f0a570475f38ce80522befa3da1e842536ba75de539e0634
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.3

Release history Release notifications | RSS feed

This release

1.0.0 This release

2 release files

0.9.0

2 release files

0.8.0

2 release files

0.7.0

2 release files

0.6.0

2 release files

0.5.0

2 release files

0.4.1

2 release files

0.4.0

2 release files

0.3.1

2 release files

0.3.0

2 release files

0.2.0

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page