Skip to content

mvmforge

Decorate a Python or TypeScript function. Get a Nix flake + launch plan that mvm boots into a microVM.

import mvm
@mvm.func(name="adder")
async def add(a: int, b: int) -> int:
return a + b
await add(2, 3) # runs in a microVM
add.local(2, 3) # runs in-process (for tests)
import { func } from "mvm-sdk";
export const add = func({ name: "adder" })(function add(a: number, b: number) {
return a + b;
});
await add(2, 3);

That’s the surface. Both languages emit byte-identical IR; the host CLI turns IR into a Nix flake plus a launch plan plus a deterministic source/ bundle.

Run it

Terminal window
cargo install --path crates/mvmforge # from a clone
pip install mvm-sdk # or: pnpm add mvm-sdk
mvmforge init my-app && cd my-app
mvmforge up app.py

mvmforge init writes a working starter. mvmforge up walks emit → compile → boot. Without a real mvmctl on PATH, point MVMFORGE_MVM_BIN at tests/fixtures/fake-mvm to iterate the SDK without booting anything.

If something breaks, run mvmforge doctor.

Status

Pre-1.0. The bits below are stable enough to build on but the schema and wire contract are versioned through the compatibility matrix — pin a row.

  • mvmforge 0.1.0 ↔ mvm-sdk 0.1.2 (Python + TS) ↔ mvm b2137b0.
  • Real-VM boot validated on x86_64-linux and aarch64-linux. macOS users use Lima or the bundled fake-mvm shim.
  • The artifact pipeline is byte-reproducible (mvmforge compile --out workload.tar.gz is content-addressable). Determinism is asserted in CI on every example.
  • Function workloads default to deny-all networking; granular grants go through network=mv.network(...) and reject wildcard hosts at build time.

Read more