---
title: werewolf_lite
canonical_url: "https://www.modelscope.ai/models/SKYLENAGE/werewolf_lite"
md_url: "https://www.modelscope.ai/models/SKYLENAGE/werewolf_lite.md"
repository: SKYLENAGE/werewolf_lite
last_updated: 2026-06-24
library_name:
  - pytorch
frameworks:
  - pytorch
downloads: 76
stars: 0
---

# werewolf_lite

> werewolf_lite - An open-source model by SKYLENAGE on ModelScope. Werewolf Lite — 9-Player AI Werewolf Engine

- **Repository**: SKYLENAGE/werewolf_lite
- **Downloads**: 76
- **Stars**: 0
- **Last updated**: 2026-06-24

Source: https://www.modelscope.ai/models/SKYLENAGE/werewolf_lite

---

# Werewolf Lite — 9-Player AI Werewolf Engine

**English** | [中文](README_zh-CN.md)

The **AI Werewolf Arena** project of [Skylenage](https://skylenage.net) [Game Arena](https://skylenage.net/sla/arena/gameArena) — a lightweight environment for running large language models as players in a standard 9-player Werewolf (Mafia) game, covering reasoning, discussion, voting, and role-based interactions.

## Features

- **Standard 9-Player Setup**: 3 Werewolves / 1 Seer / 1 Witch / 1 Hunter / 3 Villagers
- **Multi-Model Support**: Unified access to OpenAI / Anthropic / DashScope and other LLMs via [LiteLLM](https://github.com/BerriAI/litellm)
- **Core Game Flow**: Bidding-based discussion, simultaneous majority voting, sheriff election, witch save/poison, hunter shoot, last words
- **TTS Voice Playback**: Independent voice timbre for each player, powered by DashScope CosyVoice
- **LLM Narrative Summary**: Per-cycle recap and post-game review commentary

## Quick Start

> **Requirements**: Python >= 3.10

### 1. Install Dependencies

```bash
pip install -r requirements.txt
```

### 2. Configure API Keys

Edit `configs/nine_player_chinese.yaml` and fill in the LLM API info for each player:

```yaml
game_config:
  agents:
    - role: "Werewolf"
      id: "Player1"
      agent_id: "chinese_llm"
      display_name: "GPT-4o"
      chat_mode: "text"
      llms:
        - model_name: "openai/gpt-4o"
          api_base: "https://api.openai.com/v1"
          api_key: "sk-your-api-key-here"
```

> See `configs/nine_player_chinese.yaml` for the full 9-player template.

### 3. Run the Game

```bash
python run.py --config configs/nine_player_chinese.yaml
```

Main CLI arguments:

| Argument | Description | Default |
|----------|-------------|---------|
| `--config` / `-c` | Game config file | `configs/nine_player_chinese.yaml` |
| `--output` / `-o` | Output directory | `./outputs` |
| `--debug` / `-d` | Enable debug mode | off |
| `--random` / `-r` | Use random agents for quick testing | off |
| `--shuffle` / `-s` | Randomly shuffle role assignment | off |

> **Random Seed**: Set via `game_config.seed` in the config file. Leave empty for random each run.

## Optional Features

### TTS Voice Synthesis

Requires a [DashScope](https://dashscope.aliyuncs.com) API key. Edit `tts_config.yaml`, then run:

```bash
python werewolf_tts.py -g outputs/werewolf_game_xxx.json -o ./audio_output
```

### Narrative Summary Generation

Requires an OpenAI-compatible API. Edit `summary_config.yaml`, then run:

```bash
# Single game summary
python werewolf_summary.py outputs/werewolf_game_xxx.json

# Batch processing
python werewolf_summary.py --batch --skip-existing
```

## Project Structure

```
werewolf_lite/
├── game/                       # Core game engine
│   ├── engine.py               #   Main controller (Moderator FSM)
│   ├── states.py               #   Game state management
│   ├── roles.py                #   Role definitions
│   ├── actions.py              #   Player action definitions
│   ├── records.py              #   Event & data records
│   ├── consts.py               #   Constants & enums
│   ├── base.py                 #   Game base classes
│   ├── night_elimination_manager.py  # Night resolution manager
│   └── protocols/              #   Discussion / voting / bidding protocols
│       ├── bid.py              #     Bidding protocol (incl. UrgencyBidding)
│       ├── chat.py             #     Discussion protocol
│       ├── vote.py             #     Voting protocol
│       ├── ordering.py         #     Speaking order
│       └── factory.py          #     Protocol factory
├── harness/                    # AI agent integration layer
│   ├── base.py                 #   Agent base class & LLM invocation
│   ├── chinese_agent.py        #   Chinese LLM agent
│   └── litellm_models.yaml     #   Model pricing config
├── configs/                    # Game configs
│   └── nine_player_chinese.yaml
├── run.py                      # Game entry point
├── player_beliefs_analysis.py  # ToM six-dimension scoring tool
├── werewolf_tts.py             # TTS voice synthesis tool
├── werewolf_summary.py         # LLM narrative summary tool
├── tts_config.yaml             # TTS config
├── summary_config.yaml         # Summary config
└── requirements.txt
```

## ToM Scoring Analysis

A six-dimension Theory-of-Mind scoring scheme based on `player_beliefs`, offering a quantitative view of LLM reasoning behavior in social-deduction games:

| Dimension | Description |
|-----------|-------------|
| First-Order Reasoning | Accuracy of judging others' identities |
| Second-Order Recursion | Accuracy of predicting "how others perceive me" |
| Belief Stability | Consistency of judgments across rounds |
| Dynamic Update | Efficiency of correcting errors after key information |
| Strategic Alignment | Villager truth-convergence / Werewolf deception-success |
| Game Depth | Temporal stability of second-order judgments |

```bash
# Single-game analysis
python player_beliefs_analysis.py -i outputs/werewolf_game_xxx.json

# Batch analysis
python player_beliefs_analysis.py -i outputs --batch
```

## Configuration Reference

### Game Config (`configs/nine_player_chinese.yaml`)

| Field | Description |
|-------|-------------|
| `game_config.randomize_roles` | Whether to randomly assign roles |
| `game_config.discussion_protocol` | Discussion protocol (bidding/sequential) |
| `game_config.day_voting_protocol` | Daytime voting protocol |
| `agents[].llms` | Per-player LLM config (model, API base, key) |

### TTS Config (`tts_config.yaml`)

| Field | Description |
|-------|-------------|
| `default.api_key` | DashScope API key |
| `default.model` | Voice model (default: `cosyvoice-v3-plus`) |
| `players.<id>.voice` | Independent voice timbre per player |

## Roadmap

- **Diversified Game Setups**: Support varying player counts, role compositions, and rule variants (e.g. Guard, Idiot, Wolf King) to observe LLM behavior under different information-asymmetry structures and game complexities
- **Human-AI Mixed Play**: Allow human players to participate alongside AI agents, exploring interaction patterns between humans and LLMs in social-reasoning tasks
- **Tournament & Ranking System**: Introduce Elo ratings and multi-game statistics as a reference for model-to-model comparison
- **Dynamic Strategy Evolution**: Explore game-feedback-driven iteration of agent strategies to further study ToM reasoning

## License

MIT License — see [LICENSE](LICENSE)
