FRESNEL
FRESNEL: A Visual Workbench for Training and Interpretability
FRESNEL is a node-graph IDE for training neural networks and looking inside them while they learn. You wire an experiment together on a canvas, press Run, watch it train live, pause it mid-run, open the checkpoint in an inspector, and resume. Underneath it all there is always a plain Python script you can read and run yourself.
Why I’m building it
Interpretability research usually means gluing TransformerLens, custom hooks and plotting code together in a notebook, then throwing it away. The analysis also tends to happen after training, when it’s too late to act on what you find.
I wanted a tool where the experiment is something you can see and rewire, where interp tools run during training, and where nothing is locked inside a UI.
Design rules
- Nodes are thin wrappers over real library functions. A node only declares which library function it calls, its input/output ports and its parameters. It holds no logic, so
import fresnelis a complete product without the canvas, and adding a new interp method is one function plus one small declaration. - The graph compiles to readable Python, and that is the only way it runs. Pressing Run compiles the graph to
run.pyand launches it as a separate process. There is no graph interpreter, so a UI run and a script run can’t diverge. - Training is a long-lived streaming node. Interp tools subscribe to its step events, so a run with no observers pays no overhead.
- Agents use the same surface as humans. A graph is a JSON file, running is compile → subprocess, and control is a file. An agent edits a graph and launches it exactly the way a person does, with no agent-only back door.
A tour of the app
FRESNEL has six tabs: Canvas, Training, Inspector, Weight-space, Runs and Agent. The screenshots below were taken on 1 December 2026, on CPU.
About these screenshots. The models are deliberately tiny (a 0.1M-parameter nanoGPT learning two-digit addition), and their accuracy is in single digits. The shots show what the tool does, not good results.
Most of them follow one run: a single graph that trains with SFT, then GRPO, then DPO (600 + 150 + 150 steps), with a logit lens observer and DuckDB logging attached.
1. Canvas
Wire an experiment as a graph. The node palette is generated from the library’s registry, so every library function with a node declaration shows up here. Connect dataset → model → trainer → observers and press Run. Here SFT, GRPO and DPO run as one pipeline, with a logit lens watching and live metrics beside the canvas.

Pick nodes from the palette and set every parameter, each with its type and range, without writing code. Each node can also pick its device (cpu, cuda:N or inherit).

Eject. Every graph compiles to a plain Python script, and that script is what runs. Eject just shows it to you, so you can read it, change it or take it with you.

Also on the canvas: undo/redo, palette search, deleting wires, and auto-layout for graphs saved without positions.
2. Training
Follow a run live. A multi-stage run shows progress per stage (e.g. grpo 50/150), its checkpoints, and continuous loss, evaluation and reward charts. Each stage gets its own optimizer and learning-rate schedule. Pause, resume and stop work from the UI or another terminal, and the run writes a checkpoint before it pauses.

Watch what reinforcement and preference training are doing, from reward margins to KL, entropy and logit lens metrics. Six health alerts flag common problems as they happen.

Read the model’s chosen and rejected answers next to the data it trains on.

Trainers: SFT, DPO and GRPO (with reward nodes for GRPO). The loss jumps at each stage boundary because each objective defines loss differently.
3. Inspector
Open any checkpoint, including a paused run, and ask one question per view. Any view can compare two checkpoints side by side.
Lens: what does each layer predict at every position? Logit lens and tuned lens.

Attention: where does each head look, and what kind of head is it? Previous-token, sink and induction heads are scored and labelled automatically.

Patching: which activations drive the answer? Activation patching between a clean and a corrupted prompt, per layer × position or per head. (This shot shows the interface. The model here is too weak for the heatmap values to mean much.)

Directions: is a concept a linear direction, and which weight columns write it? Difference-of-means probes per layer, exportable as .pt.

Weights: what do the matrices look like, and what changed? Norms, stable rank, singular value spectra, heavy-tail α, and ΔW between two checkpoints.

4. Weight-space programming
Change what a model does by writing a program that edits its weights, with no gradient descent. The agent writes the edit program itself rather than following a fixed recipe. FRESNEL runs it out of process under a budget, measures ΔW, and scores every attempt on held-out data, so each one can be kept or discarded.

