Vercel AI SDK has updated its @ai-sdk/baseten package to version 2.1.0, modifying how its native performance client handles embeddings. This change, noted across several Vercel AI SDK changelog entries, makes the native performance client an opt-in component.
Previously, the @basetenlabs/performance-client was a required dependency. This client is a NAPI addon, comprising 16 platform binary packages and consuming between 5-16 MB of installed space. It could not load in edge runtimes, and bundlers were unable to resolve its platform binaries. The client was imported at the module top level, meaning all consumers incurred its overhead, even if they did not use embeddings.
Key Points
- The
@ai-sdk/basetenpackage has been released as version 2.1.0. - The native performance client for embeddings is now opt-in.
- The
@basetenlabs/performance-clientis no longer a direct dependency. - The client is a NAPI addon, consisting of 16 platform binary packages.
- The installed size of the client ranges from 5-16 MB.
- The previous client could not load in edge runtimes.
- Embeddings now use plain HTTP to an OpenAI-compatible endpoint.
Context
According to the Vercel AI SDK changelogs, the prior implementation meant that the performance client was imported at the module top level. This design caused every consumer to bear the cost of the dependency, even if their application did not utilize embeddings. The client's platform binaries were also difficult for bundlers to resolve, and it was incompatible with edge runtimes.
Why It Matters
This update addresses issues related to package size, runtime compatibility, and unnecessary dependencies for developers using the Vercel AI SDK with Baseten. By making the native performance client opt-in, developers can reduce their application's footprint and improve compatibility with edge environments, while still retaining the option for client-side batching and request hedging when needed.
What To Do
- Note that
@ai-sdk/basetenis now at version 2.1.0. - If using Baseten embeddings, consider whether the native performance client is necessary for your application.
- If client-side batching and request hedging are desired, install
@basetenlabs/performance-clientseparately. - Pass the
PerformanceClientconstructor tocreateBasetenif opting into the native client. - Verify that your embedding deployments are configured to serve via an OpenAI-compatible endpoint.
