AgentForge

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:

ProviderModelsStreaming
AnthropicClaude Opus, Sonnet, HaikuYes
OpenAIGPT-4o, GPT-4, GPT-3.5Yes
Google GeminiGemini Pro, FlashYes
OllamaAny local modelYes

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>;
}

Next Steps