{"id":35867875,"url":"https://github.com/tanstack/ai","last_synced_at":"2026-04-09T01:02:48.442Z","repository":{"id":328082480,"uuid":"1072429861","full_name":"TanStack/ai","owner":"TanStack","description":"🤖 SDK that enhances your applications with AI capabilities","archived":false,"fork":false,"pushed_at":"2026-02-12T08:35:58.000Z","size":12009,"stargazers_count":2312,"open_issues_count":52,"forks_count":130,"subscribers_count":8,"default_branch":"main","last_synced_at":"2026-02-12T17:55:38.850Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/TanStack.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null},"funding":{"github":"tannerlinsley"}},"created_at":"2025-10-08T17:52:48.000Z","updated_at":"2026-02-12T08:36:01.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/TanStack/ai","commit_stats":null,"previous_names":["tanstack/ai"],"tags_count":183,"template":false,"template_full_name":null,"purl":"pkg:github/TanStack/ai","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TanStack%2Fai","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TanStack%2Fai/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TanStack%2Fai/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TanStack%2Fai/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/TanStack","download_url":"https://codeload.github.com/TanStack/ai/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TanStack%2Fai/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29558101,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-17T20:52:40.164Z","status":"ssl_error","status_checked_at":"2026-02-17T20:48:10.325Z","response_time":100,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-01-08T14:14:14.347Z","updated_at":"2026-04-02T15:37:49.217Z","avatar_url":"https://github.com/TanStack.png","language":"TypeScript","readme":"\u003cdiv align=\"center\"\u003e\n  \u003cimg src=\"./media/header_ai.png\" \u003e\n\u003c/div\u003e\n\n\u003cbr /\u003e\n\n\u003cdiv align=\"center\"\u003e\n\u003ca href=\"https://npmjs.com/package/@tanstack/ai\" target=\"\\_parent\"\u003e\n  \u003cimg alt=\"\" src=\"https://img.shields.io/npm/dm/@tanstack/ai.svg\" /\u003e\n\u003c/a\u003e\n\u003ca href=\"https://github.com/TanStack/ai\" target=\"\\_parent\"\u003e\n\t  \u003cimg alt=\"\" src=\"https://img.shields.io/github/stars/TanStack/ai.svg?style=social\u0026label=Star\" alt=\"GitHub stars\" /\u003e\n\u003c/a\u003e\n\u003ca href=\"https://bundlephobia.com/result?p=@tanstack/ai@latest\" target=\"\\_parent\"\u003e\n  \u003cimg alt=\"\" src=\"https://badgen.net/bundlephobia/minzip/@tanstack/ai@latest\" /\u003e\n\u003c/a\u003e\n\u003c/div\u003e\n\n\u003cdiv align=\"center\"\u003e\n\u003ca href=\"#badge\"\u003e\n  \u003cimg alt=\"semantic-release\" src=\"https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg\"\u003e\n\u003c/a\u003e\n\t\u003ca href=\"#badge\"\u003e\n\t\t\u003cimg src=\"https://img.shields.io/github/v/release/tanstack/ai\" alt=\"Release\"/\u003e\n\t\u003c/a\u003e\n\u003ca href=\"https://twitter.com/tan_stack\"\u003e\n  \u003cimg src=\"https://img.shields.io/twitter/follow/tan_stack.svg?style=social\" alt=\"Follow @TanStack\"/\u003e\n\u003c/a\u003e\n\u003c/div\u003e\n\n\u003cdiv align=\"center\"\u003e\n  \n### [Become a Sponsor!](https://github.com/sponsors/tannerlinsley/)\n\u003c/div\u003e\n\n# TanStack AI\n\nA powerful, type-safe AI SDK for building AI-powered applications.\n\n- Provider-agnostic adapters (OpenAI, Anthropic, Gemini, Ollama, etc.)\n- **Tree-shakeable adapters** - Import only what you need for smaller bundles\n- **Multimodal content support** - Send images, audio, video, and documents\n- **Image generation** - Generate images with OpenAI DALL-E/GPT-Image and Gemini Imagen\n- Chat completion, streaming, and agent loop strategies\n- Headless chat state management with adapters (SSE, HTTP stream, custom)\n- Isomorphic type-safe tools with server/client execution\n- **Enhanced integration with TanStack Start** - Share implementations between AI tools and server functions\n- **Observability events** - Structured, typed events for text, tools, image, speech, transcription, and video ([docs](./docs/guides/observability.md))\n\n### \u003ca href=\"https://tanstack.com/ai\"\u003eRead the docs →\u003c/a\u003e\n\n## Requirements\n\n- **Node.js v24+** is required to avoid compatibility issues with `isolated-vm`.\n\n## Tree-Shakeable Adapters\n\nImport only the functionality you need for smaller bundle sizes:\n\n```typescript\n// Only chat functionality - no summarization code bundled\nimport { openaiText } from '@tanstack/ai-openai/adapters'\nimport { generate } from '@tanstack/ai'\n\nconst textAdapter = openaiText()\n\nconst result = generate({\n  adapter: textAdapter,\n  model: 'gpt-4o',\n  messages: [{ role: 'user', content: [{ type: 'text', content: 'Hello!' }] }],\n})\n\nfor await (const chunk of result) {\n  console.log(chunk)\n}\n```\n\nAvailable adapters: `openaiText`, `openaiEmbed`, `openaiSummarize`, `anthropicText`, `geminiText`, `ollamaText`, and more.\n\n## Get Involved\n\n- We welcome issues and pull requests!\n- Participate in [GitHub discussions](https://github.com/TanStack/ai/discussions)\n- Chat with the community on [Discord](https://discord.com/invite/WrRKjPJ)\n- See [CONTRIBUTING.md](./CONTRIBUTING.md) for setup instructions\n\n## Partners\n\n\u003ctable align=\"center\"\u003e\n  \u003ctr\u003e\n    \u003ctd\u003e\n      \u003ca href=\"https://www.coderabbit.ai/?via=tanstack\u0026dub_id=aCcEEdAOqqutX6OS\" \u003e\n        \u003cpicture\u003e\n         \u003csource media=\"(prefers-color-scheme: dark)\" srcset=\"https://tanstack.com/assets/coderabbit-dark-D643Zkrv.svg\" /\u003e\n          \u003csource media=\"(prefers-color-scheme: light)\" srcset=\"https://tanstack.com/assets/coderabbit-light-CIzGLYU_.svg\" /\u003e\n          \u003cimg src=\"https://tanstack.com/assets/coderabbit-light-CIzGLYU_.svg\" height=\"40\" alt=\"CodeRabbit\" /\u003e\n        \u003c/picture\u003e\n      \u003c/a\u003e\n    \u003c/td\u003e\n    \u003ctd\u003e\n      \u003ca href=\"https://www.cloudflare.com?utm_source=tanstack\"\u003e\n        \u003cpicture\u003e\n           \u003csource media=\"(prefers-color-scheme: dark)\" srcset=\"https://tanstack.com/assets/cloudflare-white-Co-Tyjbl.svg\" /\u003e\n          \u003csource media=\"(prefers-color-scheme: light)\" srcset=\"https://tanstack.com/assets/cloudflare-black-6Ojsn8yh.svg\" /\u003e\n          \u003cimg src=\"https://tanstack.com/assets/cloudflare-white-Co-Tyjbl.svg\" height=\"60\" alt=\"Cloudflare\" /\u003e\n        \u003c/picture\u003e\n      \u003c/a\u003e\n    \u003c/td\u003e\n  \u003c/tr\u003e\n\u003c/table\u003e\n\n\u003cdiv align=\"center\"\u003e\n\u003cimg src=\"./media/partner_logo.svg\" alt=\"AI \u0026 you?\" height=\"65\"\u003e\n\u003cp\u003e\nWe're looking for TanStack AI Partners to join our mission! Partner with us to push the boundaries of TanStack AI and build amazing things together.\n\u003c/p\u003e\n\u003ca href=\"mailto:partners@tanstack.com?subject=TanStack AI Partnership\"\u003e\u003cb\u003eLET'S CHAT\u003c/b\u003e\u003c/a\u003e\n\u003c/div\u003e\n\n## Explore the TanStack Ecosystem\n\n- \u003ca href=\"https://github.com/tanstack/config\"\u003e\u003cb\u003eTanStack Config\u003c/b\u003e\u003c/a\u003e – Tooling for JS/TS packages\n- \u003ca href=\"https://github.com/tanstack/db\"\u003e\u003cb\u003eTanStack DB\u003c/b\u003e\u003c/a\u003e – Reactive sync client store\n- \u003ca href=\"https://github.com/tanstack/devtools\"\u003e\u003cb\u003eTanStack Devtools\u003c/b\u003e\u003c/a\u003e – Unified devtools panel\n- \u003ca href=\"https://github.com/tanstack/form\"\u003e\u003cb\u003eTanStack Form\u003c/b\u003e\u003c/a\u003e – Type‑safe form state\n- \u003ca href=\"https://github.com/tanstack/pacer\"\u003e\u003cb\u003eTanStack Pacer\u003c/b\u003e\u003c/a\u003e – Debouncing, throttling, batching\n- \u003ca href=\"https://github.com/tanstack/query\"\u003e\u003cb\u003eTanStack Query\u003c/b\u003e\u003c/a\u003e – Async state \u0026 caching\n- \u003ca href=\"https://github.com/tanstack/ranger\"\u003e\u003cb\u003eTanStack Ranger\u003c/b\u003e\u003c/a\u003e – Range \u0026 slider primitives\n- \u003ca href=\"https://github.com/tanstack/router\"\u003e\u003cb\u003eTanStack Router\u003c/b\u003e\u003c/a\u003e – Type‑safe routing, caching \u0026 URL state\n- \u003ca href=\"https://github.com/tanstack/router\"\u003e\u003cb\u003eTanStack Start\u003c/b\u003e\u003c/a\u003e – Full‑stack SSR \u0026 streaming\n- \u003ca href=\"https://github.com/tanstack/store\"\u003e\u003cb\u003eTanStack Store\u003c/b\u003e\u003c/a\u003e – Reactive data store\n- \u003ca href=\"https://github.com/tanstack/table\"\u003e\u003cb\u003eTanStack Table\u003c/b\u003e\u003c/a\u003e – Headless datagrids\n- \u003ca href=\"https://github.com/tanstack/virtual\"\u003e\u003cb\u003eTanStack Virtual\u003c/b\u003e\u003c/a\u003e – Virtualized rendering\n\n… and more at \u003ca href=\"https://tanstack.com\"\u003e\u003cb\u003eTanStack.com »\u003c/b\u003e\u003c/a\u003e\n\n\u003c!-- USE THE FORCE LUKE --\u003e\n","funding_links":["https://github.com/sponsors/tannerlinsley","https://github.com/sponsors/tannerlinsley/"],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftanstack%2Fai","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftanstack%2Fai","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftanstack%2Fai/lists"}