CoolFace
Apppublic

Lilli98/BeerGame-HeterogeneousVersion

sourceHugging Facemitupdated 11mo agoView on Hugging Face
0likes
App README

๐Ÿบ Beer Game โ€” Human & AI Collaboration

This is a Beer Game experiment interface built with Streamlit and hosted on Hugging Face Spaces. The goal is to study human behaviour in supply chain decision-making when collaborating with AI agents (Factory, Wholesaler, Retailer powered by OpenAI GPT-4o-mini).


๐ŸŽฎ Roles

  • โ€”Distributor: Human participant โ€” you control the order quantity each week.
  • โ€”Factory / Wholesaler / Retailer: AI agents making decisions using LLMs.

๐Ÿ“Š Features

  • โ€”Classic Beer Game settings:
  • โ€”36 weeks simulation
  • โ€”2-week shipping delay
  • โ€”1-week information delay
  • โ€”Standard customer demand sequence (constant โ†’ shock โ†’ fluctuations)
  • โ€”Human plays as Distributor, other roles are LLM agents.
  • โ€”Logs saved per participant and automatically pushed to Hugging Face Datasets Hub.
  • โ€”Simple Streamlit interface, deployable on Hugging Face Spaces.
  • โ€” ---

๐Ÿ› ๏ธ Running the Experiment

1. On Hugging Face Spaces

  1. 1.Deploy this repo as a Streamlit Space.
  2. 2.Add Secrets (Settings โ†’ Secrets):
  3. 3.OPENAI_API_KEY โ€” your OpenAI API key
  4. 4.Optional for S3 export:
  5. 5.AWS_ACCESS_KEY_ID
  6. 6.AWS_SECRET_ACCESS_KEY
  7. 7.S3_BUCKET
  8. 8.S3_REGION (default: us-east-1)
  1. 1.Participants open the Space and either:
  2. 2.Enter a custom participant ID, or
  3. 3.Use the auto-generated ID shown in the app.

Example URL with participant ID:

https://huggingface.co/spaces/<user>/<space>?participant_id=ABC123


2. Locally

bash
pip install -r requirements.txt
streamlit run app.py