tanstack-ai

Build provider-agnostic AI apps with streaming text, tool calls, and structured outputs.

Updated Jul 2, 2025
One-click install
npx skills add https://github.com/janpeterd/dotfiles --skill tanstack-ai-janpeterd
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: tanstack-ai
Source: https://github.com/janpeterd/dotfiles/tree/main/dot_agents/skills/tanstack-ai
Command: npx skills add https://github.com/janpeterd/dotfiles --skill tanstack-ai-janpeterd

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

TanStack AI helps developers avoid brittle, provider-specific AI integrations by providing a unified, type-safe SDK for building reliable chat, streaming generation, and structured outputs.

Core Features & Use Cases

  • Provider-agnostic adapters: Swap OpenAI, Anthropic, Gemini, Ollama, and more without rewriting your app logic.
  • Streaming-first generation: Stream tokens/chunks to power responsive UIs and progressive rendering.
  • Structured output with schemas: Use Zod/JSON schema conversion to reliably return typed objects instead of free-form text.
  • Tool calling and agent loops: Define tools with parameters and execute them, including iterative agent workflows with max-iteration limits.
  • Multimodal support: Handle image inputs and even image generation adapters.
  • Observability and devtools: Inspect messages, tool calls, token usage, streaming events, and reasoning/thinking output.

Quick Start

Use TanStack AI to generate streaming, type-safe responses by creating a chat/completion flow with an adapter like openaiText and passing your messages and (optionally) a schema for structured output.

Frequently Asked Questions about tanstack-ai

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I build a type-safe AI chat UI with streaming text responses?▼

To build type-safe AI chat with streaming, you use a provider-agnostic adapter to generate streaming tokens and chunks for responsive UIs. This approach ensures typed message handling while progressively rendering text as it arrives.

Can I use Zod schemas for structured output generation instead of free-form text?▼

Yes, you can use Zod schemas for structured output generation by converting them to JSON schema. This allows your AI application to reliably return typed objects instead of free-form text, ensuring type safety in downstream logic.

Does this AI SDK support tool calling and agentic workflows with execution limits?▼

This AI SDK supports tool calling and agentic workflows by allowing you to define tools with parameters and execute them iteratively. You can implement agent loops with max-iteration limits, optional approval, and observability hooks for monitoring.

What's the best way to switch between OpenAI, Anthropic, and Gemini without rewriting app logic?▼

The best way to switch between OpenAI, Anthropic, and Gemini is using provider-agnostic adapters. This abstraction lets you swap common model providers without rewriting your application logic, maintaining consistent typed message handling across environments.

How do I handle multimodal requests like image inputs in my AI application?▼

You handle multimodal requests by passing image inputs through the provider-agnostic adapters. The SDK supports multimodal requests across common model providers, including image generation adapters, enabling diverse media processing within your workflows.

Why do my provider-specific AI integrations break when I switch model providers?▼

Provider-specific AI integrations break when switching models due to brittle, provider-specific code. Using a unified, type-safe SDK prevents this by providing provider-agnostic adapters that standardize streaming, structured outputs, and tool calling.