whatisgithub

What is llm_visualizer?

avbiswas/llm_visualizer — explained in plain English

Analysis updated 2026-05-18

23JavaScriptAudience · developerComplexity · 3/5Setup · moderate

In one sentence

A browser based 3D visualization that shows a real small language model's internal thinking, layer activations, and attention, live as it writes.

Mindmap

mindmap
  root((llm visualizer))
    What it does
      Runs model in browser
      Visualizes attention
      Shows token probabilities
    Tech stack
      JavaScript
      three.js
      GPT-Neo model
      Web Worker
    Use cases
      Learn how transformers work
      Demo AI internals
      Create visuals for video
    Audience
      Curious learners
      Developers
      Educators

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

What do people build with it?

USE CASE 1

Watch a real language model generate text while seeing its attention and probabilities visualized live.

USE CASE 2

Use the visualization to teach or learn how transformer models work internally.

USE CASE 3

Record video content showing an AI model 'thinking' for educational or creative projects.

USE CASE 4

Study the hand written inference engine as a reference for building your own in-browser model runner.

What is it built with?

JavaScriptthree.jsGPT-NeoWeb WorkerPythonPyTorch

How does it compare?

avbiswas/llm_visualizerccpt5/comfyui-berninistudiohemsby/tdns-stats
Stars232323
LanguageJavaScriptJavaScriptJavaScript
Setup difficultymoderatemoderatemoderate
Complexity3/53/52/5
Audiencedevelopervibe coderops devops

Figures from each repo's GitHub metadata at analysis time.

How do you get it running?

Difficulty · moderate Time to first run · 30min

Model preparation step needs Python and torch installed to convert weights.

No license file is mentioned in the README, so check the repository directly before reuse.

So what is it?

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.

Copy-paste prompts

Prompt 1
Walk me through how to install and run llm_visualizer locally, including the model preparation step.
Prompt 2
Explain what the residual stream and attention arcs represent in this visualization.
Prompt 3
Help me understand the GPT-Neo forward pass code in src/engine/model.js.
Prompt 4
Show me how the probability storm particles relate to the model's softmax output.

Frequently asked questions

What is llm_visualizer?

A browser based 3D visualization that shows a real small language model's internal thinking, layer activations, and attention, live as it writes.

What language is llm_visualizer written in?

Mainly JavaScript. The stack also includes JavaScript, three.js, GPT-Neo.

What license does llm_visualizer use?

No license file is mentioned in the README, so check the repository directly before reuse.

How hard is llm_visualizer to set up?

Setup difficulty is rated moderate, with roughly 30min to a first successful run.

Who is llm_visualizer for?

Mainly developer.

Open on GitHub → Ask about another repo

This repo across BitVibe Labs

Verify against the repo before relying on details.