Repository navigation
Supported Models
TokenPrint is architecture-aware. It does not just blindly render boxes; it adapts its formulas, 3D geometry, and metadata displays based on the exact architecture of the loaded model.
Transformers are not a monolith. GPT-2 uses LayerNorm and GELU; Llama uses RMSNorm, SwiGLU, and Rotary Positional Embeddings (RoPE). If a visualization tool renders standard LayerNorm for a Llama model, it is scientifically dishonest.
TokenPrint detects the model family directly from the PyTorch config.architectures array or the GGUF header's general.architecture key.
Once the architecture is identified, TokenPrint:
- Selects the correct LaTeX formula set from
lib/formulas.ts. - Adapts the
TransformerStackgeometry (e.g., merging the gate and up projections for SwiGLU, or clustering attention blades based on the realnum_kv_headsto show GQA).
The following architectures have explicit geometry and formula mappings in TokenPrint:
- Llama (and Llama 2 / Llama 3)
- Qwen (specifically Qwen 2 / 2.5)
- Gemma
- Phi (Phi-2 / Phi-3)
- DeepSeek
- Legacy/Fallback: GPT-2 / GPT-NeoX
TokenPrint supports two primary ways of loading models:
- HuggingFace (Backend): Used for Live Inference and trace generation via the PyTorch backend.
- GGUF (Frontend): Used for static Architecture Exploration and tensor inspection entirely in the browser.
flowchart TD
Config[Model Config / Header] --> Detector[Architecture Detector]
Detector -- "llama" --> LlamaRules[RMSNorm, RoPE, SwiGLU]
Detector -- "qwen2" --> QwenRules[RMSNorm, RoPE, SwiGLU]
Detector -- "gpt2" --> GPTRules[LayerNorm, GELU, Learned Pos]
LlamaRules --> Geo[Geometry Engine]
LlamaRules --> KaTeX[Formula Renderer]
| Previous | Home | Next |
|---|---|---|
| Scene Navigation | Home | GGUF |
TokenPrint Wiki | Home | Getting Started | User Guide | Concepts | Architecture | API | GitHub
TokenPrint is an interactive 3D visualization platform for exploring transformer architectures, tensors, and real-time LLM inference.
- User Guide
- Architecture Explorer
- Live Inference
- Tensor Inspector
- Camera Controls
- HUD
- Timeline
- Scene Navigation
- Transformer Concepts
- Tokenization
- Embeddings
- Positional Encoding
- RoPE
- Multi-Head Attention
- KV Cache
- LayerNorm
- Feed Forward Network
- Residual Connections
- Logits
- Softmax
- Sampling
- Autoregressive Generation
- Visualization System
- Scene Graph
- Geometry
- Materials
- Animation System
- Color Mapping
- Camera System
- Interaction Model
- Architecture
- Overall Architecture
- Frontend
- Backend
- WebSocket Protocol
- Data Pipeline
- Renderer
- Event System