Skip to main content

TensorBoard plugin with conversational AI capabilities

Project description

TensorBoard AI

A TensorBoard plugin that adds conversational AI analysis to your training dashboards. Analyze metrics, compare runs, and generate custom visualizations — all through natural language.

Quick Start

git clone https://github.com/jackyoung96/tensorboard-ai.git
cd tensorboard-ai
pip install .

Set your API key:

export ANTHROPIC_API_KEY="your-key"     # Anthropic (default)
# or
export OPENAI_API_KEY="your-key"        # OpenAI
# or use AWS IAM credentials             # Bedrock

Launch TensorBoard:

tensorboard --logdir /path/to/logs

Open the AI tab in TensorBoard. Click Analyze All or use the AI button on any chart.

Features

AI-Powered Training Analysis

  • One-click Analyze All for comprehensive analysis of all visible metrics
  • Per-metric AI button on each chart card for focused analysis
  • Automatic training type detection (SFT, RL/PPO, DPO, Pre-training) with domain-specific insights
  • Cross-metric correlation analysis (e.g., grad_norm spike when reward drops)
  • Hyperparameter-aware analysis — automatically reads hparams and highlights differences across runs

Multi-Provider LLM Support

  • Anthropic Claude (default) — including extended thinking mode
  • OpenAI (GPT-4o, GPT-5 series)
  • AWS Bedrock — automatic region prefix for cross-region model IDs
  • Runtime provider/model switching via sidebar UI (no restart needed)

Interactive Chat Panel

  • Always-visible sidebar with SSE streaming responses
  • Markdown rendering with GFM support (tables, code blocks, lists)
  • Clickable metric names in responses — scrolls to and highlights the corresponding chart
  • Follow-up conversations with full context retention
  • Analysis history: switch between previous analyses

Chart Visualization

  • Plotly-based interactive charts with TensorBoard-like styling
  • EMA smoothing with adjustable weight slider
  • Horizontal axis modes: Step / Relative time / Wall time
  • AI-generated custom Plotly visualizations via conversation

Token Optimization

  • Smart data sampling: uniform grid + anomaly detection + curvature-based points (max 50 per series)
  • Constant value detection — outputs constant=X instead of full data
  • Run name alias compression (common prefix/suffix removal, UUID/hash stripping)
  • Duplicate metric deduplication: identical data across tags grouped together

Dashboard Layout

Three-panel layout with resizable panels:

Settings Sidebar Chart Grid AI Analysis Panel
Chart settings, analysis settings, run selection, tag filter Interactive Plotly charts with per-metric AI buttons Streaming chat with markdown, metric links, history

Settings

  • Chart: Smoothing slider, horizontal axis mode (Step / Relative / Wall)
  • Analysis: Language (Auto/EN/KO/JA/ZH/ES/FR/DE), provider, model, extended thinking, debug mode
  • Runs: Checkbox list with color swatches, regex filter, Select All/None
  • Tag Filter: Filter visible charts by tag name

Configuration

Environment Variables

Variable Description Default
TENSORBOARD_AI_PROVIDER LLM provider (anthropic, openai, bedrock) anthropic
TENSORBOARD_AI_MODEL Model name override Provider default
ANTHROPIC_API_KEY Anthropic API key
OPENAI_API_KEY OpenAI API key
AWS_ACCESS_KEY_ID AWS access key (Bedrock) IAM role
AWS_SECRET_ACCESS_KEY AWS secret key (Bedrock) IAM role
AWS_SESSION_TOKEN AWS session token (Bedrock)
AWS_REGION AWS region (Bedrock) us-east-1

CLI Options

# Standard usage
tensorboard --logdir /path/to/logs

# Enable debug mode (shows raw prompt data in AI panel)
tensorboard --logdir /path/to/logs --tensorboard_ai_debug

Development

# Install in development mode
pip install -e ".[dev]"

# Run tests
pytest

# Lint & format
ruff check .
ruff format .

# Type checking
mypy tensorboard_ai/

# Build package
python -m build

Architecture

tensorboard_ai/
├── plugin.py              # TBPlugin + TBLoader — routes, CLI flags
├── backend/
│   ├── server.py          # SSE streaming chat endpoint
│   ├── data_access.py     # Reads scalars, hyperparameters via DataProvider
│   └── chart_gen.py       # Validates LLM-generated Plotly specs
├── providers/
│   ├── base.py            # Abstract provider protocol + registry
│   ├── anthropic.py       # Claude integration
│   ├── openai.py          # OpenAI integration
│   └── bedrock.py         # AWS Bedrock integration
├── prompts/
│   └── system.py          # System prompts with training type detection
└── static/
    ├── index.js           # Dashboard layout, settings, chart grid
    ├── chat.js            # Chat UI, SSE client, markdown rendering
    └── chart_renderer.js  # Plotly charts, data sampling, run aliases

License

Apache-2.0

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

tensorboard_ai-0.1.2.tar.gz (386.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

tensorboard_ai-0.1.2-py3-none-any.whl (384.6 kB view details)

Uploaded Python 3

File details

Details for the file tensorboard_ai-0.1.2.tar.gz.

File metadata

  • Download URL: tensorboard_ai-0.1.2.tar.gz
  • Upload date:
  • Size: 386.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.15

File hashes

Hashes for tensorboard_ai-0.1.2.tar.gz
Algorithm Hash digest
SHA256 574fb8d65842eeeb38f4d2c4957a6fdb12d1a6403423d9d3bd4c004dc3a337c9
MD5 9174aca67c9bd162da510161ede96ce6
BLAKE2b-256 534e076207506856d59487dbeb1e225e16a0d192b667664a399330799d7dfbaa

See more details on using hashes here.

File details

Details for the file tensorboard_ai-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: tensorboard_ai-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 384.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.15

File hashes

Hashes for tensorboard_ai-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 b17a80bea9005d7c9065905e8d65f14658850b9072a783ab20c4721f087a8e17
MD5 13fa6ac786d500401f3e303f64853a5e
BLAKE2b-256 babb55bae0bb57b6cf446ed921993f984dd350257810f31d0611aca7a2e6de8d

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page