How pliablerigidity/llmvis works
LLMVis visualizes local LLM inference in observer mode (Ollama) or deep-instrumentation mode (PyTorch/MLX), with a terminal UI for live telemetry and model execution details. The main flow is backend events through normalized events and shared state into the appropriate TUI; deep mode also accepts prompts over TCP, while recording and replay provide a separate session workflow. README documents the six deep-mode views and platform-specific telemetry. Some subsystem links rely on README or SOURCE INDEX references because their implementation was not excerpted.
Main entry points: main.py CLI commands · app.py Observer application · app_deep.py Deep application · events.py Normalized events
Components 22
Commands and sessions
- CLI commands
src/llmvis/cli/main.py - Session recording
src/llmvis/adapters/replay_adapter.py
Inference backends
- Replay adapter
src/llmvis/adapters/replay_adapter.py - PyTorch instrumentation
src/llmvis/adapters/instrumented_transformers.py - MLX instrumentation
src/llmvis/adapters/mlx_adapter.py - Ollama observer
src/llmvis/adapters/ollama.py - Telemetry TCP server
src/llmvis/ipc/server.py - TCP client adapter
src/llmvis/adapters/client_adapter.py
Events and state
- Normalized events
src/llmvis/core/events.py - Event bus
src/llmvis/core/bus.py - Shared app state
src/llmvis/core/state.py
Terminal visualization
- Observer application
src/llmvis/tui/app.py - Deep application
src/llmvis/tui/app_deep.py - Screens and widgets
src/llmvis/tui/screens - Concept explanations
src/llmvis/educational/concepts.py
Platform telemetry
- Platform detection
src/llmvis/platform/detect.py - System telemetry
src/llmvis/telemetry/system.py - NVIDIA telemetry
src/llmvis/telemetry/gpu.py - Telemetry providers
src/llmvis/telemetry/providers - Hardware snapshot
src/llmvis/telemetry/snapshot.py
Other components
- Operator
- Ollama service
Connections 35
- Operator → CLI commands: runs commands
- CLI commands → PyTorch instrumentation: starts instrumentation
src/llmvis/cli/main.py - CLI commands → MLX instrumentation: selects backend
src/llmvis/cli/main.py - CLI commands → Telemetry TCP server: starts server
src/llmvis/cli/main.py - CLI commands → Replay adapter: starts replay
src/llmvis/cli/main.py - CLI commands → Deep application: opens deep TUI
src/llmvis/cli/main.py - CLI commands → Observer application: opens observer TUI
src/llmvis/cli/main.py - CLI commands → Ollama observer: selects observer
- Ollama service → Ollama observer: serves HTTP data
- PyTorch instrumentation → Normalized events: emits events
src/llmvis/adapters/instrumented_transformers.py - MLX instrumentation → Normalized events: emits events
src/llmvis/adapters/mlx_adapter.py - Ollama observer → Normalized events: emits events
src/llmvis/adapters/ollama.py - Replay adapter → Normalized events: reconstructs events
src/llmvis/adapters/replay_adapter.py - PyTorch instrumentation → Telemetry TCP server: publishes telemetry
- Telemetry TCP server → TCP client adapter: streams JSONL
- TCP client adapter → Normalized events: yields events
src/llmvis/adapters/client_adapter.py - TCP client adapter → Telemetry TCP server: sends prompts
src/llmvis/adapters/client_adapter.py - Telemetry TCP server → PyTorch instrumentation: dispatches prompts
src/llmvis/ipc/server.py - Normalized events → Event bus: queued for dispatch
src/llmvis/core/bus.py - Deep application → Event bus: publishes events
src/llmvis/tui/app_deep.py - Observer application → Event bus: dispatches events
src/llmvis/tui/app.py - Deep application → Shared app state: updates state
src/llmvis/tui/app_deep.py - Observer application → Shared app state: updates state
src/llmvis/tui/app.py - Deep application → Screens and widgets: renders views
src/llmvis/tui/app_deep.py - Observer application → Screens and widgets: renders screen
src/llmvis/tui/app.py - Screens and widgets → Shared app state: reads state
src/llmvis/tui/screens/main_screen.py - Screens and widgets → Concept explanations: shows concepts
src/llmvis/tui/screens/concept_screen.py - CLI commands → Platform detection: detects platform
src/llmvis/cli/main.py - Observer application → System telemetry: collects system stats
src/llmvis/tui/app.py - Observer application → NVIDIA telemetry: collects GPU stats
src/llmvis/tui/app.py - Deep application → System telemetry: collects system stats
src/llmvis/tui/app_deep.py - Deep application → NVIDIA telemetry: collects GPU stats
src/llmvis/tui/app_deep.py - Telemetry providers → Hardware snapshot: returns snapshot
src/llmvis/telemetry/providers/apple.py - Telemetry providers → Hardware snapshot: returns snapshot
src/llmvis/telemetry/providers/nvidia.py - Telemetry providers → Hardware snapshot: returns snapshot
src/llmvis/telemetry/providers/system.py