Skip to content

cubos/ai-suite

Repository files navigation

AI-Suite

npm version npm downloads CI docs license

All AI providers in one place — a unified TypeScript interface for OpenAI, Anthropic, Gemini, DeepSeek, Grok, and any OpenAI-compatible API.


Features

  • Unified API — same interface across all providers, swap models with a one-line change
  • Multimodal — images, PDFs and files supported where available
  • Structured Output — JSON Schema via Zod, validated and typed
  • Tool / Function Calling — consistent across all compatible providers
  • Reasoning & Thinking — reasoning and thinking modes for supported models
  • Batch Processing — async batch jobs for OpenAI, Anthropic and Gemini
  • File Upload — upload .jsonl files for batch inputs
  • Retry Logic — built-in exponential backoff
  • Hooks — intercept every request and response globally
  • Langfuse — built-in tracing and monitoring integration
  • TypeScript-first — full type safety with discriminated unions

Installation

npm install @cubos/ai-suite
# or
pnpm add @cubos/ai-suite
# or
yarn add @cubos/ai-suite

Quick Start

import { AISuite } from '@cubos/ai-suite';

const aiSuite = new AISuite({
  openaiKey: process.env.OPENAI_API_KEY,
  anthropicKey: process.env.ANTHROPIC_API_KEY,
  geminiKey: process.env.GEMINI_API_KEY,
  deepseekKey: process.env.DEEPSEEK_API_KEY,
  grokKey: process.env.GROK_API_KEY,
});

const response = await aiSuite.createChatCompletion(
  'openai/gpt-4o',
  [{ role: 'user', content: 'Hello, world!' }],
);

if (response.success) {
  console.log(response.content);
}

Supported Providers

Provider Chat Embeddings Batch Files Service Tier
OpenAI
Anthropic
Google Gemini
DeepSeek ✓*
Grok ✓*
Custom LLM ✓*

Service Tier selects a processing/priority tier via the serviceTier option. ✓* = forwarded through the OpenAI-compatible path; actual support depends on the endpoint. See Service Tier.

Documentation

Full documentation, guides and API reference at cubos.github.io/ai-suite.

Contributors

contributors

About

All AI providers in one place — a unified TypeScript interface for OpenAI, Anthropic, Gemini, DeepSeek, Grok, and any OpenAI-compatible API

Resources

Stars

5 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors