Prompt Chainer — Visual LLM Graph Editor
Drag-and-drop canvas that chains local LLM calls through logic gates and loops, with live execution tracing.
A visual graph editor for local LLM reasoning chains. Drag nodes onto a canvas, wire outputs to inputs, branch on classification results, and use loop counters to bound refinement cycles. Powered by Ollama for local model inference.
- Node.js 18+
- Express.js
- React 18
- ReactFlow (XYFlow)
- Tailwind CSS
- Vite
- Ollama
- Server-Sent Events (SSE)
- Fetch API
Prompt Chainer is a dataflow executor designed for multi-step LLM reasoning patterns. Instead of writing complex prompt concatenation logic or prompt chains as imperative code, you build graphs visually: inputs feed into LLM templates, classifiers branch on verdicts, and loop counters gate cycles to prevent runaway fires. The default template loads a scientific-method-plus-refinement pipeline that reasons, evaluates, refines iteratively, and halts when the evaluator judges the answer "good" or the loop maxes out.
The architecture splits cleanly: a Node.js/Express backend runs the dataflow executor with latched inputs and dirty-port tracking (so nodes only re-fire when fresh data arrives), while a React/ReactFlow frontend renders the canvas and visualizes execution live via SSE events. As the run progresses, nodes pulse amber, edges flash, and a timeline panel records every fire—making it transparent why a node fired, what inputs it saw, and which downstream nodes it triggered.
Six built-in template prompts ship ready to drag: Scientific Method, Strict Evaluator, Refiner, Steel-man, Summarizer, and Issue Finder. Each becomes an LLM node pre-filled with a system prompt and placeholder user template. You wire them up, type a question, and watch the graph execute locally against your Ollama installation. The safety rails include per-node fire caps (25) and a global budget (100 total fires) to catch pathological loops early.
- Latched dataflow with dirty-port tracking: nodes fire only when all required inputs are latched AND conditions are met, preventing stale-data bugs in cycles
- Trigger-port convention for cycle synchronization: downstream nodes wait for explicit fire signals from classifiers and loop counters, not implicit input changes
- Live execution visualization: SSE streaming sends per-node fires, edge traversals, and iteration counts; the canvas pulses and the timeline captures full audit trail
- Six template prompts (Scientific Method, Evaluator, Refiner, etc.) ship built-in; dragging them onto the canvas auto-generates LLM nodes with system prompt and {{var}} interpolation ready to use
- Loop counter with emergency-exit indicator: max iterations cap is visible in the UI, and hitting the max triggers the rust-colored "maxed" port instead of "next"