TanStack's bet: one AI SDK that doesn't lock you into React or OpenAI
A provider-agnostic, framework-native TypeScript SDK for streaming chat, tools, and multimodal AI with adapters for nine providers and six UI frameworks.

What it does TanStack AI is a modular TypeScript SDK for building AI apps—streaming chat, tool-calling agents, structured outputs, voice, media generation—across multiple LLM providers and frontend frameworks. You install only the pieces you need: core chat logic, a provider adapter (OpenAI, Anthropic, Gemini, Grok, Ollama, etc.), and optionally a framework binding (React, Vue, Svelte, Solid, Preact).
The interesting bit
The architecture treats providers as swappable, tree-shakeable adapters. A single toolDefinition() contract can run on server or client with the same Zod/ArkType/Valibot types. There’s even a “Code Mode” that lets an LLM write and execute TypeScript in an isolated sandbox to orchestrate its own tool loops. The README also includes a direct comparison with Vercel AI SDK, which signals both confidence and a target audience.
Key highlights
- Nine official provider adapters including OpenRouter (300+ models, per-request cost tracking) and local Ollama
- Framework-native clients: React hooks, Vue composables, Svelte 5 runes, Solid hooks, Preact hooks, plus headless UI components
- Structured outputs with JSON Schema, Zod, ArkType, or Valibot
- Realtime voice chat, media generation (image/audio/video), transcription, and summarization through a shared generation pattern
- Middleware hooks, OpenTelemetry traces, and runtime adapter switching
Caveats
- The SDK is young (2.7k stars) and the surface area is huge—nine providers, six frameworks, multiple modalities—so edge-case maturity across all combinations is unclear
- Some UI packages (
@tanstack/ai-react-ui, etc.) are mentioned but lack linked documentation in the README
Verdict Worth evaluating if you’re building a multi-provider or multi-framework product and want to avoid vendor lock-in. Probably overkill if you’re all-in on Next.js and OpenAI; Vercel’s SDK may still be the path of least resistance there.