Vercel AI SDK Integration
Opik provides seamless integration with the Vercel AI SDK through OpenTelemetry instrumentation. This integration helps you monitor and debug AI-powered applications built with Vercel’s AI tooling.
Installation
Install the required dependencies:
Basic Usage
Here’s a simple example of integrating Opik with the Vercel AI SDK:
Features
The Vercel AI SDK integration automatically captures:
- Input prompts and messages
- Model responses
- Token usage statistics
- Tool calls and their results
- Timing information
- Error states
All this telemetry data is automatically sent to your Opik project for analysis and monitoring.
Advanced Configuration
Custom Tags and Metadata
You can add custom tags and metadata to all traces generated by the OpikExporter:
Tags can be used for filtering and grouping traces, while metadata adds additional context to your traces that can be useful for debugging and analysis.