The Vercel AI SDK has released an update to its Baseten integration, specifically for embeddings. This change, part of the @ai-sdk/baseten@2.1.0 release, makes the native performance client an opt-in component rather than a default dependency.
Key Points
- The
@ai-sdk/baseten@2.1.0release includes a minor change to the Baseten integration. - The native performance client for embeddings is now opt-in.
@basetenlabs/performance-clientis no longer a default dependency.- The previous client was a NAPI addon, comprising 16 platform binary packages and 5-16 MB in size.
- The prior client could not load in edge runtimes and its platform binaries were difficult for bundlers to resolve.
- Embeddings now use plain HTTP to the deployment's OpenAI-compatible endpoint.
- Users can install the native client themselves and pass its constructor to
createBasetento retain client-side batching and request hedging.
Context
According to the Vercel AI SDK changelog, the previous native performance client for embeddings was a significant dependency. It was a NAPI addon that included multiple platform binary packages, consuming a notable amount of disk space. This client also presented compatibility issues with edge runtimes and bundlers, and its top-level module import meant all consumers incurred its cost, even if they did not use embeddings.
Why It Matters
This update simplifies the dependency structure for developers using the Vercel AI SDK with Baseten, particularly for those not utilizing embeddings or deploying to edge environments. It reduces the default package size and resolves compatibility issues, while still offering the option to use the performance client for specific use cases.
What To Do
- Note that
@basetenlabs/performance-clientis no longer a default dependency for@ai-sdk/baseten@2.1.0. - If using Baseten embeddings and requiring client-side batching or request hedging, install
@basetenlabs/performance-clientseparately. - Pass the
PerformanceClientconstructor tocreateBasetenwhen initializing the Baseten client. - Review your project's dependencies if you are upgrading to
@ai-sdk/baseten@2.1.0.