See exactly which weights an edit changed and how the model’s activations moved.

Status: built, not yet shown to work. The whole loop runs end to end, but so far it has only been tried on models this small and this inaccurate, where a change of a point or two on 200 problems is noise. Whether a programmed edit can really change behaviour is still the open question.
5. Runs
Every experiment in one table, with status, metrics and the run it came from. Runs can be tagged, annotated, filtered, archived, deleted and exported to CSV.

Overlay curves, trace lineage (e.g. grpo1 ← sft1) and diff configurations across runs.

Compare runs parameter by parameter.

6. Agent
A chat agent that reads the palette, edits graphs, launches runs and reads metrics through the same tools you use.
- Autonomy levels: suggest, ask or auto. Launching, pausing and stopping a run always ask for approval, even in auto.
- Profiles and skills: general, inspect, planner and weight-space profiles, each with its own tools and instructions.
- What it can do: download datasets (tested with Tiny Shakespeare and TinyStories), evaluate checkpoints, and write new nodes or analyses. Those are tested in a separate process and installed only after you approve them.
- Providers: any OpenAI-compatible API (OpenRouter, OpenAI, Azure, vLLM, Ollama). Tested live with gpt-4o-mini and Claude Sonnet 4.5 through OpenRouter.
Describe what you want. The agent builds the graph and waits for your approval before changing it.

It works through the same tools you do: edit a graph, launch a run, then read its metrics and logs.

It summarises what an analysis measured and drafts the next one. (Its reading of a 200-step run is more confident than the run supports, which is part of why it asks before acting.)

Ask it to sketch a new analysis and read the code it proposes before anything is installed.

How a run works
canvas ──> graph.json ──> compile ──> run_<id>.py ──> subprocess
│ │
"Eject" events ──> DuckDB ──> UI
shows this control <── file <── UI
Because the run is its own process, it survives the UI closing, and headless is the default rather than a special mode. The backend can run on a GPU machine while the UI stays in your laptop’s browser, either over an SSH tunnel or with fresnel serve, which serves the API and UI on one port behind a token.
Tech stack
- Library and runtime: Python, PyTorch, DuckDB for metrics
- API: FastAPI with a WebSocket event stream
- UI: React 19 + React Flow
- Integrations: Hugging Face datasets and models, OpenAI-compatible LLM providers for the agent
- Extensibility: drop new nodes or inspector analyses into a plugins folder. They’re tested out of process before they’re installed.
Quick start
pip install -e ".[dev,all]"
fresnel run examples/graphs/arith_sft.json # ~1 min on CPU
fresnel run examples/graphs/arith_grpo.json # starts from the SFT run above
fresnel run examples/graphs/arith_pipeline.json # SFT → GRPO → DPO in one run
(cd ui && npm run build) # build the UI once
fresnel serve # API + UI on one port
The repository’s docs/ folder has one document per part of the system, written so that each part could be rebuilt from it.
What’s next
- Broader training: the full TRL toolbox (ORPO, KTO, reward modelling, PPO, RLOO, RLHF and RLVR recipes) behind the same node contract, and training on the GPU end to end.
- Distillation and custom objectives taken from papers.
- Benchmarks through lm-evaluation-harness.
- Hugging Face models in the Inspector, starting with GPT-2.
- MCP, sub-agents and accessibility for the agent and the UI.
- Packaging:
pip install fresnel, a “write your own node” guide and first-class W&B logging. - Agent swarms: planned, but deliberately on hold until the single agent is solid.
How it’s being built
FRESNEL is also an experiment in AI-assisted development: it’s written entirely with Claude Code. I describe what I want, push back on the design and test it, and Claude writes the code. The code is checked with strict ruff and mypy and has around 290 tests.
It started in February 2026 as “ProceduralInterp”, a planned 22-module interpretability platform. An audit on 29 October found about 340 KB of spec and only 7.5 KB of working code, so I cut the scope down to one idea and renamed it FRESNEL. The core (library, streaming, canvas and inspector) was then built in a single overnight session on 30 November.
GitHub Repository
Code, docs and roadmap: github.com/Manodeepray/fresnel. There’s also a short post on the idea and where it stands now: FRESNEL: A Visual IDE for Interpretability Experiments.