Analysis updated 2026-05-18
Watch a real language model generate text while seeing its attention and probabilities visualized live.
Use the visualization to teach or learn how transformer models work internally.
Record video content showing an AI model 'thinking' for educational or creative projects.
Study the hand written inference engine as a reference for building your own in-browser model runner.
| avbiswas/llm_visualizer | ccpt5/comfyui-berninistudio | hemsby/tdns-stats | |
|---|---|---|---|
| Stars | 23 | 23 | 23 |
| Language | JavaScript | JavaScript | JavaScript |
| Setup difficulty | moderate | moderate | moderate |
| Complexity | 3/5 | 3/5 | 2/5 |
| Audience | developer | vibe coder | ops devops |
Figures from each repo's GitHub metadata at analysis time.
Model preparation step needs Python and torch installed to convert weights.
This project shows a small language model thinking in real time, right inside your web browser. It runs a real AI text generator called TinyStories-33M, a compact version of GPT-Neo with 68 million parameters, entirely on your own computer using a hand written JavaScript inference engine. No server call is needed once the model is loaded, and no part of what you see is faked or simulated. Every visual effect is drawn directly from the model's actual internal math as it generates each word. The visualization uses three.js, a 3D graphics library, to turn the model's inner workings into a glowing animated scene. Generated words orbit around a central core as sprites. Inside the core, four rings represent the model's transformer layers, and they pulse based on real activation values from each layer. When the model pays attention to an earlier word while generating a new one, colored arcs strike down toward that word and it flashes gold. At the top, thousands of particles represent every candidate next word the model considered, sized and colored by how likely or unlikely each one was, before the chosen word condenses out of the swarm and drops into the sentence. To run it, you install the dependencies with npm, then run a one time setup command that downloads and converts the model weights, which requires Python and the torch library installed on your machine. After that, a development server starts and you open it in your browser. Once the model loads, you can type a prompt, adjust the generation temperature and speed, and watch the model dream on its own, with optional sound effects tied to what is happening inside the model. The code is organized into a tokenizer, the model's forward pass logic, a background worker that runs inference off the main thread, and the visual scene itself. It is aimed at people curious about how language models actually work internally, and offers a rare, literal look inside a real one instead of a diagram or an explanation.
A browser based 3D visualization that shows a real small language model's internal thinking, layer activations, and attention, live as it writes.
Mainly JavaScript. The stack also includes JavaScript, three.js, GPT-Neo.
No license file is mentioned in the README, so check the repository directly before reuse.
Setup difficulty is rated moderate, with roughly 30min to a first successful run.
Mainly developer.
This repo across BitVibe Labs
Verify against the repo before relying on details.