Skip to content

feat: add speed metric#26

Merged
declanjackson merged 8 commits intomainfrom
feat/add_speed_metrics
Feb 13, 2026
Merged

feat: add speed metric#26
declanjackson merged 8 commits intomainfrom
feat/add_speed_metrics

Conversation

@declanjackson
Copy link
Collaborator

@declanjackson declanjackson commented Feb 12, 2026

Add Model Speed Metrics

Summary

  • Add speed and timing metrics to message models for tracking LLM and tool performance
  • AssistantMessage now has request_start_time/request_end_time fields and a derived e2e_otps (end-to-end output tokens per second)
    property
  • ToolMessage now has tool_start_time/tool_end_time fields and a derived tool_duration property
  • All three clients (ChatCompletions, LiteLLM, OpenResponses) record request timing
  • Agent records tool execution timing and aggregates model speed stats per run
  • Logger displays a Model Speed summary panel (model, OTPS, calls, gen time) and average tool duration in the tool summary

Other Changes

  • Rename TokenUsage.output to TokenUsage.answer to clarify token terminology (output = reasoning + answer); output remains as a deprecated
    computed property for backwards compat
  • Add model_slug to the agent run summary
  • Improve summary panel layout to adapt to terminal width instead of forcing a single row
  • aggregate_metadata skips internal _-prefixed keys in run_metadata
  • Add guard for None shared exec_env in sub-agent code path

@declanjackson declanjackson changed the title feat: add throughput metric feat: add speed metric Feb 13, 2026
Copy link
Contributor

@MohamedAkbarally MohamedAkbarally left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@declanjackson declanjackson merged commit 30d0e5b into main Feb 13, 2026
2 checks passed
@declanjackson declanjackson deleted the feat/add_speed_metrics branch February 13, 2026 07:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

Comments