Compare how multiple LLMs answer the same ethical dilemma in parallel
Pin a model to a moral framework like Kantian or utilitarian via system prompt slots
Run a classroom exercise where students upload dilemmas and read model answers side by side
Export model answer history as JSON or CSV for analysis
Needs Python 3.11+, Node 18+, and an OpenRouter API key in a backend .env file.
Trolley to LLM is a small web app for comparing how different AI chat models answer the same ethical dilemma at the same time. The classic example given in the README is the trolley problem, where the user is asked whether to divert a runaway trolley onto a different track. The app lets the user collect questions like this, send each one to several models in parallel, and see the answers side by side. What makes the comparison more structured is a feature the project calls slots. A slot pairs one model with one moral viewpoint, for example GPT-4o reasoning as a Kantian, or Claude reasoning as a utilitarian. The viewpoint is sent to the model as a system prompt so the model is told to answer from that ethical position. The user can add more slots to widen the comparison and read the full prompt behind each viewpoint by clicking a small info button. The data side is straightforward. Questions are stored in a JSON file on the backend and can be added, edited, or deleted from inside the app, or uploaded in bulk as JSON or CSV. Every time the user clicks Send to All Models, the backend forwards the requests through OpenRouter, which is an API service that talks to many providers, and writes each model's choice, reasoning, and identified ethical framework into a history file. A hash of the question text is stored alongside each response, so the history does not gain duplicates when the same question is asked again with the same slot. The stack listed in the README is FastAPI and Pydantic in Python for the backend, React 19 with TypeScript, Vite, and Tailwind CSS v4 for the frontend, and OpenRouter as the gateway to the underlying models. Setup requires Python 3.11 or newer, Node 18 or newer, and an OpenRouter API key in a backend .env file. Results can be exported as JSON or CSV.
Generated 2026-05-22 · Model: sonnet-4-6 · Verify against the repo before relying on details.