langtrain 0.1.19 → 0.1.21

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.
@@ -0,0 +1,27 @@
1
+ ---
2
+ description: Run GSD, the high-velocity "Get Shit Done" implementation agent
3
+ ---
4
+
5
+ # GSD - Get Shit Done
6
+
7
+ GSD mode is for rapid, iterative implementation of a specific feature or fix.
8
+
9
+ 1. **Understand the Goal**
10
+ - Read the user request and any linked files.
11
+ - If ambiguous, make a reasonable assumption and proceed (bias for action).
12
+
13
+ 2. **Plan (Quickly)**
14
+ - Create a mini-plan in your scratchpad.
15
+ - Break down into: Backend, Frontend, Integration.
16
+
17
+ 3. **Execute (Iterative)**
18
+ - **// turbo-all**
19
+ - Write code.
20
+ - Run tests/builds immediately after writing.
21
+ - Fix errors immediately. Do not ask for help unless blocked by missing credentials/info.
22
+
23
+ 4. **Verify**
24
+ - Run the relevant verification script.
25
+ - If it passes, you are done.
26
+
27
+ **Motto**: "Perfect is the enemy of done. Ship it."
@@ -0,0 +1,28 @@
1
+ ---
2
+ description: Run Ralph, the strict code quality and cleanup agent
3
+ ---
4
+
5
+ # Ralph - The Code Janitor
6
+
7
+ Ralph's job is to ensure code quality, consistency, and cleanliness.
8
+
9
+ 1. **Analyze Project Structure**
10
+ - Run `find . -maxdepth 2 -not -path '*/.*'` to see the lay of the land.
11
+
12
+ 2. **Lint & Format**
13
+ - IF `package.json` exists:
14
+ - Run `npm run lint` or `pnpm lint`.
15
+ - If it fails, fix the errors automatically.
16
+ - IF `pyproject.toml` or `requirements.txt` exists:
17
+ - Run `ruff check . --fix` (if available) or `flake8 .`.
18
+
19
+ 3. **Dead Code Detection**
20
+ - Search for TODOs and FIXMEs: `grep -r "TODO" .`, `grep -r "FIXME" .`
21
+ - Report them to the user but do NOT delete unless instructed.
22
+
23
+ 4. **Security Scan**
24
+ - Check for hardcoded secrets (basic regex check).
25
+ - `grep -r "API_KEY" .` (exclude env files).
26
+
27
+ 5. **Report**
28
+ - Generate a summary of what was cleaned and what needs attention.
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="250">
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,119 +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/>
30
+ <br />
19
31
 
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>
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>
22
35
 
23
- <p>
24
- 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>.
25
- </p>
26
36
  </div>
27
37
 
28
- ---
38
+ <br />
39
+ <br />
29
40
 
30
- ## Quickstart (CLI)
41
+ ## Quick Start
31
42
 
32
- Install globally with npm:
43
+ Get up and running in seconds. Langtrain CLI is your gateway to the entire ecosystem.
33
44
 
34
- ```shell
45
+ ```bash
46
+ # Install globally
35
47
  npm install -g langtrain
36
- ```
37
48
 
38
- Then run `langtrain` to start the interactive AI engineering studio:
39
-
40
- ```shell
49
+ # Start the interactive studio
41
50
  lt
42
51
  ```
43
52
 
44
53
  <details>
45
54
  <summary><strong>Troubleshooting Installation</strong></summary>
46
55
 
47
- If you encounter permission errors, try running with sudo or fix your npm permissions:
56
+ If you encounter permission errors, try running with sudo or check your npm permissions:
48
57
  ```bash
49
58
  sudo npm install -g langtrain
50
59
  ```
51
60
  </details>
52
61
 
53
- ### Using Langtrain with your Cloud Plan
62
+ <br />
54
63
 
55
- Run `lt 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.xyz/pricing).
64
+ ## Features
56
65
 
57
- Check your subscription status and limits:
58
- ```shell
59
- lt status
60
- ```
61
- *Free plans allow local fine-tuning. Upgrade to Pro for cloud-based GPU training.*
66
+ Langtrain provides a complete toolkit for the modern AI engineer.
62
67
 
63
- ---
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`. |
64
75
 
65
- ## SDK Usage
76
+ <br />
66
77
 
67
- You can also use `langtrain` as a library in your Node.js applications to build intelligent agents and workflows.
78
+ ## SDK Integration
79
+
80
+ Use the power of Langtrain directly in your Node.js or TypeScript applications.
68
81
 
69
82
  ```typescript
70
- import { Langvision, Langtune, SubscriptionClient } from 'langtrain';
83
+ import { Langvision, Langtune } from 'langtrain';
71
84
 
72
- // 1. Initialize Clients
85
+ // Initialize with your project context
73
86
  const vision = new Langvision({ apiKey: process.env.LANGTRAIN_API_KEY });
74
87
  const tune = new Langtune({ apiKey: process.env.LANGTRAIN_API_KEY });
75
88
 
76
- async function analyzeAndTune() {
77
- // Analyze visual user context
78
- const context = await vision.analyze({
79
- image: './dashboard.jpg',
80
- features: ['layout', 'text']
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'
81
94
  });
82
95
 
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}`
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}`
89
100
  });
90
101
 
91
- console.log(response);
102
+ console.log(code);
92
103
  }
93
104
  ```
94
105
 
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.
106
+ <br />
102
107
 
103
108
  ## Configuration
104
109
 
105
- The SDK and CLI can be configured using environment variables `(dotenv supported)` or via `lt login`.
110
+ Configure your environment seamlessly via CLI or environment variables.
106
111
 
107
112
  | Variable | Description |
108
113
  | :--- | :--- |
109
- | `LANGTRAIN_API_KEY` | Your project API Key (get it from the dashboard). |
110
- | `LANGTRAIN_WORKSPACE_ID` | (Optional) Workspace ID for specific environment interaction. |
114
+ | `LANGTRAIN_API_KEY` | Your project Secret Key (find it in Settings). |
115
+ | `LANGTRAIN_WORKSPACE_ID` | (Optional) Target specific workspace environments. |
111
116
 
112
- ```typescript
113
- // Example: Manually passing config
114
- const client = new Langvision({
115
- apiKey: "lt_sk_...",
116
- workspaceId: "ws_..."
117
- });
118
- ```
117
+ > **Pro Tip:** Run `lt login` to authenticate continuously without managing `.env` files manually.
118
+
119
+ <br />
119
120
 
120
- ## Community & Support
121
+ ## Community & Support
121
122
 
122
- - **[GitHub Discussions](https://github.com/langtrain-ai/langtrain-sdk/discussions)**: Ask questions and share ideas.
123
+ Join the thousands of engineers building with Langtrain.
123
124
 
124
- ## Documentation
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.
125
128
 
126
- - [**Langtrain Documentation**](https://docs.langtrain.xyz)
127
- - [**SDK Reference**](https://docs.langtrain.xyz/sdk)
128
- - [**Contributing**](./CONTRIBUTING.md)
129
+ <br />
129
130
 
130
- ## License
131
+ ---
131
132
 
132
- This repository is licensed under the [MIT License](LICENSE).
133
- copyright © [Langtrain](https://langtrain.xyz)
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>
Binary file