-
Notifications
You must be signed in to change notification settings - Fork 0
Implement user-configurable cost tiers and subscription/quota-aware tracking #67
Copy link
Copy link
Closed
Labels
prio:highImportant, should be prioritizedImportant, should be prioritizedscope:medium1-3 days of work1-3 days of workspec:budgetDESIGN_SPEC Section 10 - Cost & Budget ManagementDESIGN_SPEC Section 10 - Cost & Budget Managementspec:providersDESIGN_SPEC Section 9 - Model Provider LayerDESIGN_SPEC Section 9 - Model Provider Layertype:featureNew feature implementationNew feature implementation
Description
Context
Cost tiers should not be hardcoded constants — they need to be user-configurable entities that users can define, extend, and manage through the interface. This also needs to integrate with subscription-aware quota tracking (e.g. Claude Pro subscriptions have rate limits/quotas rather than pure per-token pricing).
In M1 (#55/#56), CostTier was changed from hardcoded dollar signs ($, $$) to string ID references (low, medium, high, premium) with SeniorityInfo.cost_tier accepting any str, not just the enum. This unblocks extensibility.
Acceptance Criteria
User-Configurable Cost Tiers
-
CostTierDefinitionmodel: id, display_name, description, price_range_min, price_range_max, color/icon (for UI) - Built-in tiers (
low,medium,high,premium) shipped as defaults, user can add/modify/remove - Tiers referenced by string ID throughout the system (already done in M1)
- YAML config support for custom tier definitions
Subscription & Quota Awareness
- Support subscription-based providers (e.g. Claude Pro plan with rate limits, not just per-token cost)
- Quota tracking: requests/minute, tokens/day, monthly caps per provider/subscription
- Regular quota polling — query provider APIs for remaining budget/quota where available
- Graceful degradation when quota exhausted (fallback to cheaper provider, queue tasks, alert user)
Integration Points
- Connects to per-call cost tracking (Implement per-call cost tracking and usage logging #7)
- Feeds into budget enforcement engine (Implement budget enforcement engine with task-boundary auto-downgrade (DESIGN_SPEC §10.4) #44)
- CFO agent uses tier definitions for cost optimization recommendations (Implement CFO agent logic (spending monitoring, model downgrade suggestions) #46)
Design Notes
- Cost tiers are a bridge between the abstract seniority system and real-world provider economics
- Subscription tracking is fundamentally different from per-token tracking — needs its own model
- Consider caching provider quota responses to avoid excessive API calls
- Some providers (Ollama, local models) have zero cost but hardware resource limits — model this too
References
- DESIGN_SPEC.md 10.1-10.4 (budget hierarchy and cost controls)
- DESIGN_SPEC.md 9.2 (provider configuration with pricing)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
prio:highImportant, should be prioritizedImportant, should be prioritizedscope:medium1-3 days of work1-3 days of workspec:budgetDESIGN_SPEC Section 10 - Cost & Budget ManagementDESIGN_SPEC Section 10 - Cost & Budget Managementspec:providersDESIGN_SPEC Section 9 - Model Provider LayerDESIGN_SPEC Section 9 - Model Provider Layertype:featureNew feature implementationNew feature implementation