DOCUMENTATION

TokenPrint

Interactive LLM & Transformer Visual Debugger. Every value displayed is computed from real parsed model weights or a real forward pass — zero illustrative or faked numbers.

TokenEmbeddingTransformer24 Layers • GQALogits / Softmax

TokenPrint architectural pipeline for Qwen2.5-0.5B — 24 Layers, 14 Q Heads, 2 KV Heads (GQA).


What is TokenPrint?

TokenPrint is designed for machine learning engineers and researchers who need to inspect what is actually happening inside a transformer during inference. Instead of illustrative block diagrams, TokenPrint maps real tensor dimensions, activation norms, attention matrices, and KV cache states directly from backend execution.


How it works

The backend engine loads standard PyTorch or GGUF model files and executes forward passes while recording step-by-step telemetry. Telemetry is streamed over WebSocket directly to the 3D viewport, rendering individual layers, heads, and residual vectors in real time.


Core concepts

TokenPrint breaks transformer inference into distinct inspectable operations:

  • Tokens & Embeddings: Input text tokenization mapped to continuous vector representations.
  • RMSNorm & Residual Streams: Root Mean Square Normalization applied across hidden states before attention and MLP blocks.
  • Grouped Query Attention (GQA): Efficient multi-head attention where multiple Query heads share key-value heads.
  • Rotary Position Embeddings (RoPE): Complex rotation matrices applied to Queries and Keys to encode position.
  • SwiGLU & Logits: Swish-Gated Linear Units in FFN blocks and final linear output projection.

Quick start

To run TokenPrint locally or inspect a model:

bash
# Start backend server with reference model (Qwen2.5-0.5B)
cd backend && python3 -m uvicorn app.main:app --port 8000

# Start frontend application
cd frontend && npm run dev