Vercel AI SDK
Last updated
Last updated
Copyright © 2023 Arize AI, Inc
This package provides a set of utilities to ingest Vercel AI SDK(>= 3.3) spans into platforms like Arize and Phoenix.
Note: This package requires you to be using the Vercel AI SDK version 3.3 or higher.
You will also need to install OpenTelemetry and Vercel packages to your project.
@arizeai/openinference-vercel
provides a set of utilities to help you ingest Vercel AI SDK spans into platforms and works in conjunction with Vercel's OpenTelemetry support. To get started, you will need to add OpenTelemetry support to your Vercel project according to their guide.
To process your Vercel AI SDK Spans add a OpenInferenceSimpleSpanProcessor
or OpenInferenceBatchSpanProcessor
to your OpenTelemetry configuration.
Note: The
OpenInferenceSpanProcessor
does not handle the exporting of spans so you will need to pass it an exporter as a parameter.
Since Arize exposes a gRPC endpoint we must use the OpenTelemetry gRPC exporter. The OpenTelemetry gRPC exporter is designed to run in Node.js environments. So, we must make some additional changes to our Next.js configuration in our next.config.js/ts
file. Note your file may look slightly different if you are using a JS config file but the underlying changes should be the same.