litellmts-core 1.0.0 → 1.0.1
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 +17 -28
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,7 +1,3 @@
|
|
|
1
|
-
<p align="center">
|
|
2
|
-
<img src="https://raw.githubusercontent.com/madkoding/litellmTS/main/.github/banner.png" alt="LiteLLM.ts" width="600"/>
|
|
3
|
-
</p>
|
|
4
|
-
|
|
5
1
|
<p align="center">
|
|
6
2
|
<strong>Unified TypeScript interface for 45+ LLM providers</strong><br>
|
|
7
3
|
One API. Every model. Zero boilerplate.
|
|
@@ -11,46 +7,39 @@
|
|
|
11
7
|
<a href="https://github.com/madkoding/litellmTS/blob/main/LICENSE">
|
|
12
8
|
<img src="https://img.shields.io/badge/license-GPLv3-blue.svg" alt="License"/>
|
|
13
9
|
</a>
|
|
14
|
-
<a href="https://
|
|
15
|
-
<img src="https://img.shields.io/
|
|
10
|
+
<a href="https://www.npmjs.com/package/litellmts-core">
|
|
11
|
+
<img src="https://img.shields.io/npm/v/litellmts-core" alt="npm"/>
|
|
16
12
|
</a>
|
|
17
13
|
<a href="https://nodejs.org/">
|
|
18
14
|
<img src="https://img.shields.io/badge/node-%3E%3D22-brightgreen" alt="Node"/>
|
|
19
15
|
</a>
|
|
16
|
+
<a href="https://github.com/madkoding/litellmTS/actions">
|
|
17
|
+
<img src="https://img.shields.io/github/actions/workflow/status/madkoding/litellmTS/ci.yml" alt="CI"/>
|
|
18
|
+
</a>
|
|
20
19
|
</p>
|
|
21
20
|
|
|
22
21
|
---
|
|
23
22
|
|
|
24
23
|
## Installation
|
|
25
24
|
|
|
26
|
-
|
|
25
|
+
```bash
|
|
26
|
+
npm install litellmts-core
|
|
27
|
+
```
|
|
27
28
|
|
|
28
|
-
|
|
29
|
+
### From GitHub (alternative)
|
|
29
30
|
|
|
30
31
|
```json
|
|
31
32
|
{
|
|
32
33
|
"dependencies": {
|
|
33
|
-
"
|
|
34
|
+
"litellmts-core": "github:madkoding/litellmTS"
|
|
34
35
|
}
|
|
35
36
|
}
|
|
36
37
|
```
|
|
37
38
|
|
|
38
|
-
Then install:
|
|
39
|
-
|
|
40
|
-
```bash
|
|
41
|
-
npm install
|
|
42
|
-
```
|
|
43
|
-
|
|
44
|
-
### Alternative — npm (when published)
|
|
45
|
-
|
|
46
|
-
```bash
|
|
47
|
-
npm install @litellmts/core
|
|
48
|
-
```
|
|
49
|
-
|
|
50
39
|
## Quick Start
|
|
51
40
|
|
|
52
41
|
```ts
|
|
53
|
-
import { completion } from '
|
|
42
|
+
import { completion } from 'litellmts-core';
|
|
54
43
|
|
|
55
44
|
const response = await completion({
|
|
56
45
|
model: 'gpt-4o-mini',
|
|
@@ -85,7 +74,7 @@ await completion({ model: 'deepseek/deepseek-chat', ... });
|
|
|
85
74
|
### Non-streaming
|
|
86
75
|
|
|
87
76
|
```ts
|
|
88
|
-
import { completion } from '
|
|
77
|
+
import { completion } from 'litellmts-core';
|
|
89
78
|
|
|
90
79
|
const response = await completion({
|
|
91
80
|
model: 'gpt-4o-mini',
|
|
@@ -120,7 +109,7 @@ for await (const chunk of stream) {
|
|
|
120
109
|
### Embeddings
|
|
121
110
|
|
|
122
111
|
```ts
|
|
123
|
-
import { embedding } from '
|
|
112
|
+
import { embedding } from 'litellmts-core';
|
|
124
113
|
|
|
125
114
|
const result = await embedding({
|
|
126
115
|
model: 'text-embedding-3-small',
|
|
@@ -229,10 +218,10 @@ npx litellm login anthropic
|
|
|
229
218
|
└──────────────┘ └──────────────┘ └─────────────────┘
|
|
230
219
|
│
|
|
231
220
|
┌──────┴──────┐
|
|
232
|
-
│
|
|
233
|
-
│ groq/ →
|
|
234
|
-
│ claude- →
|
|
235
|
-
│ gpt- →
|
|
221
|
+
│ Registry │
|
|
222
|
+
│ groq/ → . │
|
|
223
|
+
│ claude- → │
|
|
224
|
+
│ gpt- → .. │
|
|
236
225
|
└─────────────┘
|
|
237
226
|
```
|
|
238
227
|
|