close

Sandbox

Build AI development environments

Use fast, secure code sandboxes at scale to set up full-scale development environments for AI.

Image
Image
import { CodeSandbox } from "@codesandbox/sdk"

const sdk = new CodeSandbox()

const sandbox = await sdk.sandboxes.create({ id: "node-template" })

const client = await sandbox.connect()

await client.commands.run("npm install && npm run build")

const previewUrl = client.hosts.getUrl(3000)

await sdk.sandboxes.hibernate(sandbox.id)

// Snapshot saved — resume anytime in <1s

Why Together Sandbox?

Code Sandbox lets you run experiments and benchmarks against real models and GPUs in a controlled environment — designed for fast iteration before production deployment.

Create VMs instantly

Leverage industry-leading 2.7 second cold-starts (P95), 500ms snapshot resumes (P95) and VM cloning in under 1 second.

Run any developer environment

Go beyond Docker images, leveraging Dev Containers to easily configure any type of setup, including servers, databases, and custom Docker configurations.

Build & scale seamlessly

Control sandbox dev environments with tools for terminal access, tasks, preview host, sessions, and more.

Fast, secure code sandboxes at scale

Fully configurable development environments with fast start-up times, robust snapshotting, and mature dev tools.

    • Robust snapshotting

      Image
      FAST
      Image
      ROBUST
      Image
      PROVEN IN PRODUCTION

      Hibernate and resume sandboxes in 500 ms. Maintain state integrity through memory snapshotting. No cold starts.

    • VM scaling

      Image
      Hot-swappable
      Image
      2-64 vCPUs
      Image
      1-128 GB RAM

      Scale CPU compute on demand with adjustable VM sizes ranging from 2 to 64 vCPUs and 1 to 128 GB RAM.

    • Persistent storage

      Image
      VM FS persistence
      Image
      git version control

      Maintain persistent and secure data access across sessions with a git-versioned filesystem. Keep data intact. Automate version control for all changes.

    • Suite of dev tools

      Image
      DevContainer
      Image
      Robust APIs
      Image
      Built-in CLI

      Access built-in terminals, tasks, preview hosting, and session management. Utilize pre-configured, production-ready tools in every sandbox.

    Image
    // Hibernation automatically snapshots disk + memory state
    await sdk.sandboxes.hibernate(sandbox.id)
    
    // Resume restores the exact state — <1s
    const sandbox = await sdk.sandboxes.resume("sandbox-id")
    
    // Fork from a hibernated sandbox to branch your environment
    const fork = await sdk.sandboxes.create({ id: sandbox.id })
    Image
    import { CodeSandbox, VMTier } from "@codesandbox/sdk"
    
    const sdk = new CodeSandbox()
    
    // Create with specific resource allocation
    const sandbox = await sdk.sandboxes.create({
      id: "python-ml-template",
      vmTier: VMTier.fromSpecs({ cpu: 4, memGiB: 8 })
    })
    Image
    const client = await sandbox.connect()
    
    // Write files to the sandbox filesystem
    await client.fs.writeTextFile("./data/results.json", JSON.stringify(results))
    
    // Hibernate — all files are preserved in the snapshot
    await sdk.sandboxes.hibernate(sandbox.id)
    
    // Resume later — files are exactly as you left them
    const sandbox = await sdk.sandboxes.resume("sandbox-id")
    const client = await sandbox.connect()
    const data = await client.fs.readTextFile("./data/results.json")
    Image
    const client = await sandbox.connect()
    
    // Terminal access
    const terminal = client.terminals.create()
    await terminal.run("git clone https://github.com/my-org/my-repo")
    
    // Command execution with output
    const output = await client.commands.run("npm test")
    console.log(output)
    
    // Live preview URLs
    const previewUrl = client.hosts.getUrl(3000)
    // → https://-3000.csb.app
    
    // File watching
    const watcher = await client.fs.watch("./src", { recursive: true })
    watcher.onEvent((event) => console.log(event))

Customers running inference in production

Image
  • 10%

    faster product development

  • 98%

    lower preview cold starts

“Now, Together Sandbox is the core of HeroUI Chat; it is the platform that allows us to run the projects. Without it, we don't have a way to show you the result of the AI. We can now focus completely on our core product, knowing our infrastructure is continuously improving and evolving. It feels like having a dedicated infrastructure team right alongside us”

Junior Garcia

Founder and CEO, HeroUI

    “We originally planned to build our own VM and preview system, but Together AI made that unnecessary and saved us at least 3 months of work. It’s honestly so simple, a 5-year-old could use it: Together Sandbox is that clean. It gave us developer-friendly primitives out of the box—and let us focus on building the product.”

    Image

    Sean Filimon

    Founder & CEO, LegionEdge