Dashboard
0%
1
Curious builder0 XP earned · 300 to level 2
0 daysFinish a lesson to begin
Badge collection0 of 6 unlocked
51 small wins to finish your pathNext question →

Q13EasyConcept

How do you track and attribute LLM costs in an organisation?

30-second answerSay your answer out loud first, then reveal.

Implementation

  1. Gateway or SDK instrumentation: every call logs {model, input_tokens, output_tokens, cached_tokens, feature, team, tenant, env}.
  2. Price table: versioned (prices change), including discounts (batch, cached input, committed use).
  3. Aggregation: daily cost per feature, team and tenant; per-request distributions (to find outliers).
  4. Budgets and alerts: per team and feature; anomaly detection for sudden spikes (bugs, abuse, retry loops).
  5. Unit economics: cost per successful outcome; gross margin per customer tier for SaaS pricing.
  6. Showback / chargeback: monthly reports to team owners.

Self-hosted allocation: GPU cost per hour × hours ÷ tokens served gives cost per 1M tokens per model; idle capacity is shown as overhead, which motivates utilisation improvements.

Slow is fine. Stopping is the only problem.