gitwtfhub

wtf is visual-llm?

loktar00/visual-llm — explained in plain English

Analysis updated 2026-05-18

2JavaScriptAudience · developerComplexity · 4/5LicenseSetup · moderate

TL;DR

A browser tool that visualizes how a Mixture-of-Experts LLM routes tokens through experts, plus scripts to prune rarely used experts and shrink the model file.

Mindmap

mindmap
  root((visual-llm))
    What it does
      Records MoE routing
      Replays as light visuals
      Twelve visual styles
    Tech stack
      JavaScript viewer
      C++ capture tool
      llama.cpp
    Use cases
      Visualize model routing
      Find cold experts
      Prune GGUF models
    Audience
      ML researchers
      Model developers
      Curious tinkerers

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

Why would anyone build with this?

REASON 1

Visualize which experts a Mixture-of-Experts model uses while generating text.

REASON 2

Identify rarely used experts in a model to prepare for pruning.

REASON 3

Shrink a large MoE GGUF model file by physically removing cold experts.

REASON 4

Run a llama.cpp server that captures live chat routing data for later replay.

What's in the stack?

JavaScriptC++llama.cppGGUFPython

How it stacks up

loktar00/visual-llm3imed-jaberi/cryptography-si-isamm3imed-jaberi/koa-isomorphic-router
Stars222
LanguageJavaScriptJavaScriptJavaScript
Last pushed2021-09-252021-02-06
MaintenanceDormantDormant
Setup difficultymoderateeasyeasy
Complexity4/51/52/5
Audiencedeveloperresearcherdeveloper

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

How do you spin it up?

Difficulty · moderate Time to first run · 5min

The viewer needs no setup, but capturing your own model requires building a C++ tool inside a llama.cpp checkout.

You can use, modify, and distribute this project freely, including for commercial purposes, as long as you keep the copyright notice.

Wtf does this do

visual-llm is a browser based tool that lets you watch how a Mixture of Experts language model makes decisions while it processes text. In these models, each token passes through a small set of chosen experts per layer, and this project records those routing choices from a real model running on llama.cpp, then replays them as light moving through one of twelve visual styles, including a spider web, a brain shape, a gravity well, a galaxy, and a metro map. Areas that get used often light up, while experts that are rarely visited stay dark, making it easy to see which parts of the model are doing the work. You do not need to install anything to try it. Cloning the repository and opening index.html in a browser is enough, and three sample recordings are included so you can explore the visualizations before connecting a real model. Keyboard controls let you switch between styles, pause or scrub through the replay, show token labels, turn on a heatmap of expert usage, and toggle between recent and cumulative heat. You can also drag and drop your own recording files in JSONL format. Beyond visualization, the project includes a pipeline for actually shrinking a model. A capture tool built on llama.cpp records routing data, which a script then uses to figure out which experts are rarely used across a set of prompts. Those cold experts can be tested by masking them during inference to see how the model behaves without them, and if the results look safe, another script physically removes those experts from the model file itself, producing a smaller version. The README reports one example where a 35 billion parameter model was reduced from 256 to 192 experts, cutting its file size by about 22 percent, with only tiny differences in output. The tool also supports running llama.cpp as a server so it can capture live chat sessions, browse past recordings, and apply pruning through the interface rather than the command line. Everything in this repository, including the viewer and the pruning scripts, is released under the MIT license.

Yoink these prompts

Prompt 1
Help me set up visual-llm-capture inside my llama.cpp checkout to record routing data from a Qwen3 MoE model.
Prompt 2
Walk me through using make_mask.py to build a reap mask from a corpus of prompts in visual-llm.
Prompt 3
Explain how the reap lens and mask editor in visual-llm let me hand pick experts to prune.
Prompt 4
Show me how to run llama.cpp as an OpenAI-compatible server so visual-llm can browse and replay routing recordings.

Frequently asked questions

wtf is visual-llm?

A browser tool that visualizes how a Mixture-of-Experts LLM routes tokens through experts, plus scripts to prune rarely used experts and shrink the model file.

What language is visual-llm written in?

Mainly JavaScript. The stack also includes JavaScript, C++, llama.cpp.

What license does visual-llm use?

You can use, modify, and distribute this project freely, including for commercial purposes, as long as you keep the copyright notice.

How hard is visual-llm to set up?

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

Who is visual-llm for?

Mainly developer.

View the repo → Decode another repo

This repo across BitVibe Labs

Don't trust strangers blindly. Verify against the repo.