langtrain 0.1.11 → 0.1.13
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 +54 -85
- package/dist/cli.d.mts +1 -0
- package/dist/cli.d.ts +1 -0
- package/dist/cli.js +10520 -7
- package/dist/cli.js.map +1 -1
- package/dist/cli.mjs +10531 -8
- package/dist/cli.mjs.map +1 -1
- package/dist/index.d.mts +144 -0
- package/dist/index.d.ts +144 -0
- package/dist/index.js +10405 -0
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +10402 -0
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/cli.ts +141 -7
- package/src/files.ts +53 -0
- package/src/index.ts +3 -0
- package/src/subscription.ts +45 -0
- package/src/training.ts +63 -0
package/README.md
CHANGED
|
@@ -1,100 +1,69 @@
|
|
|
1
|
-
<
|
|
1
|
+
<p align="center"><code>npm i -g langtrain</code></p>
|
|
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">
|
|
2
4
|
<picture>
|
|
3
5
|
<source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/langtrain-ai/langtrain-sdk/main/public/langtrain-white.svg">
|
|
4
6
|
<source media="(prefers-color-scheme: light)" srcset="https://raw.githubusercontent.com/langtrain-ai/langtrain-sdk/main/public/langtrain-black.svg">
|
|
5
|
-
<img alt="Langtrain Logo" src="https://raw.githubusercontent.com/langtrain-ai/langtrain-sdk/main/public/langtrain-black.svg" width="
|
|
7
|
+
<img alt="Langtrain Logo" src="https://raw.githubusercontent.com/langtrain-ai/langtrain-sdk/main/public/langtrain-black.svg" width="60%">
|
|
6
8
|
</picture>
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
## Key Features
|
|
32
|
-
|
|
33
|
-
| Feature | Description |
|
|
34
|
-
| :--- | :--- |
|
|
35
|
-
| **👁️ Computer Vision** | Advanced image analysis, object detection, and visual reasoning powered by `Langvision`. |
|
|
36
|
-
| **🧠 LLM Optimization** | Fine-tune and optimize language models effortlessly with `Langtune`. |
|
|
37
|
-
| **📦 Unified & Bundled** | A single dependency for your entire AI stack. Zero configuration required. |
|
|
38
|
-
| **⚡ Type-Safe** | Built with TypeScript for a robust, developer-friendly experience. |
|
|
39
|
-
|
|
40
|
-
## Quick Start
|
|
41
|
-
|
|
42
|
-
```typescript
|
|
43
|
-
import { Langvision, Langtune } from 'langtrain';
|
|
44
|
-
|
|
45
|
-
// 1. Initialize Clients
|
|
46
|
-
const vision = new Langvision({ apiKey: process.env.LANGVISION_API_KEY });
|
|
47
|
-
const tune = new Langtune({ apiKey: process.env.LANGTUNE_API_KEY });
|
|
48
|
-
|
|
49
|
-
// 2. Build Intelligence
|
|
50
|
-
async function analyzeAndTune() {
|
|
51
|
-
try {
|
|
52
|
-
// Analyze visual user context
|
|
53
|
-
const context = await vision.analyze({
|
|
54
|
-
image: 'https://example.com/dashboard.jpg',
|
|
55
|
-
features: ['layout', 'text']
|
|
56
|
-
});
|
|
57
|
-
|
|
58
|
-
console.log('Visual Context:', context);
|
|
59
|
-
|
|
60
|
-
// Generate optimized response based on visual context
|
|
61
|
-
const response = await tune.generate({
|
|
62
|
-
model: 'gpt-4-vision-optimized',
|
|
63
|
-
prompt: `Explain this dashboard layout: ${context.description}`
|
|
64
|
-
});
|
|
65
|
-
|
|
66
|
-
console.log('AI Response:', response);
|
|
67
|
-
} catch (error) {
|
|
68
|
-
console.error('Error processing AI request:', error);
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
analyzeAndTune();
|
|
9
|
+
</p>
|
|
10
|
+
<br/>
|
|
11
|
+
<p align="center">
|
|
12
|
+
If you want Langtrain in your code editor, <a href="https://langtrain.ai/docs/vscode">install the VS Code Extension.</a>
|
|
13
|
+
<br/>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>.
|
|
14
|
+
</p>
|
|
15
|
+
|
|
16
|
+
---
|
|
17
|
+
|
|
18
|
+
## Quickstart
|
|
19
|
+
|
|
20
|
+
### Installing and running Langtrain CLI
|
|
21
|
+
|
|
22
|
+
Install globally with npm:
|
|
23
|
+
|
|
24
|
+
```shell
|
|
25
|
+
# Install using npm
|
|
26
|
+
npm install -g langtrain
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
Then simply run `langtrain` to get started with the interactive menu.
|
|
30
|
+
|
|
31
|
+
```shell
|
|
32
|
+
langtrain
|
|
73
33
|
```
|
|
74
34
|
|
|
75
|
-
|
|
35
|
+
<details>
|
|
36
|
+
<summary><strong>Troubleshooting Installation</strong></summary>
|
|
37
|
+
|
|
38
|
+
If you encounter permission errors, try running with sudo or fix your npm permissions:
|
|
39
|
+
```bash
|
|
40
|
+
sudo npm install -g langtrain
|
|
41
|
+
```
|
|
42
|
+
</details>
|
|
76
43
|
|
|
77
|
-
|
|
44
|
+
### Using Langtrain with your Cloud Plan
|
|
78
45
|
|
|
79
|
-
|
|
46
|
+
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).
|
|
80
47
|
|
|
81
|
-
|
|
82
|
-
// Start a fine-tuning job
|
|
83
|
-
const job = await tune.createFineTune({
|
|
84
|
-
trainingFile: 'file-id-123',
|
|
85
|
-
model: 'gpt-3.5-turbo',
|
|
86
|
-
hyperparameters: {
|
|
87
|
-
nEpochs: 4
|
|
88
|
-
}
|
|
89
|
-
});
|
|
48
|
+
You can check your current subscription status and limits directly from the CLI:
|
|
90
49
|
|
|
91
|
-
|
|
50
|
+
```shell
|
|
51
|
+
langtrain status
|
|
92
52
|
```
|
|
93
53
|
|
|
94
|
-
|
|
54
|
+
*Free plans allow local fine-tuning and limited cloud agent interactions. Upgrade to Pro for cloud-based GPU training.*
|
|
55
|
+
|
|
56
|
+
## Features
|
|
57
|
+
|
|
58
|
+
- **🤖 AI Agents**: Create, manage, and chat with custom AI agents hosted on Langtrain Server.
|
|
59
|
+
- **🧠 Langtune**: Fine-tune LLMs (Llama 3, Mistral) locally or on the cloud.
|
|
60
|
+
- **👁️ Langvision**: Optimize and fine-tune multimodal vision models.
|
|
61
|
+
- **☁️ Data Persistence**: Automatically sync datasets and training jobs with your workspace.
|
|
95
62
|
|
|
96
|
-
|
|
63
|
+
## Docs
|
|
97
64
|
|
|
98
|
-
|
|
65
|
+
- [**Langtrain Documentation**](https://docs.langtrain.ai)
|
|
66
|
+
- [**SDK Reference**](https://docs.langtrain.ai/sdk)
|
|
67
|
+
- [**Contributing**](./CONTRIBUTING.md)
|
|
99
68
|
|
|
100
|
-
|
|
69
|
+
This repository is licensed under the [MIT License](LICENSE).
|
package/dist/cli.d.mts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
package/dist/cli.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
#!/usr/bin/env node
|