Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/sandbox-dax-benchmarks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ jobs:
HOPX_API_KEY: ${{ secrets.HOPX_API_KEY }}
ISORUN_API_KEY: ${{ secrets.ISORUN_API_KEY }}
LIGHTNING_API_KEY: ${{ secrets.LIGHTNING_API_KEY }}
LIGHTNING_INSTANCE_TYPE: cpu-8 # 8 vCPU / 16 GiB, matching the standardized dax profile
MODAL_TOKEN_ID: ${{ secrets.MODAL_TOKEN_ID }}
MODAL_TOKEN_SECRET: ${{ secrets.MODAL_TOKEN_SECRET }}
NORTHFLANK_TOKEN: ${{ secrets.NORTHFLANK_TOKEN }}
Expand Down
3 changes: 3 additions & 0 deletions env.example
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,9 @@ CREATEOS_SANDBOX_API_KEY=your_createos_sandbox_api_key

######### LIGHTNING ########
LIGHTNING_API_KEY=your_lightning_api_key
# Instance type for new sandboxes (cpu-1, cpu-2, ... cpu-16). Defaults to cpu-1.
# The dax benchmark uses cpu-8 (8 vCPU / 16 GiB) for a fair cross-provider comparison.
LIGHTNING_INSTANCE_TYPE=cpu-1

######### AI GATEWAYS ########
OPENROUTER_API_KEY=your_openrouter_api_key
Expand Down
2 changes: 2 additions & 0 deletions src/sandbox/dax.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ const BENCH_SCRIPT_PATH = path.resolve(import.meta.dirname, '../../scripts/dax-b
// Each provider uses different parameter names and units, so we map per-provider.
// Providers not listed here don't support CPU/memory configuration at sandbox creation time.
// Note: E2B sets CPU/memory at template build time, not at sandbox creation.
// Note: lightning is sized via LIGHTNING_INSTANCE_TYPE=cpu-8 (8 vCPU / 16 GiB), applied on
// the provider factory in providers.ts — the SDK ignores an instanceType passed to create().
const DAX_RESOURCE_OPTIONS: Record<string, Record<string, any>> = {
modal: { cpu: 4, cpuLimit: 4, memoryMiB: 16384 }, // Modal: 1 core = 2 vCPUs, so 4 cores = 8 vCPUs
tensorlake: { cpus: 8, memoryMb: 16384 },
Expand Down
10 changes: 9 additions & 1 deletion src/sandbox/providers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,15 @@ export const providers: ProviderConfig[] = [
{
name: 'lightning',
requiredEnvVars: ['LIGHTNING_API_KEY'],
createCompute: () => lightning({ apiKey: process.env.LIGHTNING_API_KEY! }),
// Lightning sizes sandboxes via `instanceType` on the provider factory (the SDK
// ignores an instanceType passed to sandbox.create()), so it can't be sized through
// DAX_RESOURCE_OPTIONS like most providers. The dax workflow sets
// LIGHTNING_INSTANCE_TYPE=cpu-8 for the standardized 8 vCPU / 16 GiB profile;
// it defaults to cpu-1 (the SDK default) everywhere else.
createCompute: () => lightning({
apiKey: process.env.LIGHTNING_API_KEY!,
instanceType: process.env.LIGHTNING_INSTANCE_TYPE || 'cpu-1',
}),
},
{
name: 'modal',
Expand Down