Forevervm
Securely execute AI-generated code in stateful sandboxes that operate indefinitely.
Overview
What is ForeverVM?
ForeverVM is a powerful tool designed to securely run AI-generated code in stateful sandboxes that operate indefinitely. This innovative platform allows developers to test and deploy their code in a controlled environment, ensuring that applications run smoothly without the risk of crashing or losing data. With ForeverVM, users can leverage the capabilities of AI while maintaining a high level of security and reliability.
Features of ForeverVM
- Stateful Sandboxes: Each sandbox retains its state, allowing for persistent data storage and seamless execution of long-running processes.
- AI Code Execution: Designed specifically for running AI-generated code, ForeverVM provides an optimized environment that enhances performance and reliability.
- Security: The platform prioritizes security, ensuring that code execution is isolated and protected from external threats.
- User-Friendly Interface: ForeverVM offers an intuitive interface that simplifies the process of deploying and managing code, making it accessible for both novice and experienced developers.
- Scalability: The system is built to scale, accommodating varying workloads and user demands without compromising performance.
How to Use ForeverVM
- Sign Up: Create an account on the ForeverVM website to get started.
- Create a Sandbox: Once logged in, you can create a new sandbox environment tailored to your project needs.
- Upload Your Code: Upload your AI-generated code to the sandbox for execution.
- Run and Test: Execute your code within the sandbox, monitor its performance, and make necessary adjustments.
- Save and Deploy: Once satisfied with the results, save your configuration and deploy your application as needed.
Frequently Asked Questions
Q: What types of code can I run on ForeverVM?
A: ForeverVM is designed to run AI-generated code, but it can also support various programming languages and frameworks, depending on the sandbox configuration.
Q: Is ForeverVM secure?
A: Yes, security is a top priority for ForeverVM. Each sandbox operates in isolation, protecting your code and data from potential threats.
Q: Can I access my sandbox from anywhere?
A: Yes, ForeverVM is cloud-based, allowing you to access your sandboxes from any device with an internet connection.
Q: How does ForeverVM handle errors in code execution?
A: ForeverVM provides detailed logs and error messages to help you troubleshoot issues quickly and efficiently.
Q: Is there a limit to how long my code can run?
A: No, ForeverVM allows your code to run indefinitely, making it ideal for long-running processes and applications.
Details
foreverVM
| repo | version |
|--||
| cli | |
| sdk |
|
foreverVM provides an API for running arbitrary, stateful Python code securely.
The core concepts in foreverVM are machines and instructions.
Machines represent a stateful Python process. You interact with a machine by running instructions (Python statements and expressions) on it, and receiving the results. A machine processes one instruction at a time.
Getting started
You will need an API token (if you need one, reach out to paul@jamsocket.com).
The easiest way to try out foreverVM is using the CLI. First, you will need to log in:
npx forevervm login
Once logged in, you can open a REPL interface with a new machine:
npx forevervm repl
When foreverVM starts your machine, it gives it an ID that you can later use to reconnect to it. You can reconnect to a machine like this:
npx forevervm repl [machine_name]
You can list your machines (in reverse order of creation) like this:
npx forevervm machine list
You don't need to terminate machines -- foreverVM will automatically swap them from memory to disk when they are idle, and then automatically swap them back when needed. This is what allows foreverVM to run repls “forever”.
Using the API
import { ForeverVM } from '@forevervm/sdk'
const token = process.env.FOREVERVM_TOKEN
if (!token) {
throw new Error('FOREVERVM_TOKEN is not set')
}
// Initialize foreverVM
const fvm = new ForeverVM({ token })
// Connect to a new machine.
const repl = fvm.repl()
// Execute some code
let execResult = repl.exec('4 + 4')
// Get the result
console.log('result:', await execResult.result)
// We can also print stdout and stderr
execResult = repl.exec('for i in range(10):\n print(i)')
for await (const output of execResult.output) {
console.log(output.stream, output.data)
}
process.exit(0)
Working with Tags
You can create machines with tags and filter machines by tags:
import { ForeverVM } from '@forevervm/sdk'
const fvm = new ForeverVM({ token: process.env.FOREVERVM_TOKEN })
// Create a machine with tags
const machineResponse = await fvm.createMachine({
tags: {
env: 'production',
owner: 'user123',
project: 'demo'
}
})
// List machines filtered by tags
const productionMachines = await fvm.listMachines({
tags: { env: 'production' }
})
Memory Limits
You can create machines with memory limits by specifying the memory size in megabytes:
// Create a machine with 512MB memory limit
const machineResponse = await fvm.createMachine({
memory_mb: 512,
})
Server Config
{
"mcpServers": {
"mcp-server": {
"command": "docker",
"args": [
"run",
"-i",
"--rm",
"ghcr.io/metorial/mcp-container--jamsocket--forevervm--mcp-server",
"npm run start"
],
"env": {
"FOREVERVM_TOKEN": "forevervm-token"
}
}
}
}