Model Providers & Fallbacks
Kikoyu SDK is model-provider agnostic. Out of the box, it provides first-class, zero-dependency model adapters for OpenAI, Anthropic (Claude), Google Gemini, as well as a resilient FallbackProvider for automatic failover during cloud API outages.
1. OpenAI Provider (OpenAIProvider)
OpenAIProvider supports all OpenAI chat completion models, including gpt-4o, gpt-4o-mini, gpt-4-turbo, and fine-tuned models.
Step-by-Step Setup
2. Anthropic Claude Provider (AnthropicProvider)
AnthropicProvider supports Claude 3.5 Sonnet, Claude 3 Opus, and Claude 3 Haiku models via Anthropic’s Messages API.
Step-by-Step Setup
3. Google Gemini Provider (GeminiProvider)
GeminiProvider supports Google Gemini 1.5 Pro and Gemini 1.5 Flash models.
Step-by-Step Setup
4. Resilient Fallback Provider (FallbackProvider)
In production, primary AI APIs (e.g. OpenAI or Anthropic) can experience rate limits (HTTP 429), server overloads (HTTP 503), or unexpected outages.
FallbackProvider wraps a primary provider and one or more backup providers. If the primary model fails or times out, Kikoyu SDK automatically retries execution against backup models seamlessly.
Resilient Fallback Setup
Provider Configuration Reference
| Parameter | Type | Default | Description |
|---|---|---|---|
apiKey | string | Environment Variable | API key string for model service authorization. |
model | string | Provider default | Exact model string identifier (e.g. gpt-4o-mini, claude-3-5-sonnet-20240620). |
temperature | number | 0.7 | Sampling temperature between 0.0 (deterministic) and 2.0 (creative). |
maxTokens | number | Provider default | Maximum output completion tokens allowed. |