Repository navigation
Developer Guide Debugging
Because TokenPrint is itself a visual debugger for AI models, debugging TokenPrint usually involves using its own tools to verify that data is flowing correctly.
If the 3D scene breaks, it could be a WebGL issue, a React state issue, a JSON serialization bug, or a PyTorch runtime error. Knowing how to isolate the problem saves hours of frustration.
- Use the Swagger UI automatically generated by FastAPI at
http://localhost:8000/docs. You can triggerPOST /analyzemanually and inspect the raw JSON response to verify attention tensors are being extracted correctly. - Run the verification scripts in
backend/scripts/(e.g.,verify_real_data.py) to confirm the PyTorch engine is healthy without the API layer.
- Press
F10in the TokenPrint UI to toggle Developer Mode. This exposes raw numerical readouts and LOD (Level of Detail) toggles in the HUD. - Open the Chrome DevTools Console. The Zustand store logs major state transitions.
- Use the Debugger Pane (available in the Sidebar when Dev Mode is active). It includes a Flame Graph of the
op_catalogand anomaly sentinels to track memory spikes.
If a generation run looks visually corrupted, enable record_trace: true in the API request. Download the .tokenprint.json trace file and run scripts/trace_diff.py against a known-good trace to pinpoint exactly which tensor deviated.
flowchart LR
Bug[Visual Glitch] --> Isolate{Where is the bug?}
Isolate -- Backend --> Swagger[Check /docs Swagger UI]
Isolate -- Data Pipeline --> Trace[Record Trace & Diff]
Isolate -- WebGL / React --> F10[Press F10 for Dev HUD]
| Previous | Home | Next |
|---|---|---|
| Creating UI Components | Home | Performance Tips |
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