Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
87 changes: 87 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -302,3 +302,90 @@ on.
virtualized rendering

...and more at <a href="https://tanstack.com"><b>TanStack.com</b></a>.

## ❓ FAQ

### What is TanStack AI?

TanStack AI is a type-safe, provider-agnostic TypeScript SDK for building streaming chat, tool-calling agents, structured outputs, realtime voice, media generation, and framework-native AI apps.

### Key Features

| Feature | Description |
|---------|-------------|
| **Type-Safe** | TypeScript-first with full type inference |
| **Provider-Agnostic** | Switch between OpenAI, Anthropic, Groq, etc. |
| **Streaming Chat** | Real-time message streaming |
| **Tool Calling** | Type-safe tool definitions |
| **Structured Outputs** | Zod, ArkType, Valibot, JSON Schema support |
| **Realtime Voice** | Voice chat with provider adapters |
| **Code Mode** | LLM writes and executes TypeScript in sandbox |
| **Framework Bindings** | React, Vue, Svelte, Solid, Preact |

### Getting Started

```bash
# Install core + OpenAI provider
pnpm add @tanstack/ai @tanstack/ai-openai

# Or with Anthropic
pnpm add @tanstack/ai @tanstack/ai-anthropic

# Framework bindings
pnpm add @tanstack/ai-react
pnpm add @tanstack/ai-vue
pnpm add @tanstack/ai-svelte
```

### Supported Providers

| Provider | Package | Features |
|----------|---------|----------|
| **OpenAI** | `@tanstack/ai-openai` | Chat, Tools, Images, Audio |
| **Anthropic** | `@tanstack/ai-anthropic` | Claude models |
| **Groq** | Custom endpoint | Fast inference |
| **Ollama** | Custom endpoint | Local models |

Comment on lines +340 to +348
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Description: Verify that the Groq and Ollama packages exist

# Check for package.json files in the providers
fd -t f 'package.json' packages/ai-groq packages/ai-ollama --exec cat {} \; | jq -r '.name'

Repository: TanStack/ai

Length of output: 93


Fix Supported Providers table package names for Groq and Ollama

README.md lines 346-347 incorrectly list “Custom endpoint” in the Package column; these rows should use @tanstack/ai-groq and @tanstack/ai-ollama instead.

📦 Proposed fix
 | Provider | Package | Features |
 |----------|---------|----------|
 | **OpenAI** | `@tanstack/ai-openai` | Chat, Tools, Images, Audio |
 | **Anthropic** | `@tanstack/ai-anthropic` | Claude models |
-| **Groq** | Custom endpoint | Fast inference |
-| **Ollama** | Custom endpoint | Local models |
+| **Groq** | `@tanstack/ai-groq` | Fast inference |
+| **Ollama** | `@tanstack/ai-ollama` | Local models |
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
### Supported Providers
| Provider | Package | Features |
|----------|---------|----------|
| **OpenAI** | `@tanstack/ai-openai` | Chat, Tools, Images, Audio |
| **Anthropic** | `@tanstack/ai-anthropic` | Claude models |
| **Groq** | Custom endpoint | Fast inference |
| **Ollama** | Custom endpoint | Local models |
### Supported Providers
| Provider | Package | Features |
|----------|---------|----------|
| **OpenAI** | `@tanstack/ai-openai` | Chat, Tools, Images, Audio |
| **Anthropic** | `@tanstack/ai-anthropic` | Claude models |
| **Groq** | `@tanstack/ai-groq` | Fast inference |
| **Ollama** | `@tanstack/ai-ollama` | Local models |
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@README.md` around lines 340 - 348, Update the "Supported Providers" table so
the Package column for Groq and Ollama use the correct package names: replace
the "Custom endpoint" entries for the Groq row with `@tanstack/ai-groq` and for
the Ollama row with `@tanstack/ai-ollama`; edit the table rows under the
"Supported Providers" heading to swap those two Package cell values accordingly.

### Framework Support

| Framework | Package | Features |
|-----------|---------|----------|
| **React** | `@tanstack/ai-react` | Hooks, Components |
| **Vue** | `@tanstack/ai-vue` | Composables |
| **Svelte** | `@tanstack/ai-svelte` | Runes |
| **Solid** | `@tanstack/ai-solid` | Reactive primitives |
| **Preact** | `@tanstack/ai-preact` | Hooks |

### What Can You Build?

- Streaming chat with typed messages and tool calls
- Type-safe tools running on server or client
- Structured output flows with validation
- Multimodal prompts (text, images, audio, video)
- Realtime voice chat sessions
- Code Mode agents for TypeScript execution
- Devtools for inspecting streams and traces

### TanStack AI vs Vercel AI SDK

| Feature | TanStack AI | Vercel AI SDK |
|---------|-------------|---------------|
| Architecture | Composable activities | Monolithic helpers |
| Type Safety | Full inference | Partial types |
| Provider Support | Multiple adapters | Limited providers |
| Framework Support | 5 frameworks | React-focused |
| Devtools | Built-in | External |

### Requirements

- Node.js 18+ or Bun
- TypeScript 5.0+ (recommended)
- API key for chosen provider

### License & Resources

- **License**: MIT
- **Documentation**: [tanstack.com/ai](https://tanstack.com/ai)
- **Examples**: [GitHub Examples](https://github.com/TanStack/ai/tree/main/examples)
- **Discord**: [TanStack Community](https://discord.gg/tanstack)
- **Twitter**: [@TanStack](https://twitter.com/tan_stack)