
Loading...

Loading...
Capability ยท Batch
Run many prompts as encrypted inferences against the same worker pool - results in submission order, a stalled slot fails on its own. Run it live with your wallet below (user-pays, one job per prompt), or copy the parallel Node call.
Each slot is one createSession + submitJob pair on Mainnet (real LCAI).
import { runInferenceBatch } from "lightnode-sdk";
const results = await runInferenceBatch({
network: "mainnet",
privateKey: process.env.PRIVATE_KEY,
concurrency: 4,
prompts: [
"What is Porsche?",
"What is Lamborghini?",
],
onSlotComplete: ({ index, result, error }) =>
console.log(index, error?.message ?? result?.answer),
});
// Results are in submission order; a stalled slot fails on its own.
for (const r of results) console.log(r.index, r.error?.message ?? r.result?.answer);Scaffold it into your project: npx lightnode add batch.