werewolf agents
06.2026A social deduction game where LLM agents lie, deduce and vote each other out on a local model.

A full game of Werewolf played by 7 or 9 LLM agents across four roles, running entirely on a local Ollama model so a game costs nothing. Every turn returns what the agent thought and what it said as two separate channels, so the two can be read side by side.
architecture
Every turn returns two channels, private_reasoning and public_action, both validated against a Pydantic schema, so what an agent thought and what it said can be read side by side. The game engine is deterministic and contains no LLM code: agents only propose moves and the engine decides what is legal, so a model that returns malformed JSON or times out costs one re-prompt and then a random legal move. An asyncio orchestrator streams game events over a WebSocket to a dashboard that shows each agent private reasoning beside its public statement.
how i built it
- Kept all LLM code out of the game engine, so agents only propose moves and the engine rules on legality.
- Made a malformed or timed-out response cost one re-prompt and then a random legal move, and turned how often that happens into a metric of its own.
- Gave the wolves real coordination: each acts at night, sees its packmates picks in private memory, and the kill is the pack majority vote.
- Shipped three roster presets, because the classic 7-player game favours the wolves, who win at parity while the only way to kill one is a day vote.
- Routed every random choice through a single seeded RNG, so a game replays exactly.
results
- 65 tests pass offline with the model mocked, under ruff and mypy strict.
- The eval harness reports win rate by team, voting accuracy, a deception proxy, doctor-save rate and the model valid-output rate over batch runs. The repo carries one smoke game rather than a published batch.