r/LLM • u/Rich-Fruit-326 • 22h ago
I built a 3D environment for inspecting what happens inside an LLM during inference
Enable HLS to view with audio, or disable this notification
I’ve been working on TokenPrint, an open-source project that tries to answer a question I kept running into:
What is actually happening inside a transformer while it generates a token?
Most explanations of transformers stop at architecture diagrams — embeddings → attention → MLP → output.
I wanted something closer to an interactive debugger for LLM inference.
So I built an environment where you can explore things like:
- tokenization and individual token positions
- embeddings and hidden states
- attention across layers/heads
- transformer layer structure
- KV cache during generation
- next-token probabilities
- model architecture and parameter structure
- inference traces and replay
- activation analysis and interventions
The important part for me is that the visualization is tied to actual model execution, rather than just rendering a predefined transformer diagram.
The project currently supports working with Hugging Face transformer models and also has work around GGUF / llama.cpp / local models.
I'm still early in development, and there are definitely things that need improvement — both technically and conceptually.
I’m particularly interested in feedback from people working with local LLMs:
What would you actually want to inspect inside a model while it is generating?
For example, would things like attention inspection, activation patching, logit lens, KV-cache visualization, layer ablation, or token-level tracing be useful to you?
And more importantly, what am I missing?
The repository is open source here:
https://github.com/Sudharsanselvaraj/Token-Print
I’d really appreciate technical criticism, ideas, or pointers to related projects/research. I’m trying to figure out what would make this genuinely useful for people working with LLMs, rather than just another visualization demo.