Skip to content

Define EIT (Effective Input Tokens) and cross-subtree cost summary #15

@EightRice

Description

@EightRice

Goal

A cross-provider cost scalar so an agent subtree's economic footprint is comparable regardless of which provider each agent uses, plus a summary tool that reports it.

Why

Today, Usage carries input_tokens, output_tokens, cache_read_tokens, cache_creation_tokens per provider. The numbers are not directly comparable: an Opus 4.7 input token is not the same cost as a DeepSeek-Flash input token. A subtree of mixed-provider agents has no single cost figure.

Proposed design

  • Define EIT (Effective Input Tokens) as the unit. Conversion factor per (provider, model, token-type) — fresh-input, output, cache-read, cache-creation each get their own factor based on published pricing.
  • Store factors in atn/model_specs.py (or a sibling file). Same longest-prefix lookup pattern.
  • Add AgentDefinition.budget_eit (optional). When set, runtime totals subtree EIT and refuses turns that would exceed it.
  • New tool get_cost_summary accessible from any agent: returns subtree EIT total, per-provider breakdown, cache-hit rate.

Acceptance

  • A two-agent test (one on Claude Max, one on DeepSeek) reports a single subtree EIT figure that matches manual calculation.
  • An agent with budget_eit set refuses to start a turn that would push it over budget, and the snapshot shows the budget state clearly.

Metadata

Metadata

Assignees

No one assigned

    Labels

    track:opsCaching, telemetry, cost tracking, observabilitytype:featureNew capability

    Type

    No type

    Projects

    Status

    Backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions