@agentskit/adapters
20+ LLM chat + embedder adapters, plus router / ensemble / fallback. Swap providers with one import line.
@agentskit/adapters is usually the first package you touch after core. It is the provider seam for the entire ecosystem: UI, runtime, memory, evals, and recipes all plug into this layer.
#When to reach for it
- You need to talk to a hosted LLM (Anthropic, OpenAI, Gemini, Mistral, Cohere, Groq, Together, Fireworks, OpenRouter, Hugging Face, …).
- You want local-only (Ollama, LM Studio, vLLM, llama.cpp).
- You want to compose multiple candidates (
createRouter,createEnsembleAdapter,createFallbackAdapter). - You want to test agents without hitting a real LLM (
mockAdapter,recordingAdapter,replayAdapter).
#Best fit
- Start here if your main concern is provider flexibility.
- Pair with
@agentskit/reactif you are shipping a chat product. - Pair with
@agentskit/runtimeif the model needs to act over multiple steps. - Pair with
@agentskit/evalif you want to compare providers over the same workload.
#Install
npm install @agentskit/adapters#Hello world
import { anthropic } from '@agentskit/adapters'
const adapter = anthropic({ apiKey: process.env.ANTHROPIC_API_KEY!, model: 'claude-sonnet-4-6' })The important part is not the constructor itself, but that the rest of your stack does not have to care which provider you chose.
#Surface
Hosted: anthropic · openai · gemini · grok · deepseek · kimi · mistral · cohere · together · groq · fireworks · openrouter · huggingface · langchain · langgraph · vercelAI · generic
Local: ollama · lmstudio · vllm · llamacpp
Embedders: openaiEmbedder · geminiEmbedder · ollamaEmbedder · deepseekEmbedder · grokEmbedder · kimiEmbedder · createOpenAICompatibleEmbedder
Higher-order: createRouter · createEnsembleAdapter · createFallbackAdapter
Testing: mockAdapter · recordingAdapter · replayAdapter · inMemorySink · simulateStream · chunkText · fetchWithRetry
#Recipes
#Stability
- Version:
0.9.1 - Tier: beta
- Contract: evolving
- Roadmap: see packages roadmap for what this package needs to reach v1.0.
#Related
#Source
npm: @agentskit/adapters · repo: packages/adapters
Explore nearby
- PeerPackages overview
Every AgentsKit package at a glance — what it does, when to reach for it, where to read the deep dive.
- PeerRoadmap
Per-package stability status, current version, and what each package needs to reach v1.0.
- Peer@agentskit/core
Shared contract layer — TypeScript types, headless chat controller, stream helpers. Zero-dep, under 10 KB gzipped.