Favicon of Vercel AI SDK

Vercel AI SDK

TypeScript AI library for apps using local models through Ollama or LM Studio, with streaming, agents and optional cloud providers.

Screenshot of Vercel AI SDK website

Vercel AI SDK is a free TypeScript library for developers building apps and agents that use local models through Ollama or LM Studio. It runs within your application; those backends run the models. Its default model route uses Vercel AI Gateway, which sends requests to a cloud service, while the documented local integrations connect to your own model server.

The SDK gives local and cloud providers a shared interface, reducing the amount of application code tied to a particular provider. Its core supports text generation, structured responses and tool-calling agents. Streaming lets an app display responses as they arrive, and built-in fallbacks handle failed model requests. It also supports image and video generation, speech synthesis and transcription through compatible models.

For local inference, Ollama connects through the community packages ollama-ai-provider-v2 and ai-sdk-ollama. LM Studio connects through the SDK's OpenAI-compatible provider. Both integrations support language models and embeddings; documented examples include Qwen3 for Ollama and llama-3.2-1b for LM Studio. Model capabilities vary by backend.

The UI module supplies hooks for chat and generative interfaces in React, Next.js, Svelte and Vue, and the library supports Node.js applications. Developers can also connect directly to OpenAI, Anthropic or Google through provider packages. Those requests go to the selected remote service rather than the local model server.

Similar to Vercel AI SDK