forgevm
v0.1.1
Published
TypeScript SDK for ForgeVM — self-hosted microVM sandboxes for LLMs
Maintainers
Readme
ForgeVM TypeScript SDK
TypeScript/JavaScript client for ForgeVM -- self-hosted compute sandboxes for LLMs.
Install
npm install forgevmQuick Start
import { Client } from "forgevm";
const client = new Client("http://localhost:7423");
// Spawn a sandbox
const sandbox = await client.spawn({ image: "alpine:latest" });
// Execute commands
const result = await sandbox.exec("echo hello");
console.log(result.stdout); // "hello\n"
// File operations
await sandbox.writeFile("/tmp/hello.txt", "Hello, world!");
const content = await sandbox.readFile("/tmp/hello.txt");
// Extended file operations
await sandbox.moveFile("/tmp/hello.txt", "/tmp/greeting.txt");
await sandbox.chmodFile("/tmp/greeting.txt", "755");
const info = await sandbox.statFile("/tmp/greeting.txt");
const matches = await sandbox.globFiles("/tmp/*.txt");
await sandbox.deleteFile("/tmp/greeting.txt");
// Extend TTL
await sandbox.extendTtl("30m");
// Streaming output
for await (const chunk of sandbox.execStream("ping -c 3 localhost")) {
process.stdout.write(chunk.data);
}
await sandbox.destroy();License
MIT
