ai-core/adapter-configuration

Configure tree-shakeable provider adapters for multi-vendor chat workflows.

3.0k|295|Updated Oct 8, 2025
One-click install
npx skills add https://github.com/TanStack/ai --skill ai-core-adapter-configuration
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: ai-core/adapter-configuration
Source: https://github.com/TanStack/ai/tree/main/packages/typescript/ai/skills/ai-core/adapter-configuration
Command: npx skills add https://github.com/TanStack/ai --skill ai-core-adapter-configuration

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Developers integrating TanStack AI need concise, up-to-date guidance to choose and configure the right tree-shakeable provider adapters, ensure per-model type safety, set the correct environment variables, and avoid mixing legacy monolithic patterns.

Core Features & Use Cases

  • Adapter Coverage: Documents how to create tree-shakeable adapters for OpenAI, Anthropic, Gemini, Grok, Groq, OpenRouter, and Ollama, including the factory signatures and env vars for each provider.
  • Reasoning & Runtime Control: Explains how to tune provider-specific modelOptions for reasoning, thinking, safety, structured output, and GPU budgeting, plus how to map provider/model combos for runtime switching.
  • Extension & Guardrails: Shows how to use extendAdapter() and createModel() for custom or fine-tuned models while keeping compile-time safety, and highlights common mistakes such as using deprecated monolithic adapters or wrong env var names.

Quick Start

Configure the OpenAI text adapter for gpt-5.2 with the OPENAI_API_KEY and reasoning effort high before starting a chat session.

Frequently Asked Questions about ai-core/adapter-configuration

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

FAQPage Schema
How do I configure provider adapters for multi-vendor chat workflows?▼

Configuring provider adapters for multi-vendor chat involves selecting tree-shakeable text adapters like openaiText or anthropicText, setting the correct environment variables, and applying per-model type safety to avoid misconfiguration.

What environment variables do I need for OpenAI and Anthropic text adapters?▼

OpenAI and Anthropic text adapters require specific provider environment variables like OPENAI_API_KEY to be set before initializing chat sessions and tuning model options for reasoning and structured output.

Can I switch AI provider adapters at runtime without breaking type safety?▼

Runtime switching of AI provider adapters is supported by using runtime adapter switch maps, which maintain compile-time type safety while allowing dynamic model and provider selection during execution.

How do I extend a text adapter for a custom fine-tuned model?▼

Extending a text adapter for custom models uses the extendAdapter() and createModel() functions to inject fine-tuned configurations while preserving compile-time type safety and guardrails against deprecated monolithic patterns.

What are common mistakes when setting up AI SDK provider adapters?▼

Common AI SDK provider adapter setup mistakes include using deprecated monolithic adapters instead of tree-shakeable ones and supplying incorrect provider env var names, which break per-model type safety.