WIP almost done with track planning
This commit is contained in:
9
conductor/tracks/cost_token_analytics_20260306/index.md
Normal file
9
conductor/tracks/cost_token_analytics_20260306/index.md
Normal file
@@ -0,0 +1,9 @@
|
||||
# Cost & Token Analytics Panel
|
||||
|
||||
**Track ID:** cost_token_analytics_20260306
|
||||
|
||||
**Status:** Planned
|
||||
|
||||
**See Also:**
|
||||
- [Spec](./spec.md)
|
||||
- [Plan](./plan.md)
|
||||
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"id": "cost_token_analytics_20260306",
|
||||
"name": "Cost & Token Analytics Panel",
|
||||
"status": "planned",
|
||||
"created_at": "2026-03-06T00:00:00Z",
|
||||
"updated_at": "2026-03-06T00:00:00Z",
|
||||
"type": "feature",
|
||||
"priority": "medium"
|
||||
}
|
||||
@@ -1,16 +1,32 @@
|
||||
# Implementation Plan: Cost & Token Analytics Panel (cost_token_analytics)
|
||||
# Implementation Plan: Cost & Token Analytics Panel (cost_token_analytics_20260306)
|
||||
|
||||
## Phase 1: Research & Design
|
||||
- [ ] Task: Analyze existing backend implementation
|
||||
- [ ] Task: Design GUI/UX approach
|
||||
- [ ] Task: Conductor - User Manual Verification
|
||||
## Phase 1: Panel Setup
|
||||
- [ ] Task: Initialize MMA Environment
|
||||
- [ ] Task: Create cost panel structure
|
||||
- WHERE: src/gui_2.py
|
||||
- WHAT: New panel for cost display
|
||||
- HOW: Add _render_cost_panel method
|
||||
- SAFETY: Non-blocking updates
|
||||
|
||||
## Phase 2: Implementation
|
||||
- [ ] Task: Implement feature
|
||||
- [ ] Task: Write tests
|
||||
- [ ] Task: Conductor - User Manual Verification
|
||||
## Phase 2: Cost Calculations
|
||||
- [ ] Task: Integrate cost_tracker
|
||||
- WHERE: src/gui_2.py
|
||||
- WHAT: Use cost_tracker.estimate_cost
|
||||
- HOW: Call with model and token counts
|
||||
- SAFETY: Cache expensive calculations
|
||||
- [ ] Task: Track session totals
|
||||
- WHERE: src/gui_2.py or app_controller
|
||||
- WHAT: Accumulate cost over session
|
||||
- HOW: Maintain running total
|
||||
- SAFETY: Thread-safe updates
|
||||
|
||||
## Phase 3: Verification
|
||||
- [ ] Task: Run test suite
|
||||
- [ ] Task: Verify coverage
|
||||
- [ ] Task: Conductor - Phase Completion Verification
|
||||
## Phase 3: UI Implementation
|
||||
- [ ] Task: Render cost breakdown
|
||||
- WHERE: src/gui_2.py
|
||||
- WHAT: Show per-model and per-tier costs
|
||||
- HOW: imgui tables
|
||||
- SAFETY: Handle zero/empty states
|
||||
|
||||
## Phase 4: Verification
|
||||
- [ ] Task: Test cost calculations
|
||||
- [ ] Task: Conductor - Phase Verification
|
||||
|
||||
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user