View in the Provider Registry • Contributing
Run MagicMtn sandboxes and chat inference on Modal. Launch a Linux VM from a prepared image, run commands in its workspace, and terminate it from a standalone MagicMtn installation or a Rust SDK host.
Install the provider with magic provider install modal and configure a token for your Modal workspace. Installation includes a private Python runtime and the Modal SDK. Configuration creates or selects an app named magicmtn and establishes account access; use --option app=NAME to choose another app name. MagicMtn prepares Canonical or your custom Linux AMD64 image on Modal and saves the resulting image ID locally. See the setup guide.
Install MagicMtn, Rust with edition 2024 support, Python 3, and uv==0.13.10. Keep this checkout beside the magicmtn checkout and use the pinned SDK revision. Packaging builds the private Python runtime and installs the hash-locked dependencies into it.
test -f .cargo/config.toml || cp .cargo/config.toml.example .cargo/config.toml
./package.sh
magic provider install --file PATH_TO_PACKAGEReplace PATH_TO_PACKAGE with the path printed by package.sh. Start the local server, then configure the token with magic provider configure modal --secret-file ./modal-credentials.json. Follow the setup guide for image preparation.
Configure your workspace token with magic provider configure modal --secret-file ./modal-credentials.json. When the host creates an inference deployment for a selected model, the provider provisions its endpoint, discovers its URL, and manages the inference credentials. The provider implements InferenceBackend for chat, tool calls, and usage reporting, InferenceDeploymentBackend for endpoint creation, inspection, and deletion, and SandboxBackend for isolated compute. See the inference setup and SDK example.
Prepare Canonical and create a sandbox from that catalog selection:
magic images prepare canonical --provider modal
sandbox_id=$(magic computer new --provider modal --image canonical)
magic computer exec "$sandbox_id" -- /bin/echo "Hello from Modal"
magic computer terminate "$sandbox_id" --yesSee the usage guide for runtime behavior and SDK integration, and CONTRIBUTING.md for development and packaging.