// the find
TanStack/ai
🤖 Type-safe, provider-agnostic TypeScript AI SDK for streaming chat, tool calling, agents, and multimodal apps across OpenAI, Anthropic, Gemini, React, Vue, Svelte, and Solid.
TanStack AI is a TypeScript SDK for building LLM-powered apps across React, Vue, Svelte, Solid, and server environments. It abstracts over OpenAI, Anthropic, Gemini, and a dozen other providers behind a unified adapter interface with first-class streaming, tool calling, and structured outputs. Aimed at frontend teams who already live in the TanStack ecosystem and want provider flexibility without vendor lock-in.
The adapter + activity tree-shaking model is genuinely well thought out — you import `openaiText` for chat and `falVideo` for video generation, so your bundle only pays for what you use. The `toolDefinition()` contract that shares input/output types between server and client implementations eliminates the usual hand-rolled type duplication. OpenTelemetry traces and a typed observability event bus are built in from the start, not bolted on — that matters when you're debugging a multi-turn agent loop. The migration tooling (codemods with test fixtures) signals this project takes breaking changes seriously, which is rare for a pre-1.0 AI library.
At 2,700 stars it's very new and the API surface is enormous for that age — realtime voice, Code Mode sandboxes, video generation, and six framework bindings in one repo means a lot of surface area to keep stable simultaneously. The Vercel AI SDK comparison doc exists, which is a sign they know they're in a crowded space, but the comparison is written by the home team so take it with salt. The 'Code Mode' feature — letting the LLM write and execute TypeScript in a sandbox — is a significant security surface that the README waves away with 'secure isolate'; the docs don't explain what the isolate boundary actually is or what escape paths exist. No server-side session persistence story out of the box means you'll be rolling your own conversation storage the moment you leave the quick-start.