A small local experiment with five dining philosophers controlled by either a greedy symbolic policy or a tiny local LLM.
The simulator owns the rules. The LLM only proposes one action per tick, and the app validates that action before applying it. This keeps the experiment grounded: model outputs can be wrong, malformed, selfish, or strange, but they cannot crash or directly mutate the game.
- Simulates 5 agents and 5 shared forks in a ring
- Runs a greedy baseline without any model
- Runs a constitutional LLM mode through local Ollama
- Uses the required model
llama3.2:1b - Tracks hunger, starvation, meals, conflicts, rewards, and simple cooperation signals
- Shows a live table view, event log, metrics, and exportable episode JSON
- Node.js
- npm
- Optional for LLM mode: Ollama
Greedy mode works without Ollama.
For LLM mode, install the model:
ollama pull llama3.2:1bor start it with:
ollama run llama3.2:1bInstall dependencies:
npm installStart the app and local server:
npm run devOpen:
http://localhost:5173The React app talks to the local Express server. The browser does not call Ollama directly.
Typecheck:
npm run typecheckBuild:
npm run buildThis is intentionally a local research toy. There is no fine-tuning, RAG, database, auth, or cloud model API. The interesting bit is whether a tiny model, constrained by a shared constitution and a strict symbolic simulator, can develop better coordination than a raw greedy policy.