pyproc is a browser computer built around an owned, worker-hosted CPython 3.14 WASI kernel. The npm package includes the verified engine and standard library, so the default runtime does not require a separate engine download or a remote execution service.
npm install pyprocServe the installed package from the same origin as your application.
The supported production browser boundary is current Chromium and Edge with SharedArrayBuffer and
cross-origin isolation enabled.
Serve every page that boots pyproc with these headers:
Cross-Origin-Opener-Policy: same-origin
Cross-Origin-Embedder-Policy: require-corp
Vite (vite.config.js):
exportdefault{server: {headers: {"Cross-Origin-Opener-Policy": "same-origin","Cross-Origin-Embedder-Policy": "require-corp",},},preview: {headers: {"Cross-Origin-Opener-Policy": "same-origin","Cross-Origin-Embedder-Policy": "require-corp",},},};Next.js (next.config.js):
module.exports={asyncheaders(){return[{source: "/:path*",headers: [{key: "Cross-Origin-Opener-Policy",value: "same-origin"},{key: "Cross-Origin-Embedder-Policy",value: "require-corp"},],}];},};Confirm the installed package and headers on this machine:
npx pyproc-playgroundcheckEnvironment() reports the same Setup requirements when the page is missing a header or JSPI.
import{boot}from"pyproc";constmachine=awaitboot();constreceipt=awaitmachine.run.python("print(sum(range(100)))");console.log(receipt.output);// 4950awaitmachine.close();Every execution returns a structured receipt. Python exceptions produce a stable PyProcError with
code === "PYPROC_KERNEL_EXECUTION_ERROR".
import{boot,open}from"pyproc";constmachine=awaitboot({deterministic: true});awaitmachine.run.python("counter = 41");constimage=awaitmachine.history.export();awaitmachine.close();constrestored=awaitopen(image);console.log(awaitrestored.run.get("counter"));// 41awaitrestored.close();A Machine image carries a verified engine reference and content-addressed checkpoint objects. It does not duplicate the engine binary.
Checkpoint, restore, and export live on machine.history.
Install with the same commands a Python session already uses:
awaitmachine.run.python(`%pip install pyproc-native-host==1.0.0import pyproc_native_hostprint(pyproc_native_host.ABI_VERSION)`);python -m pip install ... is the same door. import is ordinary CPython import. subprocess pip and
arbitrary native wheels are outside this engine: there is no OS process, and WASI cannot load those ABIs.
The package environment is the host contract
behind those Python commands.
Default boot() stays the owned WASI kernel. When createWebComputer({ linux }) has a linuxOs
guest, the same computer also exposes native Linux CPython over that guest's serial console:
import{createWebComputer}from"pyproc";constcomputer=createWebComputer({linux: {V86, manifest }});awaitcomputer.bootAll();if(computer.linuxPython.available){awaitcomputer.linuxPython.run("print(40 + 2)");awaitcomputer.linuxPython.pip(["install","demo==1.0.0"]);}This door does not replace boot(). The consumer supplies V86 and a Linux image that actually
contains python3. The slim Buildroot linux image stays without CPython. The separate
buildroot-pyproc-python-i686.bin profile is the image that carries CPython 3.12.13 and pip:
npm run assets:buildroot-pythonMachine Entrance starts the installed
pyproc-control and MCP path. The API reference
and platform requirements cover the
remaining doors.
Mozilla Public License 2.0. Copyright 2026 eddmpython.