# 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.

Repository: https://github.com/TanStack/ai
Canonical: https://ross.abutalabs.com/products/tanstack-ai
Homepage: https://tanstack.com/ai/latest
Language: TypeScript
License: MIT
License Family: permissive
Topics: ai, ai-agents, ai-sdk, anthropic, chatbot, function-calling, gemini, llm, multimodal, openai, react, solidjs, streaming, svelte, tanstack, tool-calling, typescript, typescript-sdk, vue, generative-ai
Last push: 2026-08-26T22:21:22+00:00

## Health v2 (maintenance only)
Score: 80/100 (v2, computed 2026-09-03T02:39:23.370411+00:00)
- activity 99, release rhythm 87, longevity 23
- inputs: {"age_days": 329, "days_push": 7, "days_rel": 8, "gap_med": 0.0, "n_releases_24m": 1799}
- flags: none
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 3028, forks 312 (observed 2026-08-28T04:07:38.847016+00:00)

## What it is
TanStack AI is a type-safe, provider-agnostic TypeScript SDK for building AI applications with streaming chat, tool calling, agents, structured outputs, and multimodal features. It offers a framework-free core with bindings for React, Vue, Svelte, Solid, Preact, Angular, and vanilla JS, plus adapters for OpenAI, Anthropic, Gemini, OpenRouter, Ollama, and more.

## Use cases
- add streaming chat to a react app
- build tool-calling agents in typescript
- switch between openai anthropic and gemini without rewriting code
- build a chatbot with human-in-the-loop tool approval
- generate images audio and video from llm apps
- connect mcp servers to a chat interface
- run a coding agent in a sandbox from my app
- extract structured output from llm responses with zod schemas

## When to choose
- you want a type-safe, framework-agnostic AI SDK with no vendor lock-in or hosted gateway
- you need multi-provider support with swappable adapters across many LLM vendors
- you use React, Vue, Svelte, Solid, Preact, or Angular and want native hooks/composables
- you need advanced features like tool approval flows, MCP integration, sandboxes, or realtime voice

## When to avoid
- you want a fully managed, hosted AI platform with minimal setup
- you work outside the TypeScript/JavaScript ecosystem primarily
- you need a stable 1.0 release - the project is still in RC phase
- you only need a simple single-provider OpenAI wrapper with minimal abstraction

## Facets
- artifact type: library
- maturity: active
- function: llm-inference, agent-framework, chatbot, rag, mcp, sdk, streaming, http-client, speech-recognition, tts, image-processing, video-processing, middleware, developer-tools
- domain: artificial-intelligence, large-language-models, chatbots, web-development, frontend, backend, developer-tools
- platform: cross-platform, browser, python, go, php
- tags: tanstack, provider-agnostic, tool-calling, streaming-chat, multimodal, ag-ui, framework-bindings, structured-outputs, realtime-voice, media-generation, sandboxes, human-in-the-loop, ai-agents, nodejs, typescript, web-server

## Member repositories
- TanStack/ai (main) score 80

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:07:38.847016+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-30T07:29:51.277829+00:00, confidence not recorded.
  - readme: https://github.com/TanStack/ai (fetched 2026-08-28T04:07:38.847016+00:00, sha 1553ce47caa0)
  - homepage: https://tanstack.com/ai/latest (fetched 2026-08-29T09:45:24.714760+00:00, sha 3e8a25454237)
  - site_page: https://tanstack.com/ai/latest/docs/npm-stats (fetched 2026-08-29T09:45:24.732395+00:00, sha 4eb8525d25ff)
  - site_page: https://tanstack.com/ai/latest/docs/getting-started/overview (fetched 2026-08-29T09:45:24.719239+00:00, sha f847d0f07cd0)
  - site_page: https://tanstack.com/ai/latest/docs/comparison/vercel-ai-sdk (fetched 2026-08-29T09:45:24.721033+00:00, sha 46b61f036cd2)
  - site_page: https://tanstack.com/ai/latest/docs/api/ai (fetched 2026-08-29T09:45:24.724665+00:00, sha fe6fa00e581e)
  - site_page: https://tanstack.com/ai/latest/docs/blog (fetched 2026-08-29T09:45:24.727051+00:00, sha 6a9febd85adb)
  - site_page: https://tanstack.com/ai/latest/docs/framework (fetched 2026-08-29T09:45:24.729000+00:00, sha 5847052a1fb8)
  - site_page: https://tanstack.com/ai/latest/docs/contributors (fetched 2026-08-29T09:45:24.730636+00:00, sha 21b5d071a5b1)
  - site_page: https://tanstack.com/blog (fetched 2026-08-29T09:45:24.717459+00:00, sha f45f670c0ce6)
- Data as of 2026-08-30T08:39:29.467469+00:00.
