
Research
/Security News
OpenAPI React Query Codegen Compromised in Mini Shai-Hulud npm Supply Chain Attack
Ten malicious OpenAPI React Query Codegen versions were published to npm in the Mini Shai-Hulud attack, all with valid provenance.
@agentskit/adapters
Advanced tools
Connect to any LLM provider — and swap between them — without touching your app code.
Tags: ai · agents · llm · agentskit · openai · anthropic · claude · gemini · chatgpt · ollama · embeddings · providers
ReadableStreamollama({ model: 'llama3.1' }) for fully offline agents with no API key requirednpm install @agentskit/adapters
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)
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' }),
})
ReadableStreamopenaiEmbedder, geminiEmbedder, ollamaEmbedderAdapter contract v1 (ADR 0001) — substitutable anywhere in the ecosystemcreateAdapter()| Package | Role |
|---|---|
| @agentskit/core | Adapter, EmbedFn, types |
| @agentskit/runtime | Headless createRuntime |
| @agentskit/rag | createRAG + embedders |
| @agentskit/memory | Vector + chat memory backends |
Three built-in utilities let you test agents without hitting a real LLM.
mockAdapter — deterministic responsesimport { mockAdapter } from '@agentskit/adapters'
const adapter = mockAdapter({
response: [
{ type: 'text', content: 'Hello!' },
{ type: 'done' },
],
})
Pass a function to make responses request-aware, or pass an array of arrays to return different chunks on each call (sequenced mode). Use the optional history array to capture every request for assertions.
recordingAdapter + inMemorySink — capture real callsimport { recordingAdapter, inMemorySink, anthropic } from '@agentskit/adapters'
const sink = inMemorySink()
const adapter = recordingAdapter(
anthropic({ apiKey: process.env.ANTHROPIC_API_KEY!, model: 'claude-sonnet-4-6' }),
sink,
)
// Runs the real LLM and captures every chunk to sink.fixture
replayAdapter — replay captured fixturesimport { replayAdapter } from '@agentskit/adapters'
import fixture from './fixture.json'
const adapter = replayAdapter(fixture) // no network calls
Typical workflow: record once in dev → commit JSON fixture → replay in CI.
MIT — see LICENSE.
FAQs
Provider adapters for AgentsKit.
The npm package @agentskit/adapters receives a total of 2,263 weekly downloads. As such, @agentskit/adapters popularity was classified as popular.
We found that @agentskit/adapters demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.

Research
/Security News
Ten malicious OpenAPI React Query Codegen versions were published to npm in the Mini Shai-Hulud attack, all with valid provenance.

Security News
Socket joins more than 100 technology, cybersecurity, and financial organizations calling for a global surge in cyber defense.

Product
Enterprise security teams can now detect malware, credential theft, suspicious network activity, and risky updates across Microsoft Edge extensions.