model-graph

See your model think: live LLM internals in your browser

2026-07-20 · Quirin Schlegel · 4 min

When an LLM-powered agent misbehaves, the only artifact you usually get is text. Did the model fail to know something? Fail to look at the right part of the prompt? Commit to a wrong answer at layer 10 and spend the rest of the network polishing it? The information to answer those questions exists in every forward pass — it just gets thrown away.

model-graph keeps it. A dozen PyTorch forward hooks capture per-token internals — block write norms, per-head activity, MoE router flow, a logit-lens ladder, attention sources, uncertainty, and 3D residual trajectories — and stream them over a websocket into a chat window whose background is the visualization.

Zero-friction by design

The server speaks the OpenAI API, so any SDK or agent framework gets instrumented by changing one base URL. Tool calls are parsed into spec-compliant tool_calls; vision-language models hook the language tower so image chats are inspectable too. Every run is recorded by a curator that can gate CI: assertions over internals (settle depth, entropy, attention focus) and tool-reasoning suites (should-call / abstain / argument checks / grounded chains).

Honest pixels

One rule holds everywhere: nothing is rendered that wasn't measured. If a signal isn't captured — per-head matrices, browser-run internals — the UI says so on the canvas instead of interpolating. Observability you can't trust is worse than none.

Try the live demo (mock backend, real UI), or run it locally against LFM2.5, SmolLM2, Qwen — any HF causal or VL model. Source on GitHub, MIT.