[Migration #121.2] Implement LLM usage tracking and analytics #309

Closed
opened 2026-02-04 02:35:55 +00:00 by jason.woltje · 0 comments
Owner

Parent EPIC: #121 - Backend Migration from Jarvis r1
Phase: 1 - LLM Abstraction Layer
Estimate: 1-2 days

Description

Migrate LLM usage tracking system for monitoring token usage, costs, and performance.

Source Files

  • jarvis/storage/models/llm_usage.py
  • jarvis/storage/repositories/llm_usage.py

Target Implementation

  • Create Prisma schema for LLM usage tracking
  • Implement usage repository
  • Add usage analytics endpoints
  • Create usage aggregation queries

Acceptance Criteria

  • Prisma schema for LLM usage
  • Usage tracking on all LLM calls
  • Analytics queries (by workspace, provider, model)
  • Cost calculation per provider
  • Unit tests (85% coverage)
**Parent EPIC:** #121 - Backend Migration from Jarvis r1 **Phase:** 1 - LLM Abstraction Layer **Estimate:** 1-2 days ## Description Migrate LLM usage tracking system for monitoring token usage, costs, and performance. ## Source Files - `jarvis/storage/models/llm_usage.py` - `jarvis/storage/repositories/llm_usage.py` ## Target Implementation - Create Prisma schema for LLM usage tracking - Implement usage repository - Add usage analytics endpoints - Create usage aggregation queries ## Acceptance Criteria - [ ] Prisma schema for LLM usage - [ ] Usage tracking on all LLM calls - [ ] Analytics queries (by workspace, provider, model) - [ ] Cost calculation per provider - [ ] Unit tests (85% coverage)
jason.woltje added this to the M4-LLM (0.0.4) milestone 2026-02-04 02:35:55 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: mosaic/stack#309