
Product
Introducing Pull Request Stories to Help Security Teams Track Supply Chain Risks
Socket’s new Pull Request Stories give security teams clear visibility into dependency risks and outcomes across scanned pull requests.
agentic-kit
Advanced tools
Agentic Kit is the core library providing a unified, streaming-capable interface for multiple LLM providers. It lets you plug in any supported adapter and switch between them at runtime.
npm install agentic-kit
# or
yarn add agentic-kit
Agentic Kit includes adapters for Ollama and Bradie out of the box.
import {
// Adapters
OllamaAdapter,
BradieAdapter,
// Factory functions
createOllamaKit,
createBradieKit,
createMultiProviderKit,
// Core type
AgentKit
} from 'agentic-kit';
// Ollama-only client
const ollamaKit: AgentKit = createOllamaKit('http://localhost:11434');
const text = await ollamaKit.generate({ model: 'mistral', prompt: 'Hello' });
console.log(text);
// Bradie-only client
const bradieKit: AgentKit = createBradieKit({
domain: 'http://localhost:3000',
onSystemMessage: (msg) => console.log('[system]', msg),
onAssistantReply: (msg) => console.log('[assistant]', msg),
});
await bradieKit.generate({ prompt: 'Hello' });
// Multi-provider client
const multiKit = createMultiProviderKit();
multiKit.addProvider(new OllamaAdapter('http://localhost:11434'));
multiKit.addProvider(new BradieAdapter({
domain: 'http://localhost:3000',
onSystemMessage: console.log,
onAssistantReply: console.log
}));
const reply = await multiKit.generate({ model: 'mistral', prompt: 'Hello' });
console.log(reply);
Both adapters support a streaming mode that invokes a callback for each data chunk.
await ollamaKit.generate(
{ model: 'mistral', prompt: 'Hello', stream: true },
(chunk) => console.log('Ollama chunk:', chunk)
);
await bradieKit.generate(
{ model: 'mistral', prompt: 'Hello', stream: true },
(chunk) => console.log('Bradie chunk:', chunk)
);
.generate(input: GenerateInput, options?: StreamingOptions): Promise<string | void>
.listProviders(): string[]
.setProvider(name: string): void
.getCurrentProvider(): AgentProvider | undefined
interface GenerateInput {
model?: string; // For services that support named models
prompt: string; // The text prompt
stream?: boolean; // If true, use streaming mode
}
interface StreamingOptions {
onChunk?: (chunk: string) => void;
onStateChange?: (state: string) => void;
onError?: (error: Error) => void;
}
Contributions are welcome! Please submit issues and pull requests on GitHub.
© Hyperweb (formerly Cosmology). See LICENSE for full licensing and disclaimer.
FAQs
Agentic Kit
We found that agentic-kit 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.
Did you know?
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.
Product
Socket’s new Pull Request Stories give security teams clear visibility into dependency risks and outcomes across scanned pull requests.
Research
/Security News
npm author Qix’s account was compromised, with malicious versions of popular packages like chalk-template, color-convert, and strip-ansi published.
Research
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.