Skip to content

[Phase 5] Token and cost tracking per task #314

@frankbria

Description

@frankbria

Summary

Track LLM token usage and estimated costs per task and batch execution.

Problem

No visibility into LLM costs. Users can't optimize or budget for AI usage.

Proposed Solution

Tracking

  • Input/output tokens per LLM call
  • Aggregate by task, batch, and workspace
  • Cost estimation based on model pricing

Storage

  • Token counts in run records
  • Cost summaries in workspace stats

CLI Commands

cf stats tokens                    # Workspace token summary
cf stats tokens --task <id>        # Per-task breakdown
cf stats costs --period month      # Cost report

Acceptance Criteria

  • Token counts recorded for all LLM calls
  • Per-task and per-batch aggregation
  • Cost estimation with configurable pricing
  • CLI commands to view usage
  • Export to CSV/JSON

Related

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestphase-5Phase 5: Advanced Features & Polish

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions