Skip to main content

AI SDK 7 is now available

By Steven Van ·

AI SDK 7 rebuilds telemetry around a new @ai-sdk/otel package, with opt-out per-call tracing and Node.js tracing-channel support.

AI SDK 7, the latest major version of Vercel's TypeScript toolkit for building agents, ships a rebuilt telemetry system. Reporting on agent behaviour now runs through a separate @ai-sdk/otel package: install it and call registerTelemetry(new OpenTelemetry()) once at startup, and every generateText or streamText call then emits OpenTelemetry spans automatically.

  • Telemetry is opt-out per call: pass telemetry.isEnabled: false to skip it, and turn off recordInputs or recordOutputs separately when a call's data shouldn't be captured.
  • Calls can carry a functionId and a runtimeContext, with includeRuntimeContext and includeToolsContext used to choose which context fields, excluding things like API keys, get sent on to telemetry providers.
  • On Node.js, the same events are published on an ai:telemetry tracing channel, so observability providers can subscribe without registering a separate integration.
  • Custom integrations can be written against a new Telemetry interface, implementing lifecycle hooks such as onStart, onStepEnd, and onToolExecutionEnd.
Vercel
Vercel
The platform for frontend developers — deploy, preview, and scale web apps and AI agents with zero config.
View Vercel →

Read the original announcement →

Read AI SDK 7 is now available on Creators Toolbox