-
Notifications
You must be signed in to change notification settings - Fork 0
Provider Ecosystem
AgentBench provides a rich ecosystem of 12+ LLM provider plugins, enabling you to test AI agents built on any model, from any provider, with a uniform testing interface. All providers implement the same AgentBenchProvider interface from @agentbench/provider-utils, so your tests work identically regardless of which model powers your agent.
Read the full guide on building custom providers: Building Custom Providers
The most widely used provider. Wraps the official OpenAI SDK to intercept every API call transparently -- capturing traces, counting tokens, and calculating costs automatically. Supports all GPT models (GPT-4o, GPT-4o-mini, GPT-4.1), o-series reasoning models (o1, o3, o4-mini), streaming, function/tool calling, structured outputs, and vision.
pnpm add @agentbench/openaiimport { OpenAIProvider } from '@agentbench/openai'Wraps the Anthropic SDK for Claude models. Supports the Messages API with system + messages format, extended thinking/reasoning (Claude Opus 4, Sonnet 4), tool use with tool_use blocks, streaming, and computer use. Handles Claude-specific message format differences from the OpenAI format automatically.
pnpm add @agentbench/anthropicimport { AnthropicProvider } from '@agentbench/anthropic'Full support for Google's Gemini models (Gemini 2.5 Pro, Gemini 2.5 Flash). Handles Gemini's native API format including streaming, embeddings, vision inputs, and tool calling. Converts between Gemini's format and AgentBench's normalized trace format.
pnpm add @agentbench/geminiimport { GeminiProvider } from '@agentbench/gemini'Provider for DeepSeek models. Use deepseek-chat for DeepSeek-V3 (general-purpose chat) and deepseek-reasoner for DeepSeek-R1 (advanced reasoning). Extends OpenAICompatibleProvider with special support for reasoning models that produce reasoning_content fields and have distinct pricing for reasoning vs. output tokens.
pnpm add @agentbench/deepseekimport { DeepSeekProvider } from '@agentbench/deepseek'Provider for Azure OpenAI Service. Extends OpenAICompatibleProvider with Azure AD authentication support, resource-specific endpoint configuration, and API version management. Maps Azure's deployment-based model naming to AgentBench's unified model identifiers.
pnpm add @agentbench/azure-openaiimport { AzureOpenAIProvider } from '@agentbench/azure-openai'Provider for OpenRouter, a multi-model pass-through gateway that gives access to 200+ models from a single API endpoint. Handles OpenRouter-specific headers for model routing, fallback configuration, and provider-specific pricing. Ideal for model comparison and migration testing.
pnpm add @agentbench/openrouterimport { OpenRouterProvider } from '@agentbench/openrouter'Provider for Groq's ultra-fast inference platform. Extends OpenAICompatibleProvider to handle Groq's low-latency API characteristics. Great for testing agents that require rapid iteration or have strict latency SLAs. Supports Llama, Mixtral, and Gemma models hosted on Groq's hardware.
pnpm add @agentbench/groqimport { GroqProvider } from '@agentbench/groq'Provider for Ollama, the local LLM runner. Auto-detects running Ollama instances, enumerates available models, and handles Ollama's streaming format. Enables completely free, local agent testing with no API keys and no network dependency. Ideal for offline development and privacy-sensitive workflows.
pnpm add @agentbench/ollamaimport { OllamaProvider } from '@agentbench/ollama'In addition to providers, AgentBench ships adapter packages for popular agent frameworks:
| Package | Description |
|---|---|
@agentbench/adapter |
Generic adapter -- wrap any agent framework for automatic tracing |
@agentbench/langgraph |
Trace and evaluate LangGraph agents with state graph awareness |
@agentbench/mcp |
MCP (Model Context Protocol) -- automatic tool call tracing |
You can add support for any LLM API by implementing the AgentBenchProvider interface. There are two approaches:
If your API speaks the OpenAI Chat Completions format, you only need to override 3 methods:
-
getBaseURL()-- Return your API's base URL -
getDefaultHeaders()-- Return authentication and custom headers -
getProviderId()-- Return a unique provider identifier string
import { OpenAICompatibleProvider } from '@agentbench/provider-utils'
export class MyCustomProvider extends OpenAICompatibleProvider {
getBaseURL(): string {
return 'https://api.myprovider.com/v1'
}
getDefaultHeaders(): Record<string, string> {
return {
'Authorization': `Bearer ${this.apiKey}`,
'X-Custom-Header': 'value',
}
}
getProviderId(): string {
return 'my-provider'
}
}For APIs with completely different formats (like Anthropic), implement all methods of the AgentBenchProvider interface directly:
interface AgentBenchProvider {
// Identity
getProviderId(): string
getProviderName(): string
// Core LLM interaction
createChatCompletion(params: ChatCompletionParams): Promise<ChatCompletionResponse>
createChatCompletionStream(params: ChatCompletionParams): AsyncIterable<ChatCompletionChunk>
// Token counting and cost
countTokens(messages: Message[], model: string): Promise<number>
calculateCost(model: string, promptTokens: number, completionTokens: number): CostBreakdown
// Health and metadata
healthCheck(): Promise<HealthStatus>
listModels(): Promise<ModelInfo[]>
}Read the complete tutorial: Building Custom Providers
The @agentbench/provider-utils package provides the shared foundation for all providers:
-
AgentBenchProviderinterface -- the contract every provider implements -
OpenAICompatibleProviderbase class -- for any OpenAI-format API - Token counting utilities (tiktoken-based for OpenAI models, character-based fallback)
- Cost calculation helpers with per-model pricing tables
- SSE streaming parser for OpenAI-compatible streaming endpoints
- Provider registration and auto-discovery
pnpm add @agentbench/provider-utils| Your Situation | Recommended Provider |
|---|---|
| Using OpenAI GPT models | @agentbench/openai |
| Using Anthropic Claude models | @agentbench/anthropic |
| Using Google Gemini | @agentbench/gemini |
| Using DeepSeek models | @agentbench/deepseek |
| Using Azure-hosted OpenAI | @agentbench/azure-openai |
| Comparing many models via a gateway | @agentbench/openrouter |
| Need ultra-fast inference | @agentbench/groq |
| Want free, local, offline testing | @agentbench/ollama |
| Using a provider not listed above | Build a custom provider |
Related pages: Guides | Core-Concepts | Config-Reference | Examples
AgentBench v0.3.0 · GitHub · Report Issue · Changelog
- Core-Concepts
- Replay & Snapshots
- Assertions & Evaluation
- Coverage & Non-Determinism
- Guides
- Testing OpenAI / Anthropic
- CI/CD Integration
- Custom-Providers
- Migration-Guide
- Cookbook
- Prompt Regressions
- Model Migration
- Cost Budgets
- Safety Testing
- A/B Testing