@computesdk/lambda 1.1.7 → 1.1.9
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 +26 -6
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -10,6 +10,28 @@ npm install @computesdk/lambda
|
|
|
10
10
|
|
|
11
11
|
## Usage
|
|
12
12
|
|
|
13
|
+
### Gateway Mode (Recommended)
|
|
14
|
+
|
|
15
|
+
Use the gateway for zero-config auto-detection:
|
|
16
|
+
|
|
17
|
+
```typescript
|
|
18
|
+
import { compute } from 'computesdk';
|
|
19
|
+
|
|
20
|
+
// Auto-detects Lambda from LAMBDA_API_KEY environment variable
|
|
21
|
+
const sandbox = await compute.sandbox.create();
|
|
22
|
+
console.log(`Created sandbox: ${sandbox.id}`);
|
|
23
|
+
|
|
24
|
+
// List all sandboxes
|
|
25
|
+
const sandboxes = await compute.sandbox.list();
|
|
26
|
+
|
|
27
|
+
// Destroy the sandbox
|
|
28
|
+
await sandbox.destroy();
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
### Direct Mode
|
|
32
|
+
|
|
33
|
+
For direct SDK usage without the gateway:
|
|
34
|
+
|
|
13
35
|
```typescript
|
|
14
36
|
import { lambda } from '@computesdk/lambda';
|
|
15
37
|
|
|
@@ -21,18 +43,16 @@ const compute = lambda({
|
|
|
21
43
|
});
|
|
22
44
|
|
|
23
45
|
// Create a new sandbox
|
|
24
|
-
const
|
|
46
|
+
const sandbox = await compute.sandbox.create({
|
|
25
47
|
runtime: 'node' // or 'python'
|
|
26
48
|
});
|
|
49
|
+
console.log(`Created sandbox: ${sandbox.id}`);
|
|
27
50
|
|
|
28
51
|
// List all sandboxes
|
|
29
52
|
const sandboxes = await compute.sandbox.list();
|
|
30
53
|
|
|
31
|
-
//
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
// Destroy a sandbox
|
|
35
|
-
await compute.sandbox.destroy(sandboxId);
|
|
54
|
+
// Destroy the sandbox
|
|
55
|
+
await sandbox.destroy();
|
|
36
56
|
```
|
|
37
57
|
|
|
38
58
|
## Configuration
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@computesdk/lambda",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.9",
|
|
4
4
|
"description": "Lambda Labs provider for ComputeSDK - GPU-accelerated code execution for ML and AI workloads",
|
|
5
5
|
"author": "ComputeSDK Team",
|
|
6
6
|
"license": "MIT",
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
"dist"
|
|
20
20
|
],
|
|
21
21
|
"dependencies": {
|
|
22
|
-
"computesdk": "1.10.
|
|
22
|
+
"computesdk": "1.10.2"
|
|
23
23
|
},
|
|
24
24
|
"keywords": [
|
|
25
25
|
"computesdk",
|
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
"tsup": "^8.0.0",
|
|
51
51
|
"typescript": "^5.0.0",
|
|
52
52
|
"vitest": "^1.0.0",
|
|
53
|
-
"@computesdk/test-utils": "1.5.
|
|
53
|
+
"@computesdk/test-utils": "1.5.1"
|
|
54
54
|
},
|
|
55
55
|
"scripts": {
|
|
56
56
|
"build": "tsup",
|