MCPcopy
hub / github.com/bbycroft/llm-viz

github.com/bbycroft/llm-viz @main sqlite

repository ↗ · DeepWiki ↗
1,418 symbols 3,894 edges 157 files 0 documented · 0%
README

Brendan Bycroft's Home Page & Projects

This repository contains my (Brendan's) homepage, as well as a number of non-trivial projects.

They are kept in a single repository for ease of deployment, as well as sharing a bunch of js utils which are otherwise a pain to share around.

Projects

The main projects are: * LLM Visualization: 3D interactive model of a GPT-style LLM network running inference. * [WIP] CPU Simulation: A 2D digital schematic editor with full a execution model, showcasing a simple RISC-V based CPU

LLM Visualization

This project displays a 3D model of a working implementation of a GPT-style network. That is, the network topology that's used in OpenAI's GPT-2, GPT-3, (and maybe GPT-4).

The first network displayed with working weights is a tiny such network, which sorts a small list of the letters A, B, and C. This is the demo example model from Andrej Karpathy's minGPT implementation.

The renderer also supports visualizing arbitrary sized networks, and works with the smaller gpt2 size, although the weights aren't downloaded (it's 100's of MBs).

CPU Simulation (WIP; not exposed yet!)

This project runs 2D schematic digital circuits, with a fully fledged editor. The intent is to add a number of walkthroughs, showing things such as: * how a simple RISC-V CPU is constructed * the constituent parts down to gate level: instruction decode, ALU, add, etc * higher level CPU ideas, like various levels of pipelining, caching, etc

Running Locally

  1. Install dependencies: yarn
  2. Start the dev server: yarn dev

Extension points exported contracts — how you extend this code

ITooltipInfo (Interface)
(no doc)
src/utils/Tooltip.tsx
IProgramState (Interface)
(no doc)
src/llm/Program.ts
IEdgePort (Interface)
(no doc)
src/cpu/CompLayoutEditor.tsx
IManifest (Interface)
(no doc)
src/app/cpu/api/save-schematic-to-file/route.ts
IFluidSimState (Interface)
(no doc)
src/fluidsim/FluidSimMain.tsx
ILayout (Interface)
(no doc)
src/utils/layout.ts
IModelExample (Interface)
(no doc)
src/llm/Program.ts
IImportResult (Interface)
(no doc)
src/cpu/ImportExport.tsx

Core symbols most depended-on inside this repo

assignImm
called by 117
src/utils/data.ts
add
called by 104
src/utils/vector.ts
mul
called by 91
src/utils/vector.ts
afterTime
called by 90
src/llm/walkthrough/WalkthroughTools.ts
getPort
called by 70
src/cpu/comps/CompBuilder.tsx
toString
called by 66
src/utils/vector.ts
breakAfter
called by 63
src/llm/walkthrough/WalkthroughTools.ts
lerp
called by 52
src/utils/math.ts

Shape

Function 890
Interface 233
Method 198
Class 50
Enum 47

Languages

TypeScript100%
Python1%

Modules by API surface

src/utils/vector.ts82 symbols
src/utils/matrix.ts56 symbols
src/llm/GptModel.ts39 symbols
src/llm/components/DataFlow.ts34 symbols
src/cpu/CpuModel.tsx34 symbols
src/llm/walkthrough/WalkthroughTools.ts32 symbols
src/llm/components/TocDiagram.tsx31 symbols
src/utils/pointer.ts30 symbols
src/cpu/comps/CompBuilder.tsx28 symbols
src/cpu/Wire.tsx27 symbols
src/utils/shader.ts25 symbols
src/cpu/schematics/SchematicLibrary.tsx25 symbols

Dependencies from manifests, versioned

@fortawesome/fontawesome-svg-core6.4.0 · 1×
@fortawesome/free-brands-svg-icons6.4.0 · 1×
@fortawesome/free-regular-svg-icons6.4.0 · 1×
@fortawesome/free-solid-svg-icons6.4.0 · 1×
@fortawesome/react-fontawesome0.2.0 · 1×
@next/bundle-analyzer14.0.2 · 1×
@types/d3-color3.1.0 · 1×
@types/node20.1.0 · 1×
@types/react18.2.22 · 1×
@types/react-dom18.2.7 · 1×
@vercel/analytics1.0.2 · 1×
@webgpu/types0.1.32 · 1×

For agents

$ claude mcp add llm-viz \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact