Skip to content

fix: update step performance metrics with explicit effective, input, output, and total token throughput fields#15307

Merged
lgrammel merged 5 commits into
mainfrom
lg/hUS8Y9Vm
May 15, 2026
Merged

fix: update step performance metrics with explicit effective, input, output, and total token throughput fields#15307
lgrammel merged 5 commits into
mainfrom
lg/hUS8Y9Vm

Conversation

@lgrammel
Copy link
Copy Markdown
Collaborator

@lgrammel lgrammel commented May 15, 2026

Background

Step performance metrics previously exposed a single output-token throughput value, which made it hard to distinguish full-request latency from streaming throughput after the first output arrived. This change makes the metrics more explicit so users can separately analyze effective request throughput, streaming output rate, input processing speed before first output, and total token throughput.

Summary

  • Renamed tokensPerSecond to effectiveOutputTokensPerSecond.
  • Renamed timeToFirstTokenMs to timeToFirstOutputTokenMs.
  • Added outputTokensPerSecond, inputTokensPerSecond, and effectiveTotalTokensPerSecond.
  • Updated generateText, streamText, lifecycle events, and telemetry to use the new performance fields.
  • Updated docs and tests to describe and verify the new calculations.

Related Issues

Builds on and revises #15241

@lgrammel lgrammel marked this pull request as ready for review May 15, 2026 11:36
@lgrammel lgrammel merged commit 334ae5d into main May 15, 2026
19 checks passed
@lgrammel lgrammel deleted the lg/hUS8Y9Vm branch May 15, 2026 12:15
@github-actions
Copy link
Copy Markdown
Contributor

🚀 Published in:

Package Version
ai 7.0.0-canary.139
@ai-sdk/alibaba 2.0.0-canary.50
@ai-sdk/amazon-bedrock 5.0.0-canary.62
@ai-sdk/angular 3.0.0-canary.139
@ai-sdk/anthropic 4.0.0-canary.55
@ai-sdk/assemblyai 3.0.0-canary.43
@ai-sdk/azure 4.0.0-canary.58
@ai-sdk/baseten 2.0.0-canary.48
@ai-sdk/black-forest-labs 2.0.0-canary.42
@ai-sdk/bytedance 2.0.0-canary.43
@ai-sdk/cerebras 3.0.0-canary.48
@ai-sdk/cohere 4.0.0-canary.45
@ai-sdk/deepgram 3.0.0-canary.42
@ai-sdk/deepinfra 3.0.0-canary.48
@ai-sdk/deepseek 3.0.0-canary.46
@ai-sdk/elevenlabs 3.0.0-canary.42
@ai-sdk/fal 3.0.0-canary.42
@ai-sdk/fireworks 3.0.0-canary.48
@ai-sdk/gateway 4.0.0-canary.82
@ai-sdk/gladia 3.0.0-canary.42
@ai-sdk/google 4.0.0-canary.63
@ai-sdk/google-vertex 5.0.0-canary.82
@ai-sdk/groq 4.0.0-canary.45
@ai-sdk/huggingface 2.0.0-canary.48
@ai-sdk/hume 3.0.0-canary.42
@ai-sdk/klingai 4.0.0-canary.43
@ai-sdk/langchain 3.0.0-canary.139
@ai-sdk/llamaindex 3.0.0-canary.139
@ai-sdk/lmnt 3.0.0-canary.42
@ai-sdk/luma 3.0.0-canary.42
@ai-sdk/mcp 2.0.0-canary.50
@ai-sdk/mistral 4.0.0-canary.47
@ai-sdk/moonshotai 3.0.0-canary.48
@ai-sdk/open-responses 2.0.0-canary.45
@ai-sdk/openai 4.0.0-canary.58
@ai-sdk/openai-compatible 3.0.0-canary.48
@ai-sdk/otel 1.0.0-canary.85
@ai-sdk/perplexity 4.0.0-canary.45
@ai-sdk/prodia 2.0.0-canary.45
@ai-sdk/provider-utils 5.0.0-canary.41
@ai-sdk/react 4.0.0-canary.140
@ai-sdk/replicate 3.0.0-canary.43
@ai-sdk/revai 3.0.0-canary.43
@ai-sdk/rsc 3.0.0-canary.140
@ai-sdk/svelte 5.0.0-canary.139
@ai-sdk/togetherai 3.0.0-canary.48
@ai-sdk/valibot 3.0.0-canary.41
@ai-sdk/vercel 3.0.0-canary.48
@ai-sdk/voyage 2.0.0-canary.16
@ai-sdk/vue 4.0.0-canary.139
@ai-sdk/workflow 1.0.0-canary.56
@ai-sdk/xai 4.0.0-canary.63

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