Skip to content
caarcilosPublic

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

2 Commits

Folders and files

Repository files navigation

Constitutional Philosophers

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.

What It Does

  • 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

Requirements

  • Node.js
  • npm
  • Optional for LLM mode: Ollama

Greedy mode works without Ollama.

For LLM mode, install the model:

ollama pull llama3.2:1b

or start it with:

ollama run llama3.2:1b

Run Locally

Install dependencies:

npm install

Start the app and local server:

npm run dev

Open:

http://localhost:5173

The React app talks to the local Express server. The browser does not call Ollama directly.

Useful Commands

Typecheck:

npm run typecheck

Build:

npm run build

Notes

This 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.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages