cascadeflow.run(). Provides access to run metrics, decision traces, and budget state.
Methods
summary()
Returns aggregate metrics for the run.| Key | Type | Description |
|---|---|---|
cost_total | float | Cumulative cost in USD |
steps | int | Number of LLM calls |
tool_calls | int | Number of tool/function calls |
latency_total_ms | float | Total wall-clock latency in ms |
energy_used | float | Total energy units consumed |
budget_remaining | float | None | USD remaining (None if no budget set) |
trace()
Returns the list of decision records for the run.| Key | Type | Description |
|---|---|---|
action | str | "allow", "switch_model", "deny_tool", or "stop" |
reason | str | Human-readable explanation |
model | str | Model name |
step | int | Step number (1-indexed) |
cost_total | float | Cumulative cost at this step |
budget_state | str | "ok", "warning", or "exceeded" |
applied | bool | Whether the action was enforced |