TanStack AI is a type-safe, provider-agnostic TypeScript SDK designed for building AI applications with streaming chat, tool calling, agents, and multimodal capabilities. The SDK supports multiple AI providers including OpenAI, Anthropic, Gemini, and others, while offering framework integrations for React, Vue, Svelte, Solid, and Preact. The architecture is built around composable activities and provider adapters, allowing developers to use a single provider or switch between many, and to import only the specific functionality their application requires.
The core functionality spans several key areas. For streaming chat, the SDK provides type-safe message handling with support for tool calls and reasoning parts, configurable connection adapters, and structured output flows backed by JSON Schema, Zod, ArkType, or Valibot. Tool calling is implemented through a type-safe contract system where tools are defined once and can have server or client implementations attached with matching input and output types. The SDK also supports multimodal prompts and responses including text, images, audio, video, and documents, along with specialized workflows for image generation, audio generation, speech synthesis, transcription, and summarization through a unified generation client pattern.
Advanced capabilities include realtime voice chat with provider adapters for low-latency sessions, Code Mode agents that allow language models to write and execute TypeScript in isolated sandboxes for orchestrating tools with loops and branches, and comprehensive devtools and observability pipelines for inspecting messages, tool calls, stream chunks, errors, usage metrics, and OpenTelemetry traces. The framework-native clients provide React hooks like useChat and useRealtimeChat, Vue composables, Svelte 5 factories, and Solid hooks, alongside a headless client for custom runtimes.
The provider ecosystem includes official adapters for OpenRouter (300+ models), OpenAI (chat, image, video, speech, transcription, realtime), Anthropic Claude (chat, thinking, tools, structured outputs), Google Gemini (chat, image, speech, audio), Ollama (local models), xAI Grok, Groq, ElevenLabs (realtime voice, speech, transcription), and fal.ai (image, video, audio). The adapter system is tree-shakeable by activity, allowing developers to import only specific functions like openaiText for chat or falVideo for video generation.
According to GitGenius activity tracking, the repository shows a median issue and pull request response latency of 4.3 hours across 134 tracked items, with a mean latency of 197.8 hours. The most active contributor tracked is AlemTuzlak with 143 events, followed by tombeckenham with 49 events and tecoad with 7 events. Enhancement requests represent the most common issue label with 10 tracked items, followed by bug and dependencies labels. The repository shares overlapping contributors with better-auth/better-auth, prisma/prisma, and microsoft/vscode, indicating cross-project collaboration within the ecosystem.
Advanced features include middleware for hooking into chat configuration, chunks, tool calls, usage, errors, and structured outputs, OpenTelemetry support for vendor-neutral GenAI traces and metrics, per-model type safety for narrowing model options and content modalities, and runtime adapter switching for provider flexibility. The SDK emphasizes tree-shaking to ensure applications ship only the activities and adapters they actually use.