Embedded Compute for Your Apps
A developer-first primitive to embed compute into your app, agent, or network with the ability to connect directly from the browser.
const computeClient = new ComputeClient();
const compute = await computeClient.create();
// Execute code directly
const result = await compute.exec(`
function sum(a, b)
return a + b;
sum(5, 10);
`);
console.log("Result:", result); // Output: 15
Powerful Features
ComputeSDK provides a simple yet powerful API that's ready for the explosion of compute needs we're facing.
Arbitrary Code Execution
Run any code securely in an isolated environment with full sandboxing, perfect for AI-generated code or user-defined functions.
Kubernetes + gVisor Integration
Built on proven technologies with orchestration, isolation, and ease of deployment right out of the box.
Browser Direct Connection
Connect directly from the browser without proxies, enabling faster performance and more reliable connections for your web applications.
File System Access
Watch and modify files in real-time with full file system capabilities, enabling powerful development and automation workflows.
Terminal Access
Create and control terminal sessions programmatically, perfect for CLIs, developer tools, and automation tasks.
Secure by Design
Strong isolation guarantees protect your application and users from malicious code while enabling powerful compute capabilities.
Use Cases
ComputeSDK opens up endless possibilities for your applications. Here are some common use cases:
Execute Code Directly
Execute code in any programming language within a secure, isolated environment. Whether it's Python for data processing, Rust for performance-critical operations, or JavaScript for web functionality, ComputeSDK handles it all with comprehensive sandboxing and resource management.
// Simple, secure code execution
import { ComputeClient } from 'computesdk';
const compute = new ComputeClient();
// Execute code directly
const result = compute.exec(`
function sum(a, b) {
return a + b;
}
sum(5, 10);
`);
console.log("Result:", result); // Output: 15
Run AI-Generated Code Safely
Safely run AI-generated code in any language without security concerns. Perfect for LLM-powered applications that generate Python, JavaScript, Rust, or any other code. Strong isolation guarantees protect your application while allowing powerful compute capabilities.
// Run AI-generated code safely
const aiCode = await llm.generateCode({
prompt: "Create a function that sorts an array"
});
// Execute in isolated environment
const compute = new ComputeClient();
const result = compute.exec(aiCode, [3, 1, 4, 1, 5, 9]);
console.log(result); // [1, 1, 3, 4, 5, 9]
File System & Terminal Access
Get full access to a real Linux environment with file system operations and terminal capabilities. Run shell commands, execute scripts in any language, watch file changes, and interact with processes - all with proper isolation and security controls.
import { ComputeClient } from 'computesdk';
const computeClient = new ComputeClient();
const compute = await computeClient.create();
const watcher = compute.watchFiles({
path: '/home/project',
includeContent: true
});
watcher.onChanged(async (data) => {
// do something
});
const terminal = await compute.createTerminal()
terminal.write('node --version && python --version\n');
terminal.onData((data) => {
// write to xterm
});