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.2.0.tar.gz (387.5 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.2.0-py3-none-any.whl (385.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: tensorboard_ai-0.2.0.tar.gz
  • Upload date:
  • Size: 387.5 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.2.0.tar.gz
Algorithm Hash digest
SHA256 48a3b59d9f930c555d591f1bb49ca5e075cf475c78a49a154637584755761132
MD5 139d278bc9acf2eaca3dd62662cb4897
BLAKE2b-256 62be32880bdda9a49f82d4f9ab9efa3ed8de99033532c5cb44b1dd4a9d921978

See more details on using hashes here.

File details

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

File metadata

  • Download URL: tensorboard_ai-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 385.3 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.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f07fa643c3db6c9d59d8a1d6bfcb15f2342e5c748a19b6608e0f592665a3d591
MD5 10ea52bec227915bb2b1db28cdfdf0c2
BLAKE2b-256 dee9ee4df78dd41d31037c8c8e7d81754ec7768e8d7302b041af2fd684f423cd

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