langtrain 0.1.20 → 0.1.22
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 +73 -72
- package/assets/cli-demo.png +0 -0
- package/dist/chunk-PGDJTY7T.mjs +13 -0
- package/dist/chunk-PGDJTY7T.mjs.map +1 -0
- package/dist/chunk-TZNQ5KWQ.js +13 -0
- package/dist/chunk-TZNQ5KWQ.js.map +1 -0
- package/dist/cli.js +8 -8
- package/dist/cli.js.map +1 -1
- package/dist/cli.mjs +8 -8
- package/dist/cli.mjs.map +1 -1
- package/dist/index.d.mts +40 -1
- package/dist/index.d.ts +40 -1
- package/dist/index.js +1 -1
- package/dist/index.mjs +1 -1
- package/package.json +4 -1
- package/src/cli/auth.ts +2 -2
- package/src/cli/components/Table.ts +20 -0
- package/src/cli/handlers/agent.ts +15 -2
- package/src/cli/handlers/logs.ts +2 -2
- package/src/cli/handlers/subscription.ts +2 -2
- package/src/cli/handlers/tune.ts +18 -8
- package/src/cli/handlers/vision.ts +2 -2
- package/src/cli/ui.ts +2 -0
- package/src/lib/files.ts +5 -5
- package/src/lib/subscription.ts +3 -2
- package/src/lib/training.ts +3 -2
- package/dist/chunk-D3O435OM.mjs +0 -30
- package/dist/chunk-D3O435OM.mjs.map +0 -1
- package/dist/chunk-Z7FYIYKL.js +0 -30
- package/dist/chunk-Z7FYIYKL.js.map +0 -1
package/README.md
CHANGED
|
@@ -1,12 +1,24 @@
|
|
|
1
1
|
<div align="center">
|
|
2
|
+
<br />
|
|
2
3
|
<picture>
|
|
3
4
|
<source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/langtrain-ai/langtrain-sdk/main/public/langtrain-white.svg">
|
|
4
5
|
<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="
|
|
6
|
+
<img alt="Langtrain Logo" src="https://raw.githubusercontent.com/langtrain-ai/langtrain-sdk/main/public/langtrain-black.svg" width="280">
|
|
6
7
|
</picture>
|
|
7
|
-
<h3>Langtrain SDK</h3>
|
|
8
|
-
<p>The unified intelligence layer for JavaScript applications.</p>
|
|
9
8
|
|
|
9
|
+
<br />
|
|
10
|
+
<br />
|
|
11
|
+
|
|
12
|
+
<h1>The Unified AI Engineering Platform</h1>
|
|
13
|
+
|
|
14
|
+
<p style="font-size: 1.2rem; max-width: 600px; margin: 0 auto; color: #666;">
|
|
15
|
+
Build, fine-tune, and deploy autonomous agents with a single workflow.
|
|
16
|
+
<br />
|
|
17
|
+
Langtrain bridges the gap between local development and enterprise-grade cloud infrastructure.
|
|
18
|
+
</p>
|
|
19
|
+
|
|
20
|
+
<br />
|
|
21
|
+
|
|
10
22
|
<p>
|
|
11
23
|
<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
24
|
<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>
|
|
@@ -15,123 +27,112 @@
|
|
|
15
27
|
<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
28
|
</p>
|
|
17
29
|
|
|
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>
|
|
30
|
+
<br />
|
|
22
31
|
|
|
23
|
-
<
|
|
24
|
-
<img src="./assets/cli-demo.png" alt="Langtrain CLI
|
|
25
|
-
</
|
|
32
|
+
<a href="https://langtrain.xyz">
|
|
33
|
+
<img src="./assets/cli-demo.png" alt="Langtrain CLI Interface" width="100%" style="border-radius: 12px; border: 1px solid #333; box-shadow: 0 20px 40px -10px rgba(0,0,0,0.5);" />
|
|
34
|
+
</a>
|
|
26
35
|
|
|
27
|
-
<p>
|
|
28
|
-
If you are looking for the <em>web-based platform</em>, <strong>Langtrain Web</strong>, go to <a href="https://langtrain.xyz">langtrain.xyz</a>.
|
|
29
|
-
</p>
|
|
30
36
|
</div>
|
|
31
37
|
|
|
32
|
-
|
|
38
|
+
<br />
|
|
39
|
+
<br />
|
|
33
40
|
|
|
34
|
-
##
|
|
41
|
+
## Quick Start
|
|
35
42
|
|
|
36
|
-
|
|
43
|
+
Get up and running in seconds. Langtrain CLI is your gateway to the entire ecosystem.
|
|
37
44
|
|
|
38
|
-
```
|
|
45
|
+
```bash
|
|
46
|
+
# Install globally
|
|
39
47
|
npm install -g langtrain
|
|
40
|
-
```
|
|
41
|
-
|
|
42
|
-
Then run `langtrain` to start the interactive AI engineering studio:
|
|
43
48
|
|
|
44
|
-
|
|
49
|
+
# Start the interactive studio
|
|
45
50
|
lt
|
|
46
51
|
```
|
|
47
52
|
|
|
48
53
|
<details>
|
|
49
54
|
<summary><strong>Troubleshooting Installation</strong></summary>
|
|
50
55
|
|
|
51
|
-
If you encounter permission errors, try running with sudo or
|
|
56
|
+
If you encounter permission errors, try running with sudo or check your npm permissions:
|
|
52
57
|
```bash
|
|
53
58
|
sudo npm install -g langtrain
|
|
54
59
|
```
|
|
55
60
|
</details>
|
|
56
61
|
|
|
57
|
-
|
|
62
|
+
<br />
|
|
63
|
+
|
|
64
|
+
## Features
|
|
58
65
|
|
|
59
|
-
|
|
66
|
+
Langtrain provides a complete toolkit for the modern AI engineer.
|
|
60
67
|
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
lt
|
|
64
|
-
|
|
65
|
-
|
|
68
|
+
| Feature | Description |
|
|
69
|
+
| :--- | :--- |
|
|
70
|
+
| **Autonomous Agents** | Create, manage, and chat with custom agents. Routable via `lt agent`. |
|
|
71
|
+
| **Langtune** | Fine-tune LLMs (Llama 3, Mistral) locally using QLoRA or dispatch to H100s. |
|
|
72
|
+
| **Langvision** | Optimize multimodal datasets and vision models for edge deployment. |
|
|
73
|
+
| **Enterprise Security** | Local-first architecture. Your data leaves your machine only when you say so. |
|
|
74
|
+
| **Instant Deploy** | Push your verified agents to production endpoints with `lt deploy`. |
|
|
66
75
|
|
|
67
|
-
|
|
76
|
+
<br />
|
|
68
77
|
|
|
69
|
-
## SDK
|
|
78
|
+
## SDK Integration
|
|
70
79
|
|
|
71
|
-
|
|
80
|
+
Use the power of Langtrain directly in your Node.js or TypeScript applications.
|
|
72
81
|
|
|
73
82
|
```typescript
|
|
74
|
-
import { Langvision, Langtune
|
|
83
|
+
import { Langvision, Langtune } from 'langtrain';
|
|
75
84
|
|
|
76
|
-
//
|
|
85
|
+
// Initialize with your project context
|
|
77
86
|
const vision = new Langvision({ apiKey: process.env.LANGTRAIN_API_KEY });
|
|
78
87
|
const tune = new Langtune({ apiKey: process.env.LANGTRAIN_API_KEY });
|
|
79
88
|
|
|
80
|
-
async function
|
|
81
|
-
// Analyze
|
|
82
|
-
const
|
|
83
|
-
image: './dashboard.
|
|
84
|
-
|
|
89
|
+
async function main() {
|
|
90
|
+
// 1. Analyze Visual Context
|
|
91
|
+
const analysis = await vision.analyze({
|
|
92
|
+
image: './dashboard.png',
|
|
93
|
+
prompt: 'Extract UI component hierarchy'
|
|
85
94
|
});
|
|
86
95
|
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
model: 'gpt-4-vision-optimized',
|
|
92
|
-
prompt: `Explain this dashboard layout: ${context.description}`
|
|
96
|
+
// 2. Generate Optimized Code
|
|
97
|
+
const code = await tune.generate({
|
|
98
|
+
model: 'gpt-4-turbo',
|
|
99
|
+
prompt: `Create a React component based on: ${analysis.description}`
|
|
93
100
|
});
|
|
94
101
|
|
|
95
|
-
console.log(
|
|
102
|
+
console.log(code);
|
|
96
103
|
}
|
|
97
104
|
```
|
|
98
105
|
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
- **AI Agents**: Create, manage, and chat with custom AI agents hosted on Langtrain Server.
|
|
102
|
-
- **Langtune**: Fine-tune LLMs (Llama 3, Mistral) locally or on the cloud.
|
|
103
|
-
- **Langvision**: Optimize and fine-tune multimodal vision models.
|
|
104
|
-
- **Data Persistence**: Automatically sync datasets and training jobs with your workspace.
|
|
105
|
-
- **Subscription Management**: Verify plan limits and feature access programmatically.
|
|
106
|
+
<br />
|
|
106
107
|
|
|
107
108
|
## Configuration
|
|
108
109
|
|
|
109
|
-
|
|
110
|
+
Configure your environment seamlessly via CLI or environment variables.
|
|
110
111
|
|
|
111
112
|
| Variable | Description |
|
|
112
113
|
| :--- | :--- |
|
|
113
|
-
| `LANGTRAIN_API_KEY` | Your project
|
|
114
|
-
| `LANGTRAIN_WORKSPACE_ID` | (Optional)
|
|
114
|
+
| `LANGTRAIN_API_KEY` | Your project Secret Key (find it in Settings). |
|
|
115
|
+
| `LANGTRAIN_WORKSPACE_ID` | (Optional) Target specific workspace environments. |
|
|
115
116
|
|
|
116
|
-
|
|
117
|
-
// Example: Manually passing config
|
|
118
|
-
const client = new Langvision({
|
|
119
|
-
apiKey: "lt_sk_...",
|
|
120
|
-
workspaceId: "ws_..."
|
|
121
|
-
});
|
|
122
|
-
```
|
|
117
|
+
> **Pro Tip:** Run `lt login` to authenticate continuously without managing `.env` files manually.
|
|
123
118
|
|
|
124
|
-
|
|
119
|
+
<br />
|
|
125
120
|
|
|
126
|
-
|
|
121
|
+
## Community & Support
|
|
127
122
|
|
|
128
|
-
|
|
123
|
+
Join the thousands of engineers building with Langtrain.
|
|
129
124
|
|
|
130
|
-
- [
|
|
131
|
-
- [
|
|
132
|
-
- [
|
|
125
|
+
- **[Documentation](https://docs.langtrain.xyz)** - Guides, API Reference, and Tutorials.
|
|
126
|
+
- **[GitHub Discussions](https://github.com/langtrain-ai/langtrain-sdk/discussions)** - Ask questions, request features.
|
|
127
|
+
- **[Enterprise Support](mailto:support@langtrain.xyz)** - Dedicated support for teams.
|
|
133
128
|
|
|
134
|
-
|
|
129
|
+
<br />
|
|
130
|
+
|
|
131
|
+
---
|
|
135
132
|
|
|
136
|
-
|
|
137
|
-
|
|
133
|
+
<div align="center">
|
|
134
|
+
<p style="color: #666; font-size: 0.9rem;">
|
|
135
|
+
© 2024 Langtrain AI Inc. All rights reserved. <br />
|
|
136
|
+
<a href="https://langtrain.xyz/privacy">Privacy Policy</a> • <a href="https://langtrain.xyz/terms">Terms of Service</a>
|
|
137
|
+
</p>
|
|
138
|
+
</div>
|
package/assets/cli-demo.png
CHANGED
|
Binary file
|