langtrain 0.1.1 → 0.1.3
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 +41 -45
- package/package.json +5 -1
package/README.md
CHANGED
|
@@ -1,70 +1,66 @@
|
|
|
1
1
|
<div align="center">
|
|
2
|
-
<img src="logo.svg" alt="Langtrain Logo" width="
|
|
2
|
+
<img src="https://raw.githubusercontent.com/langtrain-ai/langtrain-sdk/main/logo.svg" alt="Langtrain Logo" width="120" height="auto" />
|
|
3
3
|
<h1>Langtrain SDK</h1>
|
|
4
|
-
<p><strong>The Unified Intelligence Layer for JavaScript Applications</strong></p>
|
|
5
|
-
|
|
6
4
|
<p>
|
|
7
|
-
|
|
8
|
-
|
|
5
|
+
The unified intelligence layer for JavaScript applications. <br/>
|
|
6
|
+
Combine computer vision and LLM fine-tuning in a single, high-performance SDK.
|
|
9
7
|
</p>
|
|
10
|
-
|
|
8
|
+
|
|
11
9
|
<p>
|
|
12
|
-
<a href="https://www.npmjs.com/package/langtrain"><img src="https://img.shields.io/npm/v/langtrain?style=flat-square&color=
|
|
13
|
-
<a href="https://langtrain.ai"><img src="https://img.shields.io/badge/website-langtrain.ai-
|
|
14
|
-
<a href="https://docs.langtrain.ai"><img src="https://img.shields.io/badge/docs-documentation-
|
|
10
|
+
<a href="https://www.npmjs.com/package/langtrain"><img src="https://img.shields.io/npm/v/langtrain?style=flat-square&labelColor=231f20&color=000000" alt="npm version" /></a>
|
|
11
|
+
<a href="https://langtrain.ai"><img src="https://img.shields.io/badge/website-langtrain.ai-000000?style=flat-square&labelColor=231f20" alt="website" /></a>
|
|
12
|
+
<a href="https://docs.langtrain.ai"><img src="https://img.shields.io/badge/docs-documentation-000000?style=flat-square&labelColor=231f20" alt="documentation" /></a>
|
|
15
13
|
</p>
|
|
16
|
-
</div>
|
|
17
14
|
|
|
18
|
-
<br
|
|
15
|
+
<br/>
|
|
19
16
|
|
|
20
|
-
|
|
17
|
+
<pre>npm install langtrain</pre>
|
|
21
18
|
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
- **📦 Unified**: A single dependency for your entire AI stack.
|
|
25
|
-
- **⚡ Typescript**: First-class type support for rigorous development.
|
|
19
|
+
<br/>
|
|
20
|
+
</div>
|
|
26
21
|
|
|
27
|
-
##
|
|
22
|
+
## Overview
|
|
28
23
|
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
24
|
+
Langtrain brings the power of **Langvision** (Computer Vision) and **Langtune** (LLM Optimization) into your JavaScript/TypeScript workflow. It is designed to be the only SDK you need to build intelligent, multimodal AI applications.
|
|
25
|
+
|
|
26
|
+
## Features
|
|
32
27
|
|
|
33
|
-
|
|
28
|
+
- **Computer Vision**: Advanced image analysis, object detection, and visual reasoning.
|
|
29
|
+
- **LLM Optimization**: Fine-tune and optimize language models effortlessly.
|
|
30
|
+
- **Zero-Config Bundling**: Everything is included. No peer dependencies to manage.
|
|
31
|
+
- **Type-Safe**: Written in TypeScript for a robust development experience.
|
|
34
32
|
|
|
35
|
-
|
|
33
|
+
## Usage
|
|
36
34
|
|
|
37
35
|
```typescript
|
|
38
36
|
import { Langvision, Langtune } from 'langtrain';
|
|
39
37
|
|
|
40
|
-
// Initialize
|
|
41
|
-
const vision = new Langvision({
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
async function main() {
|
|
51
|
-
// Example: Analyze an image
|
|
52
|
-
const analysis = await vision.analyze({
|
|
53
|
-
image: 'https://example.com/image.jpg',
|
|
54
|
-
features: ['objects', 'text'],
|
|
38
|
+
// 1. Initialize Clients
|
|
39
|
+
const vision = new Langvision({ apiKey: process.env.LANGVISION_API_KEY });
|
|
40
|
+
const tune = new Langtune({ apiKey: process.env.LANGTUNE_API_KEY });
|
|
41
|
+
|
|
42
|
+
// 2. Build Intelligence
|
|
43
|
+
async function analyzeAndTune() {
|
|
44
|
+
// Analyze visual user context
|
|
45
|
+
const context = await vision.analyze({
|
|
46
|
+
image: 'https://example.com/dashboard.jpg',
|
|
47
|
+
features: ['layout', 'text']
|
|
55
48
|
});
|
|
56
|
-
|
|
57
|
-
console.log(analysis);
|
|
58
|
-
}
|
|
59
49
|
|
|
60
|
-
|
|
50
|
+
// Generate optimized response based on visual context
|
|
51
|
+
const response = await tune.generate({
|
|
52
|
+
model: 'gpt-4-vision-optimized',
|
|
53
|
+
prompt: `Explain this dashboard layout: ${context.description}`
|
|
54
|
+
});
|
|
55
|
+
|
|
56
|
+
console.log(response);
|
|
57
|
+
}
|
|
61
58
|
```
|
|
62
59
|
|
|
63
|
-
##
|
|
60
|
+
## Documentation
|
|
64
61
|
|
|
65
|
-
|
|
62
|
+
Visit [docs.langtrain.ai](https://docs.langtrain.ai) for comprehensive guides and API reference.
|
|
66
63
|
|
|
67
|
-
##
|
|
64
|
+
## License
|
|
68
65
|
|
|
69
66
|
MIT © [Langtrain AI](https://langtrain.ai)
|
|
70
|
-
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "langtrain",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.3",
|
|
4
4
|
"description": "Unified JavaScript SDK for Langtrain Ecosystem",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"module": "./dist/index.mjs",
|
|
@@ -19,6 +19,10 @@
|
|
|
19
19
|
"llm",
|
|
20
20
|
"finetuning"
|
|
21
21
|
],
|
|
22
|
+
"repository": {
|
|
23
|
+
"type": "git",
|
|
24
|
+
"url": "git+https://github.com/langtrain-ai/langtrain-sdk.git"
|
|
25
|
+
},
|
|
22
26
|
"author": "Langtrain AI",
|
|
23
27
|
"license": "MIT",
|
|
24
28
|
"devDependencies": {
|