LLM Providers Overview
AgentForge's provider-agnostic LLM layer — swap providers without changing agent code.
Provider-Agnostic Design
AgentForge treats the LLM as a swappable dependency. Your agent code never references a specific provider — you configure it once and the framework handles the rest.
Supported providers:
| Provider | Models | Streaming |
|---|---|---|
| Anthropic | Claude Opus, Sonnet, Haiku | Yes |
| OpenAI | GPT-4o, GPT-4, GPT-3.5 | Yes |
| Google Gemini | Gemini Pro, Flash | Yes |
| Ollama | Any local model | Yes |
Quick Start
import { createLLM } from '@ahzan-agentforge/core';
const llm = createLLM({
provider: 'anthropic',
model: 'claude-sonnet-4-20250514',
});Switch providers by changing the config — no agent code changes needed:
const llm = createLLM({
provider: 'openai',
model: 'gpt-4o',
});LLM Interface
All providers implement the same interface:
interface LLM {
chat(request: ChatRequest): Promise<ChatResponse>;
}
interface StreamingLLM extends LLM {
chatStream(request: ChatRequest): AsyncGenerator<ChatStreamEvent>;
}