Skip to content

Arize-ai/phoenix-vercel-telemetry-template

Repository files navigation

Phoenix, Vercel AI SDK, Next.js, and OpenAI Generative Example with Telemetry

This example shows how to use the Vercel AI SDK with Next.js and OpenAI to create a sample generative application with OpenTelemetry support.

OTEL spans are processed by the @arizeai/openinference-vercel package and collected and viewable in Arize-Phoenix.

Deploy your own

Deploy the example using Vercel:

Deploy with Vercel

How to use

If you don't already have an OpenAI API key do the following to create one:

  1. Sign up at OpenAI's Developer Platform.
  2. Go to OpenAI's dashboard and create an API KEY.

Local

To run the example locally you need to:

  1. Set the required OpenAI environment variable as the token value as shown the example env file but in a new file called .env.local.
  2. To run Arize-Phoenix locally run docker run -p 6006:6006 -i -t arizephoenix/phoenix
  3. npm ci to install the required dependencies.
  4. npm run dev to launch the development server.

To view Arize-Phoenix and the example app visit:

Learn More

To learn more about Phoenix, OpenAI, Next.js, and the Vercel AI SDK take a look at the following resources: