Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

ai-core/adapter-configuration

БесплатноБез исполняемых скриптовНе проверен

Provider adapter selection and configuration: openaiText, anthropicText, geminiText, ollamaText, grokText, groqText, openRouterText, bedrockText…

TanStackот TanStack★ 3 396 звёзд на GitHub

Об этом скилле

Adapter Configuration

Dependency: This skill builds on ai-core. Read it first for critical rules.

Before implementing: Ask the user which provider and model they want. Then fetch the latest available models from the provider's source code (check the adapter's model metadata file, e.g. packages/ai-openai/src/model-meta.ts) or from the provider's API/docs to recommend the most current model. The model lists in this skill and its reference files may be outdated. Always verify against the source before recommending a specific model.

Setup

Create an adapter and use it with chat():

import { chat, toServerSentEventsResponse } from '@tanstack/ai'
import { openaiText } from '@tanstack/ai-openai'

export async function POST(request: Request) {
  const { messages, threadId } = await request.json()

  const stream = chat({
    adapter: openaiText('gpt-5.2'),
    messages,
    threadId,
    modelOptions: {
      temperature: 0.7,
      max_output_tokens: 1000,
    },
  })

  return toServerSentEventsResponse(stream)
}

The adapter factory function takes the model name as a string literal and an optional config object (API key, base URL, etc.). The model name is passed into the factory, not into chat().

Sampling options (temperature, token limits, top_p/topP, etc.) live inside modelOptions using each provider's native key — they are not top-level options on chat(). See the per-provider table in Configuring Sampling below.

Core Patterns

1. Adapter Selection

Each provider has a dedicated package with tree-shakeable adapter factories. The text adapter is the primary one for chat/completions:

Provider Package Factory Env Var
OpenAI @tanstack/ai-openai openaiText OPENAI_API_KEY
Anthropic @tanstack/ai-anthropic anthropicText ANTHROPIC_API_KEY
Gemini @tanstack/ai-gemini geminiText GOOGLE_API_KEY or GEMINI_API_KEY
Grok (xAI) @tanstack/ai-grok grokText XAI_API_KEY
Groq @tanstack/ai-groq groqText GROQ_API_KEY
OpenRouter @tanstack/ai-openrouter openRouterText OPENROUTER_API_KEY
Ollama @tanstack/ai-ollama ollamaText OLLAMA_HOST (default: http://localhost:11434)
Bedrock @tanstack/ai-bedrock bedrockText BEDROCK_API_KEY or AWS_BEARER_TOKEN_BEDROCK
BytePlus @tanstack/ai-byteplus byteplusText ARK_API_KEY (falls back to BYTEPLUS_API_KEY)
OpenAI-compatible @tanstack/ai-openai/compatible openaiCompatible / openaiCompatibleText provider-specific (passed via apiKey)
Cloudflare @tanstack/ai-cloudflare cloudflareText CLOUDFLARE_ACCOUNT_ID + CLOUDFLARE_API_TOKEN, or { binding: env.AI } in a Worker
Neon AI Gateway @tanstack/ai-neon neonText NEON_AI_GATEWAY_TOKEN + NEON_AI_GATEWAY_BASE_URL (branch host)

BytePlus uses two keys. byteplusText / byteplusVideo / byteplusImage read ARK_API_KEY (ModelArk, Authorization: Bearer), but byteplusSpeech / byteplusTranscription are a separate product and read BYTEPLUS_VOICE_API_KEY (Seed Speech, X-Api-Key). Ark keys are also region-isolated — the default base URL is the ap-southeast endpoint.

// Each factory takes model as first arg, optional config as second
import { openaiText, createOpenaiChat } from '@tanstack/ai-openai'
import { anthropicText } from '@tanstack/ai-anthropic'
import { geminiText } from
Полный SKILL.md на GitHub

Установить ai-core/adapter-configuration в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

Вложенные файлы

references/anthropic-adapter.mdreferences/byteplus-adapter.mdreferences/gemini-adapter.mdreferences/grok-adapter.mdreferences/groq-adapter.mdreferences/ollama-adapter.mdreferences/openai-adapter.mdreferences/openrouter-adapter.md

FAQ

Что делает скилл ai-core/adapter-configuration?

Provider adapter selection and configuration: openaiText, anthropicText, geminiText, ollamaText, grokText, groqText, openRouterText, bedrockText, byteplusText, openaiCompatible. Per-model type safety with modelOptions, reasoning/thinking configuration, runtime adapter switching, extendAdapter() for custom models, createModel(). Generic OpenAI-compatible providers (DeepSeek, Together, Fireworks, etc.) via openaiCompatible({ baseURL, apiKey, models }) from @tanstack/ai-openai/compatible. API key env vars: OPENAI_API_KEY, ANTHROPIC_API_KEY, GOOGLE_API_KEY/GEMINI_API_KEY, XAI_API_KEY, GROQ_API_KEY, OPENROUTER_API_KEY, OLLAMA_HOST, BEDROCK_API_KEY (or AWS_BEARER_TOKEN_BEDROCK). BytePlus needs TWO keys: ARK_API_KEY (ModelArk — chat/video/image) and BYTEPLUS_VOICE_API_KEY (Seed Speech — TTS/transcription); neither is a fallback for the other.

Как установить скилл ai-core/adapter-configuration?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл ai-core/adapter-configuration запускает скрипты?

Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.

Похожие скиллы

Сравнить ai-core/adapter-configuration с