| name | lightning-sandbox |
| description | Guide for creating and managing Lightning AI sandboxes using ComputeSDK. Use when building applications that need Lightning AI provider for ComputeSDK - cloud sandboxes for code execution, command running, and filesystem access. |
Lightning AI Sandboxes with ComputeSDK
Lightning AI provider for ComputeSDK - cloud sandboxes for code execution, command running, and filesystem access.
Setup
npm install computesdk @computesdk/lightning
Set your credentials:
LIGHTNING_API_KEY=your_lightning_api_key
LIGHTNING_CLOUD_URL=your_lightning_cloud_url
LIGHTNING_SANDBOX_API_KEY=your_lightning_sandbox_api_key
Quick Start
import { compute } from 'computesdk';
import { lightning } from '@computesdk/lightning';
compute.setConfig({
provider: lightning({
apiKey: process.env.LIGHTNING_SANDBOX_API_KEY,
baseUrl: process.env.LIGHTNING_CLOUD_URL,
}),
});
const sandbox = await compute.sandbox.create();
const result = await sandbox.runCommand('echo "Hello from Lightning AI!"');
console.log(result.stdout);
await sandbox.destroy();
You can also call the provider factory directly:
import { lightning } from '@computesdk/lightning';
const sdk = lightning({
apiKey: process.env.LIGHTNING_SANDBOX_API_KEY,
baseUrl: process.env.LIGHTNING_CLOUD_URL,
});
const sandbox = await sdk.sandbox.create();
Lightning AI Configuration
interface LightningConfig {
apiKey?: string;
baseUrl?: string;
instanceType?: string;
runtime?: string;
persistent?: boolean;
spot?: boolean;
ports?: number[];
timeout?: number;
}
Full API
ComputeSDK exposes the same universal sandbox API across providers: sandbox.create(), sandbox.getById(), sandbox.destroy(), sandbox.runCommand(), sandbox.getInfo(), sandbox.getUrl(), and sandbox.filesystem.*.
Install the main skill for the complete reference:
npx skills add https://github.com/computesdk/sandbox-skills --skill computesdk
Or see https://www.computesdk.com/docs/reference/sandbox/.