@cubos/ai-suite 1.0.2381403943-5.dev → 1.0.2381712330-0.dev
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +50 -28
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,29 +1,41 @@
|
|
|
1
1
|
# AI-Suite
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
<p align="center">
|
|
4
|
+
<a href="https://www.npmjs.com/package/@cubos/ai-suite"><img src="https://img.shields.io/npm/v/@cubos/ai-suite?style=flat-square&color=4f46e5" alt="npm version" /></a>
|
|
5
|
+
<a href="https://www.npmjs.com/package/@cubos/ai-suite"><img src="https://img.shields.io/npm/dm/@cubos/ai-suite?style=flat-square&color=4f46e5" alt="npm downloads" /></a>
|
|
6
|
+
<a href="https://github.com/cubos/ai-suite/actions"><img src="https://img.shields.io/github/actions/workflow/status/cubos/ai-suite/ci.yml?style=flat-square&color=4f46e5" alt="CI" /></a>
|
|
7
|
+
<a href="https://cubos.github.io/ai-suite/"><img src="https://img.shields.io/badge/docs-online-4f46e5?style=flat-square" alt="docs" /></a>
|
|
8
|
+
<a href="https://github.com/cubos/ai-suite/blob/main/LICENSE"><img src="https://img.shields.io/npm/l/@cubos/ai-suite?style=flat-square&color=4f46e5" alt="license" /></a>
|
|
9
|
+
</p>
|
|
10
|
+
|
|
11
|
+
<p align="center">
|
|
12
|
+
All AI providers in one place — a unified TypeScript interface for OpenAI, Anthropic, Gemini, DeepSeek, Grok, and any OpenAI-compatible API.
|
|
13
|
+
</p>
|
|
14
|
+
|
|
15
|
+
---
|
|
4
16
|
|
|
5
17
|
## Features
|
|
6
18
|
|
|
7
|
-
- **Unified API**
|
|
8
|
-
- **
|
|
9
|
-
- **
|
|
10
|
-
- **
|
|
11
|
-
- **
|
|
12
|
-
- **
|
|
13
|
-
- **
|
|
14
|
-
- **
|
|
15
|
-
- **
|
|
16
|
-
- **
|
|
17
|
-
- **
|
|
19
|
+
- **Unified API** — same interface across all providers, swap models with a one-line change
|
|
20
|
+
- **Multimodal** — images, PDFs and files supported where available
|
|
21
|
+
- **Structured Output** — JSON Schema via Zod, validated and typed
|
|
22
|
+
- **Tool / Function Calling** — consistent across all compatible providers
|
|
23
|
+
- **Reasoning & Thinking** — reasoning and thinking modes for supported models
|
|
24
|
+
- **Batch Processing** — async batch jobs for OpenAI, Anthropic and Gemini
|
|
25
|
+
- **File Upload** — upload `.jsonl` files for batch inputs
|
|
26
|
+
- **Retry Logic** — built-in exponential backoff
|
|
27
|
+
- **Hooks** — intercept every request and response globally
|
|
28
|
+
- **Langfuse** — built-in tracing and monitoring integration
|
|
29
|
+
- **TypeScript-first** — full type safety with discriminated unions
|
|
18
30
|
|
|
19
31
|
## Installation
|
|
20
32
|
|
|
21
33
|
```bash
|
|
22
34
|
npm install @cubos/ai-suite
|
|
23
35
|
# or
|
|
24
|
-
yarn add @cubos/ai-suite
|
|
25
|
-
# or
|
|
26
36
|
pnpm add @cubos/ai-suite
|
|
37
|
+
# or
|
|
38
|
+
yarn add @cubos/ai-suite
|
|
27
39
|
```
|
|
28
40
|
|
|
29
41
|
## Quick Start
|
|
@@ -31,38 +43,48 @@ pnpm add @cubos/ai-suite
|
|
|
31
43
|
```typescript
|
|
32
44
|
import { AISuite } from '@cubos/ai-suite';
|
|
33
45
|
|
|
34
|
-
// Initialize with API keys
|
|
35
46
|
const aiSuite = new AISuite({
|
|
36
47
|
openaiKey: process.env.OPENAI_API_KEY,
|
|
37
48
|
anthropicKey: process.env.ANTHROPIC_API_KEY,
|
|
38
49
|
geminiKey: process.env.GEMINI_API_KEY,
|
|
39
50
|
deepseekKey: process.env.DEEPSEEK_API_KEY,
|
|
40
51
|
grokKey: process.env.GROK_API_KEY,
|
|
41
|
-
// Optional: for custom LLM providers
|
|
42
|
-
customURL: process.env.CUSTOM_LLM_URL,
|
|
43
|
-
customLLMKey: process.env.CUSTOM_LLM_KEY
|
|
44
52
|
});
|
|
45
53
|
|
|
46
|
-
// Single provider chat completion
|
|
47
54
|
const response = await aiSuite.createChatCompletion(
|
|
48
55
|
'openai/gpt-4o',
|
|
49
56
|
[{ role: 'user', content: 'Hello, world!' }],
|
|
50
|
-
{ responseFormat: 'text' }
|
|
51
57
|
);
|
|
52
58
|
|
|
53
59
|
if (response.success) {
|
|
54
60
|
console.log(response.content);
|
|
55
|
-
} else {
|
|
56
|
-
console.error('Error:', response.error);
|
|
57
61
|
}
|
|
58
62
|
```
|
|
59
63
|
|
|
60
64
|
## Supported Providers
|
|
61
65
|
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
66
|
+
| Provider | Chat | Embeddings | Batch | Files |
|
|
67
|
+
|----------|:----:|:----------:|:-----:|:-----:|
|
|
68
|
+
| **OpenAI** | ✓ | ✓ | ✓ | ✓ |
|
|
69
|
+
| **Anthropic** | ✓ | — | ✓ | ✓ |
|
|
70
|
+
| **Google Gemini** | ✓ | ✓ | ✓ | ✓ |
|
|
71
|
+
| **DeepSeek** | ✓ | ✓ | — | — |
|
|
72
|
+
| **Grok** | ✓ | — | — | — |
|
|
73
|
+
| **Custom LLM** | ✓ | ✓ | — | — |
|
|
74
|
+
|
|
75
|
+
## Documentation
|
|
76
|
+
|
|
77
|
+
Full documentation, guides and API reference at **[cubos.github.io/ai-suite](https://cubos.github.io/ai-suite/)**.
|
|
78
|
+
|
|
79
|
+
- [Getting Started](https://cubos.github.io/ai-suite/getting-started/)
|
|
80
|
+
- [Providers](https://cubos.github.io/ai-suite/providers/)
|
|
81
|
+
- [API Reference](https://cubos.github.io/ai-suite/api-reference/)
|
|
82
|
+
- [Advanced Usage](https://cubos.github.io/ai-suite/advanced-usage/)
|
|
83
|
+
- [Batch](https://cubos.github.io/ai-suite/usage-batch/)
|
|
84
|
+
- [File Upload](https://cubos.github.io/ai-suite/usage-file-upload/)
|
|
85
|
+
|
|
86
|
+
## Contributors
|
|
68
87
|
|
|
88
|
+
<a href="https://github.com/cubos/ai-suite/graphs/contributors">
|
|
89
|
+
<img src="https://contrib.rocks/image?repo=cubos/ai-suite" alt="contributors" />
|
|
90
|
+
</a>
|