The Vercel AI SDK integration is available in the PandaProbe TypeScript SDK only. Vercel AI does not provide a Python SDK.
Installation
Install PandaProbe, the Vercel AI SDK, and the provider package used by your model. This example uses OpenAI.- npm
- yarn
- pnpm
Setup
Wrap the language model with PandaProbe middleware before passing it togenerateText, streamText, or other Vercel AI SDK functions that use the language model middleware interface.
TypeScript
withTrace(), the model call becomes a nested LLM span.
Generate text
TypeScript
Stream text
TypeScript
Trace an agent
For a nativeToolLoopAgent in AI SDK 6 or 7, use wrapVercelAgent to capture the agent, its model steps, and actual tool executions. Use the wrapped model from Setup above:
TypeScript
CHAIN → AGENT → LLM → TOOL; model middleware enriches the same LLM spans without duplicating them. Without middleware, model timing comes from native step callbacks. Proposed tool calls without execution do not create tool spans.
For streaming, consume the stream through completion or explicitly cancel it. An abandoned consumer is not a completion signal. See Reflect’s Vercel integration to combine the traced constructor with persistent guidance and reflection.
What gets traced
Custom span name
The default span and standalone trace name isvercel-ai-generate. Override it when one application uses multiple wrapped models:
TypeScript
Combine with manual tracing
TypeScript
LLM span.
