langtrain 0.1.12 → 0.1.14

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.
Files changed (2) hide show
  1. package/README.md +77 -65
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -5,96 +5,108 @@
5
5
  <img alt="Langtrain Logo" src="https://raw.githubusercontent.com/langtrain-ai/langtrain-sdk/main/public/langtrain-black.svg" width="250">
6
6
  </picture>
7
7
  <h3>Langtrain SDK</h3>
8
- <p>
9
- The unified intelligence layer for JavaScript applications. <br/>
10
- Combine computer vision and LLM fine-tuning in a single, high-performance SDK.
11
- </p>
8
+ <p>The unified intelligence layer for JavaScript applications.</p>
12
9
 
13
10
  <p>
14
- <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>
15
- <a href="https://langtrain.ai"><img src="https://img.shields.io/badge/website-langtrain.ai-000000?style=flat-square&labelColor=231f20" alt="website" /></a>
16
- <a href="https://docs.langtrain.ai"><img src="https://img.shields.io/badge/docs-documentation-000000?style=flat-square&labelColor=231f20" alt="documentation" /></a>
17
- <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=231f20&color=000000" alt="license" /></a>
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://langtrain.ai"><img src="https://img.shields.io/badge/website-langtrain.ai-18181b?style=flat-square&labelColor=18181b" alt="website" /></a>
13
+ <a href="https://docs.langtrain.ai"><img src="https://img.shields.io/badge/docs-documentation-18181b?style=flat-square&labelColor=18181b" alt="documentation" /></a>
14
+ <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>
18
15
  </p>
19
16
 
20
17
  <br/>
21
18
 
22
- <pre>npm install langtrain</pre>
19
+ <p align="center"><code>npm i -g langtrain</code></p>
20
+ <p><strong>Langtrain CLI</strong> is a unified AI engineering platform that runs locally on your computer and connects to the Langtrain Cloud.</p>
23
21
 
24
- <br/>
22
+ <p>
23
+ If you want Langtrain in your code editor, <a href="https://langtrain.ai/docs/vscode">install the VS Code Extension.</a><br/>
24
+ 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>.
25
+ </p>
25
26
  </div>
26
27
 
27
- ## Overview
28
+ ---
28
29
 
29
- 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.
30
+ ## 🚀 Quickstart (CLI)
30
31
 
31
- ## Key Features
32
+ Install globally with npm:
32
33
 
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. |
34
+ ```shell
35
+ npm install -g langtrain
36
+ ```
39
37
 
40
- ## Quick Start
38
+ Then run `langtrain` to start the interactive AI engineering studio:
41
39
 
42
- ```typescript
43
- import { Langvision, Langtune } from 'langtrain';
40
+ ```shell
41
+ langtrain
42
+ ```
44
43
 
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 });
44
+ <details>
45
+ <summary><strong>Troubleshooting Installation</strong></summary>
48
46
 
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
- }
47
+ If you encounter permission errors, try running with sudo or fix your npm permissions:
48
+ ```bash
49
+ sudo npm install -g langtrain
50
+ ```
51
+ </details>
52
+
53
+ ### Using Langtrain with your Cloud Plan
54
+
55
+ 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).
71
56
 
72
- analyzeAndTune();
57
+ Check your subscription status and limits:
58
+ ```shell
59
+ langtrain status
73
60
  ```
61
+ *Free plans allow local fine-tuning. Upgrade to Pro for cloud-based GPU training.*
74
62
 
75
- ## Advanced Usage
63
+ ---
76
64
 
77
- For more complex workflows, you can leverage specific modules:
65
+ ## 📦 SDK Usage
78
66
 
79
- ### Fine-Tuning a Model
67
+ You can also use `langtrain` as a library in your Node.js applications to build intelligent agents and workflows.
80
68
 
81
69
  ```typescript
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
- });
90
-
91
- console.log(`Fine-tuning started: ${job.id}`);
70
+ import { Langvision, Langtune, SubscriptionClient } from 'langtrain';
71
+
72
+ // 1. Initialize Clients
73
+ const vision = new Langvision({ apiKey: process.env.LANGTRAIN_API_KEY });
74
+ const tune = new Langtune({ apiKey: process.env.LANGTRAIN_API_KEY });
75
+
76
+ async function analyzeAndTune() {
77
+ // Analyze visual user context
78
+ const context = await vision.analyze({
79
+ image: './dashboard.jpg',
80
+ features: ['layout', 'text']
81
+ });
82
+
83
+ console.log('Visual Context:', context);
84
+
85
+ // Generate optimized response
86
+ const response = await tune.generate({
87
+ model: 'gpt-4-vision-optimized',
88
+ prompt: `Explain this dashboard layout: ${context.description}`
89
+ });
90
+
91
+ console.log(response);
92
+ }
92
93
  ```
93
94
 
94
- ## Documentation
95
+ ## ✨ Features
96
+
97
+ - **🤖 AI Agents**: Create, manage, and chat with custom AI agents hosted on Langtrain Server.
98
+ - **🧠 Langtune**: Fine-tune LLMs (Llama 3, Mistral) locally or on the cloud.
99
+ - **👁️ Langvision**: Optimize and fine-tune multimodal vision models.
100
+ - **☁️ Data Persistence**: Automatically sync datasets and training jobs with your workspace.
101
+ - **📊 Subscription Management**: Verify plan limits and feature access programmatically.
102
+
103
+ ## 📚 Documentation
95
104
 
96
- Visit [docs.langtrain.ai](https://docs.langtrain.ai) for comprehensive guides and API reference.
105
+ - [**Langtrain Documentation**](https://docs.langtrain.ai)
106
+ - [**SDK Reference**](https://docs.langtrain.ai/sdk)
107
+ - [**Contributing**](./CONTRIBUTING.md)
97
108
 
98
- ## License
109
+ ## 📄 License
99
110
 
100
- MIT © [Langtrain AI](https://langtrain.ai)
111
+ This repository is licensed under the [MIT License](LICENSE).
112
+ copyright © [Langtrain AI](https://langtrain.ai)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "langtrain",
3
- "version": "0.1.12",
3
+ "version": "0.1.14",
4
4
  "description": "Unified JavaScript SDK for Langtrain Ecosystem",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.mjs",