langtrain 0.1.13 → 0.1.15
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 +87 -20
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,32 +1,42 @@
|
|
|
1
|
-
<
|
|
2
|
-
<p align="center"><strong>Langtrain CLI</strong> is a unified AI engineering platform that runs locally on your computer and connects to the Langtrain Cloud.
|
|
3
|
-
<p align="center">
|
|
1
|
+
<div align="center">
|
|
4
2
|
<picture>
|
|
5
3
|
<source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/langtrain-ai/langtrain-sdk/main/public/langtrain-white.svg">
|
|
6
4
|
<source media="(prefers-color-scheme: light)" srcset="https://raw.githubusercontent.com/langtrain-ai/langtrain-sdk/main/public/langtrain-black.svg">
|
|
7
|
-
<img alt="Langtrain Logo" src="https://raw.githubusercontent.com/langtrain-ai/langtrain-sdk/main/public/langtrain-black.svg" width="
|
|
5
|
+
<img alt="Langtrain Logo" src="https://raw.githubusercontent.com/langtrain-ai/langtrain-sdk/main/public/langtrain-black.svg" width="250">
|
|
8
6
|
</picture>
|
|
9
|
-
</
|
|
10
|
-
<
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
<
|
|
14
|
-
|
|
7
|
+
<h3>Langtrain SDK</h3>
|
|
8
|
+
<p>The unified intelligence layer for JavaScript applications.</p>
|
|
9
|
+
|
|
10
|
+
<p>
|
|
11
|
+
<a href="https://www.npmjs.com/package/langtrain"><img src="https://img.shields.io/npm/v/langtrain?style=flat-square&labelColor=18181b&color=22c55e" alt="npm version" /></a>
|
|
12
|
+
<a href="https://www.npmjs.com/package/langtrain"><img src="https://img.shields.io/npm/dm/langtrain?style=flat-square&labelColor=18181b&color=3b82f6" alt="npm downloads" /></a>
|
|
13
|
+
<a href="https://langtrain.ai"><img src="https://img.shields.io/badge/website-langtrain.ai-18181b?style=flat-square&labelColor=18181b" alt="website" /></a>
|
|
14
|
+
<a href="https://docs.langtrain.ai"><img src="https://img.shields.io/badge/docs-documentation-18181b?style=flat-square&labelColor=18181b" alt="documentation" /></a>
|
|
15
|
+
<a href="https://github.com/langtrain-ai/langtrain-sdk/blob/main/LICENSE"><img src="https://img.shields.io/npm/l/langtrain?style=flat-square&labelColor=18181b&color=3b82f6" alt="license" /></a>
|
|
16
|
+
</p>
|
|
17
|
+
|
|
18
|
+
<br/>
|
|
19
|
+
|
|
20
|
+
<p align="center"><code>npm i -g langtrain</code></p>
|
|
21
|
+
<p><strong>Langtrain CLI</strong> is a unified AI engineering platform that runs locally on your computer and connects to the Langtrain Cloud.</p>
|
|
22
|
+
|
|
23
|
+
<p>
|
|
24
|
+
If you want Langtrain in your code editor, <a href="https://langtrain.ai/docs/vscode">install the VS Code Extension.</a><br/>
|
|
25
|
+
If you are looking for the <em>web-based platform</em>, <strong>Langtrain Web</strong>, go to <a href="https://langtrain.ai">langtrain.ai</a>.
|
|
26
|
+
</p>
|
|
27
|
+
</div>
|
|
15
28
|
|
|
16
29
|
---
|
|
17
30
|
|
|
18
|
-
## Quickstart
|
|
19
|
-
|
|
20
|
-
### Installing and running Langtrain CLI
|
|
31
|
+
## 🚀 Quickstart (CLI)
|
|
21
32
|
|
|
22
33
|
Install globally with npm:
|
|
23
34
|
|
|
24
35
|
```shell
|
|
25
|
-
# Install using npm
|
|
26
36
|
npm install -g langtrain
|
|
27
37
|
```
|
|
28
38
|
|
|
29
|
-
Then
|
|
39
|
+
Then run `langtrain` to start the interactive AI engineering studio:
|
|
30
40
|
|
|
31
41
|
```shell
|
|
32
42
|
langtrain
|
|
@@ -45,25 +55,82 @@ sudo npm install -g langtrain
|
|
|
45
55
|
|
|
46
56
|
Run `langtrain login` and enter your API Key from the dashboard to authenticate. We recommend signing into your Langtrain account to use **Cloud Finetuning**, **Agent Persistence**, and **Model Hosting** as part of your Pro or Enterprise plan. [Learn more about Langtrain Plans](https://langtrain.ai/pricing).
|
|
47
57
|
|
|
48
|
-
|
|
49
|
-
|
|
58
|
+
Check your subscription status and limits:
|
|
50
59
|
```shell
|
|
51
60
|
langtrain status
|
|
52
61
|
```
|
|
62
|
+
*Free plans allow local fine-tuning. Upgrade to Pro for cloud-based GPU training.*
|
|
63
|
+
|
|
64
|
+
---
|
|
65
|
+
|
|
66
|
+
## 📦 SDK Usage
|
|
53
67
|
|
|
54
|
-
|
|
68
|
+
You can also use `langtrain` as a library in your Node.js applications to build intelligent agents and workflows.
|
|
55
69
|
|
|
56
|
-
|
|
70
|
+
```typescript
|
|
71
|
+
import { Langvision, Langtune, SubscriptionClient } from 'langtrain';
|
|
72
|
+
|
|
73
|
+
// 1. Initialize Clients
|
|
74
|
+
const vision = new Langvision({ apiKey: process.env.LANGTRAIN_API_KEY });
|
|
75
|
+
const tune = new Langtune({ apiKey: process.env.LANGTRAIN_API_KEY });
|
|
76
|
+
|
|
77
|
+
async function analyzeAndTune() {
|
|
78
|
+
// Analyze visual user context
|
|
79
|
+
const context = await vision.analyze({
|
|
80
|
+
image: './dashboard.jpg',
|
|
81
|
+
features: ['layout', 'text']
|
|
82
|
+
});
|
|
83
|
+
|
|
84
|
+
console.log('Visual Context:', context);
|
|
85
|
+
|
|
86
|
+
// Generate optimized response
|
|
87
|
+
const response = await tune.generate({
|
|
88
|
+
model: 'gpt-4-vision-optimized',
|
|
89
|
+
prompt: `Explain this dashboard layout: ${context.description}`
|
|
90
|
+
});
|
|
91
|
+
|
|
92
|
+
console.log(response);
|
|
93
|
+
}
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
## ✨ Features
|
|
57
97
|
|
|
58
98
|
- **🤖 AI Agents**: Create, manage, and chat with custom AI agents hosted on Langtrain Server.
|
|
59
99
|
- **🧠 Langtune**: Fine-tune LLMs (Llama 3, Mistral) locally or on the cloud.
|
|
60
100
|
- **👁️ Langvision**: Optimize and fine-tune multimodal vision models.
|
|
61
101
|
- **☁️ Data Persistence**: Automatically sync datasets and training jobs with your workspace.
|
|
102
|
+
- **📊 Subscription Management**: Verify plan limits and feature access programmatically.
|
|
103
|
+
|
|
104
|
+
## ⚙️ Configuration
|
|
105
|
+
|
|
106
|
+
The SDK and CLI can be configured using environment variables `(dotenv supported)` or via `langtrain login`.
|
|
62
107
|
|
|
63
|
-
|
|
108
|
+
| Variable | Description |
|
|
109
|
+
| :--- | :--- |
|
|
110
|
+
| `LANGTRAIN_API_KEY` | Your project API Key (get it from the dashboard). |
|
|
111
|
+
| `LANGTRAIN_WORKSPACE_ID` | (Optional) Workspace ID for specific environment interaction. |
|
|
112
|
+
|
|
113
|
+
```typescript
|
|
114
|
+
// Example: Manually passing config
|
|
115
|
+
const client = new Langvision({
|
|
116
|
+
apiKey: "lt_sk_...",
|
|
117
|
+
workspaceId: "ws_..."
|
|
118
|
+
});
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
## 🤝 Community & Support
|
|
122
|
+
|
|
123
|
+
- **[GitHub Discussions](https://github.com/langtrain-ai/langtrain-sdk/discussions)**: Ask questions and share ideas.
|
|
124
|
+
- **[Twitter](https://twitter.com/langtrain_ai)**: Follow for updates and announcements.
|
|
125
|
+
- **[Email](mailto:support@langtrain.ai)**: Contact us for enterprise support.
|
|
126
|
+
|
|
127
|
+
## 📚 Documentation
|
|
64
128
|
|
|
65
129
|
- [**Langtrain Documentation**](https://docs.langtrain.ai)
|
|
66
130
|
- [**SDK Reference**](https://docs.langtrain.ai/sdk)
|
|
67
131
|
- [**Contributing**](./CONTRIBUTING.md)
|
|
68
132
|
|
|
133
|
+
## 📄 License
|
|
134
|
+
|
|
69
135
|
This repository is licensed under the [MIT License](LICENSE).
|
|
136
|
+
copyright © [Langtrain](https://langtrain.xyz)
|