Vercel
Vercel Integration
Learn how to integrate Maxim observability with the Vercel AI SDK in just one line of code.
Maxim Integration for Vercel
Requirements
Environment Variables
Initialize Logger
Wrap AI SDK Models with Maxim
Make LLM calls using wrapped models
Working with Different AI SDK Functions
The wrapped model works seamlessly with all Vercel AI SDK functions:
Generate Object
Stream Text
Custom Metadata and Tracing
Using Custom Metadata
Available Metadata Fields
Entity Naming:
sessionName
- Override the default session nametraceName
- Override the default trace namespanName
- Override the default span namegenerationName
- Override the default LLM generation name
Entity Tagging:
sessionTags
- Add custom tags to the session(object: {key: value})
traceTags
- Add custom tags to the trace(object: {key: value})
spanTags
- Add custom tags to span(object: {key: value})
generationTags
- Add custom tags to LLM generations(object: {key: value})
ID References:
sessionId
- Link this trace to an existing sessiontraceId
- Use a specific trace IDspanId
- Use a specific span ID