The sessionless
code interpreter

Securely run AI-generated code in stateful sandboxes that run forever.

Sign up

Sign up from your terminal to try ForeverVM for free

npx forevervm signuporuvx forevervm signup
try it out
Python 3.13.1 (main, Jan 14 2025, 02:51:49) [GCC 12.2.0]
Examples:

What is it?

ForeverVM is a code execution API that allows you to securely run arbitrary Python code in a remote sandbox and get back results.

Unlike traditional code interpreters, ForeverVM does not have a concept of a session after which state expires. Instead, ForeverVM uses memory snapshots to swap idle machines to disk for as long as you want. This improves scalability and resource usage, and means that applications and agents built on ForeverVM don't have to manage session lifecycles.

How does it work?

Once you have created a ForeverVM machine, you can interact with it through a REPL (read-eval-print loop) interface. ForeverVM will assign the machine to an available worker while it is actively in use.

When a sandbox is idle, its memory is snapshotted before it is “detached” from the worker.

As long as the sandbox remains inactive, it only consumes storage space, not compute or memory resources.

The next time an instruction for the sandbox is received by the API, it is assigned to a new worker and resumed from its last snapshot.

These implementation details are hidden from the outside world. To applications built on ForeverVM, a machine is just a long-lived REPL that is always ready to run code.

CLI

The ForeverVM CLI allows you to create machines and start REPL sessions with them. It is distributed through major package managers. Source and binaries are also available on GitHub.

npx forevervm login
npx forevervm repl
npx forevervm --help

API

Start a machine:

from forevervm_sdk import ForeverVM

fvm = ForeverVM(token=API_TOKEN)
fvm.create_machine()
{ "id": "YGBm-MFSd-mb263bQRUcc" }

Run code:

from forevervm_sdk import ForeverVM

repl = ForeverVM(token=API_TOKEN).repl()
fvm.exec("8 + 123").result
{
  "value": "131",
  "runtime_ms": 9
}

More examples are avilable in our documentation.

Using ForeverVM with Claude Desktop, Goose and more

ForeverVM is available as a Model Context Protocol (MCP) server. You can add ForeverVM as a tool for Claude Desktop and other MCP Clients.

Find the ForeverVM MCP server on Github. Or read our docs for setup instructions.

More examples are available in our documentation.

Sign up from your terminal to try ForeverVM for free

npx forevervm signuporuvx forevervm signup

Bring your own cloud

ForeverVM is designed with enterprise needs in mind, including running in your own AWS account. If you're interested, fill out the form below to set up a call.