Skip to content

v0.3-T3 — ahc cost-estimate (plan-level cost estimation CLI) #123

Description

@sv-pro

Summary

Implement ahc cost-estimate <plan-file> — estimate total cost for a declared plan using CostProfileStore percentiles when available, falling back to static pricing.

Depends on: #122 (cost-profile CLI + runtime wiring)

Scope

  • Parse a plan file (YAML or JSON) specifying steps with model, action, and token bounds
  • Use CostProfileStore percentiles (p50/p90/p99) when trace profiles exist for the (action_name, model_name) pair
  • Fall back to static pricing from PricingRegistry when no profiles exist
  • Output: three-point estimate (optimistic / expected / worst-case) per step and total
  • Machine-readable output option (--json)

Key Files

  • src/agent_hypervisor/compiler/cli.py — add cost-estimate command
  • src/agent_hypervisor/economic/cost_estimator.pyestimate_plan_cost()
  • src/agent_hypervisor/economic/cost_profile_store.pyCostProfileStore.percentile()
  • tests/compiler/test_cost_estimate.py — new test file

Acceptance Criteria

  • ahc cost-estimate <plan> prints per-step and total estimates
  • Uses trace profiles when available, static pricing when not
  • --json flag outputs machine-readable estimates
  • pytest tests/compiler/test_cost_estimate.py -v passes

Milestone

v0.3

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions