Repository navigation
Getting Started Installation
Installation covers setting up both the Python backend and the Node.js frontend. TokenPrint runs entirely locally to guarantee privacy and fast rendering of massive tensor arrays.
TokenPrint relies on real mathematical operations, requiring specific package versions (like PyTorch) to accurately extract intermediate activations and attentions. A mismatched environment might result in silent fallbacks or missing tensor data that compromises the scientific accuracy of the visualization.
The project uses standard, modern package management:
-
Backend: Python virtual environments (
venv) andrequirements.txt. -
Frontend: Node.js with
npm.
- Python 3.10+
- Node.js 18+
- Git
git clone https://github.com/Sudharsanselvaraj/Token-Print.git
cd Token-PrintThe backend utilizes PyTorch and FastAPI.
cd backend
# Create a virtual environment
python3 -m venv .venv --system-site-packages
# Activate it
source .venv/bin/activate # On Windows use: .venv\Scripts\activate
# Install dependencies
pip install -r requirements.txtNote By default, the
requirements.txtfetches PyTorch. If you have a specific GPU (CUDA/MPS), ensure your PyTorch build matches your hardware to enable hardware acceleration. The backend works on CPU, but loading models will be slower.
The frontend uses Next.js, Three.js, and React Three Fiber.
cd ../frontend
# Install dependencies
npm installflowchart TD
Git[Git Clone Repo] --> Python[Backend: Python venv]
Git --> Node[Frontend: npm install]
Python --> PyTorch[Install PyTorch & FastAPI]
Node --> Next[Install Next.js & Three.js]
PyTorch --> Ready([Ready to Run])
Next --> Ready
| Previous | Home | Next |
|---|---|---|
| Getting Started | Home | Quick Start |
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