Repository navigation
API Reference
Sudharsan Selvaraj edited this page Jul 20, 2026
·
1 revision
TokenPrint uses a clean, documented JSON API for all communication between the frontend and the PyTorch backend. The backend is completely headless and can be used independently of the UI.
If you want to build your own visualizer, write a script to automate tensor analysis, or integrate TokenPrint's data pipeline into a Jupyter Notebook, you can query these APIs directly.
The API is served via FastAPI on http://localhost:8000.
- REST API: Synchronous endpoints for fetching static data like model architecture, health status, and full forward-pass traces.
- WebSocket Events: The asynchronous streaming protocol used for Live Inference.
- Data Models: The strict JSON schemas (defined by Pydantic) ensuring consistent types.
- Tensor Format: How multidimensional PyTorch tensors are serialized into flat JSON arrays for web consumption.
flowchart LR
Client([HTTP Client / Script]) --> API[FastAPI: localhost:8000]
API -- GET /architecture --> REST[JSON: Tensor List]
API -- WS /ws/generate --> WS[Stream: Token Frames]
API -- POST /analyze --> POST[JSON: Logit Lens & PCA]
| Previous | Home | Next |
|---|---|---|
| Performance Tips | Home | REST API |
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