ai-core
Installation
SKILL.md
TanStack AI — Core Concepts
TanStack AI is a type-safe, provider-agnostic AI SDK. Server-side functions
live in @tanstack/ai and provider adapter packages. Client-side hooks live
in framework packages (@tanstack/ai-react, @tanstack/ai-solid, etc.).
Always import from the framework package on the client — never from
@tanstack/ai-client directly (unless vanilla JS).
Sub-Skills
| Need to... | Read |
|---|---|
| Build a chat UI with streaming | ai-core/chat-experience/SKILL.md |
| Add tool calling (server, client, or both) | ai-core/tool-calling/SKILL.md |
| Generate images, video, speech, or transcriptions | ai-core/media-generation/SKILL.md |
| Get typed JSON responses from the LLM | ai-core/structured-outputs/SKILL.md |
| Choose and configure a provider adapter | ai-core/adapter-configuration/SKILL.md |
| Implement AG-UI streaming protocol server-side | ai-core/ag-ui-protocol/SKILL.md |
| Add analytics, logging, or lifecycle hooks | ai-core/middleware/SKILL.md |
| Connect to a non-TanStack-AI backend | ai-core/custom-backend-integration/SKILL.md |
| Set up Code Mode (LLM code execution) | See @tanstack/ai-code-mode package skills |
Quick Decision Tree
- Setting up a chatbot? → ai-core/chat-experience
- Adding function calling? → ai-core/tool-calling
- Generating media (images, audio, video)? → ai-core/media-generation
- Need structured JSON output? → ai-core/structured-outputs
- Choosing/configuring a provider? → ai-core/adapter-configuration
- Building a server-only AG-UI backend? → ai-core/ag-ui-protocol
- Adding analytics or post-stream events? → ai-core/middleware
- Connecting to a custom backend? → ai-core/custom-backend-integration
- Debugging mistakes? → Check Common Mistakes in the relevant sub-skill
Critical Rules
- This is NOT the Vercel AI SDK. Use
chat()notstreamText(). UseopenaiText()notcreateOpenAI(). Import from@tanstack/ai, notai. - Import from framework package on client. Use
@tanstack/ai-react(or solid/vue/svelte/preact), not@tanstack/ai-client. - Use
toServerSentEventsResponse()to convert streams to HTTP responses. Never implement SSE manually. - Use middleware for lifecycle events. No
onEnd/onFinishcallbacks onchat()— usemiddleware: [{ onFinish: ... }]. - Ask the user which adapter and model they want. Suggest the latest model. Also ask if they want Code Mode.
- Tools must be passed to both server and client. Server gets the tool in
chat({ tools }), client gets the definition inuseChat({ clientTools }).
Version
Targets TanStack AI v0.10.0.
Weekly Installs
1
Repository
tanstack/aiGitHub Stars
2.5K
First Seen
11 days ago
Security Audits
Installed on
amp1
cline1
opencode1
cursor1
kimi-cli1
warp1