AI usage visibility · Dashboard engineering
Token Board
A dashboard for comparing AI usage and estimated costs by model, tool, device, and time range. A small Node.js service queries collected records in SQLite and presents the results with ECharts.
Implementation scope
Custom work covers the dashboard, reporting service, and deployment. The upstream aiusage tool collects usage records; the reporting service reads a synchronized SQLite snapshot without modifying it.
Node.js · SQLite · ECharts
Implementation evidence
Read-only reporting
The service opens SQLite in read-only mode and aggregates model, tool, and time-series views in SQL. Device filters use bound query parameters.
Basis: Reporting service code
Snapshot replacement
A changed database modification time triggers a new connection to the synchronized file.
Basis: Database connection lifecycle code
Stable analysis context
Selected filters and chart preferences persist locally across minute-based refreshes, without a full page reload.
Basis: Dashboard state and refresh code
System flow
Upstream tool
aiusage
Collects usage and synchronizes the reporting snapshot.
Synchronized records
Data boundary
SQLite snapshot
Collector-owned records, opened read-only by the reporting service.
Query results
Custom implementation
Node.js reporting
Aggregates model, tool, device, and time-range views.
Dashboard data
Custom implementation
ECharts dashboard
Presents estimated usage costs and retains local analysis preferences.
Arrows describe the reporting data path. Refreshing the dashboard does not trigger collection or establish that a newer snapshot exists.
Design decisions
Separate reporting from collection
The dashboard reads collected records without managing collection credentials or ingestion rules. This keeps reporting changes independent of the collector. Refreshing a chart only queries the available snapshot; newer usage appears after synchronization.
Aggregate before presentation
SQL handles grouping and totals so charts share the same calculations. Filters by model, tool, device, and token category help explain changes in spending without duplicating reporting logic in the interface.
Preserve the analysis context
Filters and chart preferences stay in local storage while records refresh periodically. This lets a comparison continue as data changes, without resetting the view or reloading the page.
Access and limitations
The live dashboard is private. Cost figures are estimates based on public pricing; coverage depends on the usage collector.
Updated