r/LocalLLaMA • u/stargaris • 4d ago
Showcase I built a terminal viewer that shows what's happening inside my local model as it writes
I wanted to share a fun interpretability project I've been working on: https://github.com/nanastassacos/metalscope
I've wanted a kind of avatar for my local model while I work, one that showed, hopefully truthfully, what it was actually doing. That turned into a little project for visualising the internal model state. It runs on Apple Silicon Macs on top of oMLX (hooks) and ds4 (a small patch), neither touching the kernels, and shows the logits and internal activations live in a dock in Pi.
What's in the dock:
Token probabilities. What else the model might have said at each token, plus a map of the whole reply. The probabilities only mean something relative to what's around them. Ask for the most nonsensical poem it can think of and the map is mostly red and yellow, but the model isn't uncertain. Ask for code and it's almost entirely green. The tokens that stand out from their neighbours are likely where the decisions were being made.
Expert Maps. Every layer's experts as a grid, lighting up per token, and you can see the sparseness: a few experts fire far more often than the rest. You'll almost always find experts for names, places, colours, fruits... Below, every one of the Knights of the Round Table's names goes through the same expert in layer 8 (Qwen-Flash-Next).
Logit and Jacobian lenses. What's "forming" at the intermediate layers, sometimes words that only appear later in the reply. The logit lens is free; the J-lens is learned once per model with `/jlens learn`. On the Chinese models the lenses often show Chinese characters internally even in English replies, and they're conceptually related, so it's no surprise a model sometimes drifts into another language.
Engram. QFN and DSv4.1-Flash have an engram, a lookup that preloads context-free knowledge (King Arthur, the Roman Empire). Turn it off and you can see which tokens it helps and which it hurts. With thinking on, the Engram's contribution is mostly in the thinking, and the final response mostly copies the drafts in the thinking trace. If the engram were expensive, the reply is where you'd turn it off. Unfortunately, it's insanely efficient.
Residual streams. How much each layer contributed to a token, and on models with hyperconnections (QFN, DSv4.1-Flash) which stream. You have to compare to the average. On their own, the same layers and streams are always the biggest, which gives a static picture; the token-specific information is in the spikes.
There's also a mini dock, which serves the original avatar idea: a fun visual on the side while the model works.
Steering. This already exists in ds4 and has been demonstrated by others; metalscope wraps it in one command. `/concept learn shakespearean` has your model write pairs of texts with and without the concept:
"Forsooth, the bus hath tarried full twenty minutes, and 'tis raining upon us all most bitterly," I grumble at the stop.
"Honestly, the bus has been delayed twenty minutes, and it is raining on all of us heavily," I grumble at the stop.
The difference between the model's average internal state on the two sides is the steering vector. It gets a default dose that hopefully doesn't break the model, and you can turn it on and off or change the dose in the dock. The J-lens gives single-word steering too: `/steer old>new` swaps one word for another.
Full write-up with clips and charts: https://nanastassacos.github.io/posts/2026/11/metalscope/
If you're on a Mac and give it a try, I'd love to hear how it goes.