Sign In

@agentskit/adapters

Package Overview
Dependencies
Maintainers
1
Versions
33
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@agentskit/adapters

Provider adapters for AgentsKit.

Source
npmnpm
Version
0.5.1
Version published
Weekly downloads
1.2K
43.28%
Maintainers
1
Weekly downloads
 
Created
Source

@agentskit/adapters

Connect to any LLM provider — and swap between them — without touching your app code.

npm version npm downloads bundle size license stability GitHub stars

Tags: ai · agents · llm · agentskit · openai · anthropic · claude · gemini · chatgpt · ollama · embeddings · providers

Why adapters

  • Vendor independence — switch from OpenAI to Anthropic to a local Ollama model by changing one line; your hooks, runtime, and tools stay untouched
  • 10+ providers included — Anthropic, OpenAI, Gemini, Ollama, DeepSeek, Grok, Kimi, LangChain, Vercel AI SDK, and any raw ReadableStream
  • Embedder functions built in — the same adapter pattern covers text embeddings, so you can reuse provider config for both chat and RAG
  • One-line local AIollama({ model: 'llama3.1' }) for fully offline agents with no API key required

Install

npm install @agentskit/adapters

Quick example

import { anthropic, openai, ollama } from '@agentskit/adapters'
import { createRuntime } from '@agentskit/runtime'

// Switch provider by swapping one import
const adapter = anthropic({ apiKey: process.env.ANTHROPIC_API_KEY, model: 'claude-sonnet-4-6' })
// const adapter = openai({ apiKey: process.env.OPENAI_API_KEY, model: 'gpt-4o' })
// const adapter = ollama({ model: 'llama3.1' })

const runtime = createRuntime({ adapter })
const result = await runtime.run('Summarize the latest AI news')
console.log(result.content)

Embeddings (for RAG)

Use the same package for vector embeddings — wire openaiEmbedder, geminiEmbedder, or ollamaEmbedder into @agentskit/rag:

import { openaiEmbedder } from '@agentskit/adapters'
import { createRAG } from '@agentskit/rag'
import { fileVectorMemory } from '@agentskit/memory'

const rag = createRAG({
  embed: openaiEmbedder({ apiKey: process.env.OPENAI_API_KEY! }),
  store: fileVectorMemory({ path: './vectors' }),
})

Features

  • Providers: Anthropic, OpenAI, Gemini, Ollama, DeepSeek, Grok, Kimi, LangChain, LangGraph, Vercel AI SDK, generic ReadableStream
  • Embedders: openaiEmbedder, geminiEmbedder, ollamaEmbedder
  • All adapters satisfy Adapter contract v1 (ADR 0001) — substitutable anywhere in the ecosystem
  • Custom adapter authoring via createAdapter()

Ecosystem

PackageRole
@agentskit/coreAdapter, EmbedFn, types
@agentskit/runtimeHeadless createRuntime
@agentskit/ragcreateRAG + embedders
@agentskit/memoryVector + chat memory backends

Contributors

AgentsKit contributors

License

MIT — see LICENSE.

Docs

Full documentation · GitHub

Keywords

agentskit

FAQs

Package last updated on 16 Apr 2026

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts