git404hub

what is trolley-to-llm fr?

marianovilla/trolley-to-llm — explained in plain English

Analysis updated 2026-05-18

15TypeScriptAudience · researcherComplexity · 3/5Setup · moderate

tl;dr

Web app that sends an ethical dilemma to several AI models at once, each pinned to a moral viewpoint, and shows their answers side by side with history.

vibe map

mindmap
  root((Trolley-to-LLM))
    Inputs
      Ethical questions JSON
      Model and viewpoint slots
      OpenRouter API key
    Outputs
      Side by side answers
      History file
      JSON or CSV export
    Use Cases
      Compare model ethics
      Study moral frameworks
      Teach AI alignment
    Tech Stack
      FastAPI
      Pydantic
      React
      Vite
      Tailwind
      OpenRouter

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

what do people make with this?

VIBE 1

Compare how multiple LLMs answer the same ethical dilemma in parallel

VIBE 2

Pin a model to a moral framework like Kantian or utilitarian via system prompt slots

VIBE 3

Run a classroom exercise where students upload dilemmas and read model answers side by side

VIBE 4

Export model answer history as JSON or CSV for analysis

what's the stack?

FastAPIPydanticReactTypeScriptViteTailwindOpenRouter

how it stacks up fr

marianovilla/trolley-to-llmaredotna/api-examplesceelog/openweread
Stars151515
LanguageTypeScriptTypeScriptTypeScript
Setup difficultymoderatemoderatemoderate
Complexity3/52/52/5
Audienceresearcherdeveloperdeveloper

Figures from each repo's GitHub metadata at analysis time.

how do i run it?

Difficulty · moderate time til it works · 30min

Needs Python 3.11+, Node 18+, and an OpenRouter API key in a backend .env file.

in plain english

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.

prompts (copy fr)

prompt 1
Set up Trolley-to-LLM locally with an OpenRouter key and run my first dilemma across 3 models
prompt 2
Add a new slot to Trolley-to-LLM that pairs Claude with a virtue ethics viewpoint and explain the system prompt
prompt 3
Bulk import 20 dilemmas as CSV into Trolley-to-LLM and export the history as JSON for analysis
prompt 4
Extend Trolley-to-LLM to compute agreement scores across slots for each question

Frequently asked questions

what is trolley-to-llm fr?

Web app that sends an ethical dilemma to several AI models at once, each pinned to a moral viewpoint, and shows their answers side by side with history.

What language is trolley-to-llm written in?

Mainly TypeScript. The stack also includes FastAPI, Pydantic, React.

How hard is trolley-to-llm to set up?

Setup difficulty is rated moderate, with roughly 30min to a first successful run.

Who is trolley-to-llm for?

Mainly researcher.

peek the repo → explain another one

This repo across BitVibe Labs

double-check against the repo, no cap.