agentskit.js
Packages

@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/react if you are shipping a chat product.
  • Pair with @agentskit/runtime if the model needs to act over multiple steps.
  • Pair with @agentskit/eval if 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.

#Source

npm: @agentskit/adapters · repo: packages/adapters

Explore nearby

✎ Edit this page on GitHub·Found a problem? Open an issue →·How to contribute →

On this page