Repository navigation
Developer Guide Building From Source
To contribute to TokenPrint, you need to run the application in development mode on your local machine.
Development mode enables hot-reloading for the frontend and auto-reloading for the backend, allowing you to see your code changes instantly without restarting the servers manually.
cd backend
python3 -m venv .venv --system-site-packages
source .venv/bin/activate
pip install -r requirements.txtTo run with auto-reload:
python -m uvicorn app.main:app --app-dir . --port 8000 --reloadNote: The --reload flag is great for API development, but because loading the model into VRAM takes 5-10 seconds, it can be annoying if you are only editing non-model code.
cd frontend
npm installTo run with hot-reloading:
npm run devThe frontend will be available at http://localhost:3000. Next.js Fast Refresh will automatically update the browser when you save a file in components/ or lib/.
Warning If you edit Zustand state inside
store.ts, you may occasionally need to manually refresh the browser to prevent state desync between the React DOM and the R3F Canvas.
flowchart LR
Dev[Developer edits code] --> Watcher
subgraph Watchers
Watcher -- Python --> Uvicorn[uvicorn --reload]
Watcher -- TypeScript --> Next[Next.js Fast Refresh]
end
Uvicorn --> API[Restart FastAPI]
Next --> Browser[Hot Swap React Component]
| Previous | Home | Next |
|---|---|---|
| Repository Structure | Home | Code Style |
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