Providers
AI-Suite supports multiple AI providers through a unified interface. This document details each supported provider and its implementation.
Provider Architecture
Each provider in AI-Suite follows a common interface defined in the base provider class. This ensures a consistent API while allowing for provider-specific implementations.
All providers implement the following methods:
createChatCompletion: Send a chat completion request to the provider- Provider-specific parameter mapping and error handling
Supported Providers
OpenAI
Module: ./src/providers/openai/ (OpenAI provider directory)
OpenAI integration supports models like GPT-3.5 and GPT-4. The provider maps AI-Suite’s unified message format to OpenAI’s API format.
Supported Models
gpt-3.5-turbogpt-4gpt-4-turbo- And other OpenAI chat models
Usage Example
const response = await aiSuite.createChatCompletion(
'openai/gpt-4o',
[{ role: 'user', content: 'Hello, world!' }]
);
if (response.success) {
console.log(response.content);
}
Special Features
- Reasoning modes: o1/o3 models support reasoning effort configuration
- Service Tier: supports
flex,scale,priority, anddefaultvia theserviceTieroption (see Service Tier)
Anthropic
Module: ./src/providers/anthropic/ (Anthropic provider directory)
Anthropic integration supports Claude models. The provider handles the conversion between AI-Suite’s message format and Anthropic’s API format.
Supported Models
claude-3-opusclaude-3-sonnetclaude-3-haiku- And other Claude models
Usage Example
const response = await aiSuite.createChatCompletion(
'anthropic/claude-3-5-sonnet-20241022',
[{ role: 'user', content: 'Hello, world!' }]
);
if (response.success) {
console.log(response.content);
}
Special Features
- Extended context & vision: large context windows and image inputs
- Service Tier: the shared tiers map to Anthropic’s opt-in/opt-out semantics —
priority→auto(use Priority Tier when available) andstandard→standard_only; other values are ignored (see Service Tier)
Google Gemini
Module: ./src/providers/gemini/ (Gemini provider directory)
Google Gemini integration supports Gemini models. The provider maps between AI-Suite’s message format and Gemini’s API requirements.
Supported Models
gemini-2.5-progemini-2.5-flashgemini-2.5-flash-litegemini-2.0-flashgemini-2.0-flash-litegemini-1.5-flashgemini-1.5-flash-8bgemini-1.5-pro
Special Features
- Thinking Budget: Gemini 2.5 models support thinking budget configuration for extended reasoning
- JSON Schema: Native support for structured JSON output via Zod schemas
- Service Tier: supports
flex,standard, andpriorityvia theserviceTieroption (standardis Gemini-only); see Service Tier
Usage Example
const response = await aiSuite.createChatCompletion(
'gemini/gemini-2.5-pro',
[{ role: 'user', content: 'Hello, world!' }],
{
thinking: {
budget: 256, // Thinking budget (only for gemini-2.5-pro)
output: true // Include thinking in output
}
}
);
if (response.success) {
console.log(response.content);
}
DeepSeek
Module: ./src/providers/deepseek/ (DeepSeek provider directory)
DeepSeek integration supports DeepSeek AI models. The provider handles mapping between AI-Suite’s format and DeepSeek’s API.
Supported Models
deepseek-chatdeepseek-coderdeepseek-coder-plus
Usage Example
const response = await aiSuite.createChatCompletion(
'deepseek/deepseek-chat',
[{ role: 'user', content: 'Hello, world!' }]
);
if (response.success) {
console.log(response.content);
}
Grok
Module: ./src/providers/grok/ (Grok provider directory)
Grok integration supports Grok models from xAI. The provider extends OpenAI provider as Grok uses OpenAI-compatible API.
Supported Models
grok-3grok-3-minigrok-3-fastgrok-3-mini-fast
Special Features
- Reasoning Effort: Grok models support reasoning effort configuration (low, medium, high)
Usage Example
const response = await aiSuite.createChatCompletion(
'grok/grok-3',
[{ role: 'user', content: 'Explain quantum entanglement.' }],
{
reasoning: {
effort: 'high' // Use extended reasoning
}
}
);
if (response.success) {
console.log(response.content);
}
Custom LLM
Module: ./src/providers/customLLM/ (Custom LLM provider directory)
Custom LLM provider allows you to use any OpenAI-compatible API endpoint. This is useful for:
- Self-hosted LLMs (Ollama, LM Studio, vLLM, etc.)
- Third-party OpenAI-compatible APIs
- Custom inference endpoints
Usage Example
const aiSuite = new AISuite({
customURL: 'http://localhost:11434/v1', // Example: Ollama endpoint
customLLMKey: 'optional-api-key' // Some endpoints don't need auth
});
const response = await aiSuite.createChatCompletion(
'custom-llm/llama3.2', // Model name from your custom endpoint
[{ role: 'user', content: 'Hello, world!' }]
);
if (response.success) {
console.log(response.content);
}
Service Tier
Some providers let you pick a processing tier that balances availability, latency, and cost. AI-Suite exposes this through a single serviceTier option, using a cross-provider superset of values. Each provider maps the values it understands and silently ignores the rest.
Requested serviceTier |
OpenAI (+ DeepSeek/Grok/Custom) | Gemini | Anthropic |
|---|---|---|---|
flex |
flex |
flex |
ignored |
scale |
scale |
ignored | ignored |
priority |
priority |
priority |
auto |
default |
default |
ignored | ignored |
standard |
ignored | standard |
standard_only |
Notes:
- Anthropic doesn’t select a named tier — it opts in/out of Priority Tier.
prioritymaps toauto(use Priority Tier when available) andstandardmaps tostandard_only. - DeepSeek / Grok / Custom LLM reuse the OpenAI path, so the value is forwarded the same way; whether the endpoint honors it depends on the endpoint (
✓*in the README table). - Works across chat (streaming and non-streaming) and batch requests.
The response echoes the tier the provider actually applied on response.service_tier (and on the final stream chunk), which may differ from the requested one — e.g. a downgrade to standard when priority capacity isn’t available.
const response = await aiSuite.createChatCompletion(
'openai/gpt-4o',
[{ role: 'user', content: 'Summarize this document...' }],
{ serviceTier: 'flex' } // latency-tolerant, lower-cost tier
);
if (response.success) {
console.log(response.service_tier); // tier actually applied, e.g. 'flex' or 'default'
}
Adding Custom Providers
To add a new provider to AI-Suite, you need to:
- Create a new provider class that extends the base provider interface
- Implement the required methods for the provider
- Add the provider to the ProviderModel type
- Update the getProvider method in the AISuite class
Example implementation skeleton:
import { ProviderBase, ChatOptions } from './_base';
import { MessageModel, SuccessChatCompletion, ErrorChatCompletion } from '../types/chat';
export type CustomModels = 'model-1' | 'model-2';
export class CustomProvider extends ProviderBase {
constructor(apiKey: string, model: string, hooks?: any) {
super();
// Initialize your provider client
}
async _createChatCompletion(
messages: MessageModel[],
options: ChatOptions
): Promise<SuccessChatCompletion> {
// Implement custom provider logic here
// Return SuccessChatCompletion object
}
handleError(error: Error): Pick<ErrorChatCompletion, 'error' | 'raw' | 'tag'> {
// Implement error handling
return {
error: error.message,
raw: error,
tag: 'Unknown'
};
}
}