Full Linux VMs with up to 32 vCPUs, 32 GB RAM, instant startup, and live forking.
Freestyle VMs provide maximum control and power for AI agents that need more than a sandbox.
VMs provision in under 600ms from API request to ready machine.
Clone a running VM without pausing it — get full copies in milliseconds.
Hibernate VMs and resume exactly where you left off — pay nothing while paused.
First class TypeScript SDK
Create a VM in milliseconds
Real Linux — install any package
Write files straight to the VM
Run code; capture stdout, stderr, exit code
1import { freestyle } from "freestyle";
2
3const { vm } = await freestyle.vms.create();
4
5// Bun ships in every VM — install a package and run a script
6await vm.exec("cd /tmp && /opt/bun/bin/bun add zod");
7
8await vm.fs.writeTextFile("/tmp/main.ts", `
9 import { z } from "zod";
10 const User = z.object({ name: z.string(), age: z.number() });
11 console.log(JSON.stringify(User.parse({ name: "Alice", age: 30 })));
12`);
13
14const { stdout } = await vm.exec("cd /tmp && /opt/bun/bin/bun run main.ts");
15
16console.log(stdout); // {"name":"Alice","age":30}Spin up a VM
Scaffold and start a Next.js app
Fork the live VM into 3 copies
Each fork builds a feature in parallel
1import { freestyle } from "freestyle";
2
3const { vm } = await freestyle.vms.create();
4
5await vm.exec("cd /root && /opt/bun/bin/bunx create-next-app@latest my-app --yes");
6await vm.exec("cd /root/my-app && /opt/bun/bin/bun run dev &");
7
8// Clone the running VM — dev server and all — into 3 live copies
9const { forks } = await vm.fork({ count: 3 });
10
11await Promise.all([
12 forks[0].vm.exec("cd /root/my-app && /opt/bun/bin/bun add drizzle-orm"),
13 forks[1].vm.exec("cd /root/my-app && /opt/bun/bin/bun add next-auth"),
14 forks[2].vm.exec("cd /root/my-app && /opt/bun/bin/bun add stripe"),
15]);Create a persistent VM
Start Redis, write to memory
Idle → suspended, memory frozen, billing stops
Any request wakes it — process still running
1import { freestyle } from "freestyle";
2
3const { vm } = await freestyle.vms.create({
4 persistence: { type: "persistent" },
5 idleTimeoutSeconds: 30,
6});
7
8await vm.exec("apt-get update && apt-get install -y redis-server");
9await vm.exec("redis-server --daemonize yes && redis-cli SET counter 42");
10
11// No traffic for 30s → Freestyle suspends the VM, freezing CPU and
12// memory. Compute billing stops; you only pay for storage.
13
14// ...30 days pass with no traffic — the VM stays suspended...
15
16// The next request wakes it in under 100ms — memory restored
17const { stdout } = await vm.exec("redis-cli GET counter");
18
19console.log(stdout); // "42" — Redis was never restartedOpen a streaming PTY session
Pipe VM output to your WebSocket
Write the user's input into the shell
Sessions survive disconnects and forks
1import { freestyle } from "freestyle";
2
3const { vm } = await freestyle.vms.create();
4
5// Open a PTY in the VM and stream its output to the browser
6const shell = await vm.pty.open({
7 cols: 80,
8 rows: 24,
9 onData: (bytes) => ws.send(bytes),
10});
11
12// Forward the user's keystrokes back into the VM
13ws.on("message", (keys) => shell.write(keys));
14
15// Reattach after a disconnect, suspend, or fork
16await vm.pty.attach({ sessionId: shell.sessionId });Set up your environment once
Scaffold, install deps, prebuild
Snapshot the entire machine state
Boot 10 clones instantly from the snapshot
1import { freestyle } from "freestyle";
2
3const { vm } = await freestyle.vms.create();
4
5// Bake a golden image once
6await vm.exec("cd /root && /opt/bun/bin/bunx create-next-app@latest my-app --yes");
7await vm.exec("cd /root/my-app && /opt/bun/bin/bun add drizzle-orm next-auth");
8await vm.exec("cd /root/my-app && /opt/bun/bin/bun run build");
9
10const { snapshotId } = await vm.snapshot();
11
12// Boot 10 identical VMs from it, each ready in milliseconds
13const vms = await Promise.all(
14 Array.from({ length: 10 }, () =>
15 freestyle.vms.create({ snapshotId })
16 )
17);Create a persistent VM
Create a scoped identity
Grant access to a specific user
Connect over SSH
1import { freestyle } from "freestyle";
2
3const { vmId } = await freestyle.vms.create({
4 persistence: { type: "persistent" },
5});
6
7// Mint a scoped identity and grant it VM access
8const { identity } = await freestyle.identities.create();
9
10await identity.permissions.vms.grant({
11 vmId,
12 allowedUsers: ["developer"],
13});
14
15const { token } = await identity.tokens.create();
16
17console.log(`ssh ${vmId}+developer:${token}@vm-ssh.freestyle.sh`);Beyond a sandbox
Run VMs inside VMs, Docker, or any virtualization stack your agents need. Full KVM support.
Sealed Linux users, systemd services and groups; multi-user isolation inside every VM.
The full Linux networking stack with real root access.
First-class integrations for the tools and languages you want to use
Create your first VM in minutes. No credit card required.
Give each agent its own isolated environment with forking to explore multiple solutions.
Each user gets their own dev environment. Hibernate overnight, resume instantly.
Run headless browsers for testing, scraping, or AI-driven web tasks.

