WIP almost done with track planning

This commit is contained in:
2026-03-06 15:00:15 -05:00
parent 2c90020682
commit 3b79f2a4e1
77 changed files with 1186 additions and 674 deletions

View File

@@ -1,28 +1,21 @@
# Track Specification: Cost & Token Analytics Panel
# Track Specification: Cost & Token Analytics Panel (cost_token_analytics_20260306)
## Overview
Real-time cost tracking panel for API usage by model and tier.
Real-time cost tracking panel displaying cost per model, session totals, and breakdown by tier. Uses existing cost_tracker.py which is implemented but has no GUI.
## Current State Audit
### Already Implemented
- cost_tracker.py with MODEL_PRICING
- estimate_cost() function
- Token tracking in ai_client.py
### Gaps to Fill
- No GUI panel for cost display
- No session totals
## Goals
- Cost per model display
- Session totals
- Breakdown by tier
## Architectural Constraints
- **Non-Blocking**: Cost calculations MUST NOT block UI thread.
- **Efficient Updates**: Updates SHOULD be throttled to <10ms latency.
## Functional Requirements
- Real-time cost updates
- Per-model breakdown
- Tier breakdown
- **Cost Display**: Show real-time cost for current session.
- **Per-Model Breakdown**: Display cost grouped by model (Gemini, Anthropic, DeepSeek).
- **Tier Breakdown**: Show cost grouped by tier (Tier 1-4).
- **Session Totals**: Accumulate and display total session cost.
## Non-Functional Requirements
- <10ms update latency
- Clear visual formatting
## Acceptance Criteria
- [ ] Cost panel displays in GUI.
- [ ] Per-model cost shown correctly.
- [ ] Tier breakdown accurate.
- [ ] Total accumulates correctly.
- [ ] Uses existing cost_tracker.py functions.