What problem does it solve?
TanStack AI reduces the complexity of integrating multiple LLM providers and building streaming-first chat, agentic, and multimodal features by offering a single, adapter-based SDK with structured output and observability tools. It removes the burden of provider-specific formats, manual streaming handling, and ad-hoc tool orchestration so developers can focus on product UX and business logic.
Core Features & Use Cases
- Provider-agnostic adapters: Swap OpenAI, Anthropic, Gemini, Ollama and other adapters with the same API to support multi-provider strategies and fallbacks.
- Streaming-first generation: Stream text with configurable strategies (batch, punctuation, word boundary, composite) for progressive UIs.
- Tool calling & agent loops: Built-in tool calling with approval workflows and max-iteration controls for safe agentic automation.
- Structured output & validation: Convert Zod schemas to JSON Schema for typed responses and reliable data extraction.
- Use Case: Implement a real-time chat UI that streams model responses, calls search/summarize tools when needed, and validates returned data into typed objects for downstream processing.
Quick Start
Install the @tanstack/ai package and a provider adapter, then call generate with your adapter and messages to stream and validate responses.