Skip to content

About

Modal inference and sandboxing provider for MagicMtn.

Topics

Resources

Contributing

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

MagicMtn logo

Apache 2.0 license Code coverage

View in the Provider Registry  •  Contributing

Modal provider for MagicMtn

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.

Set up Modal

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.

Build and install

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_PACKAGE

Replace 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.

Run inference

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.

Run a sandbox

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" --yes

See the usage guide for runtime behavior and SDK integration, and CONTRIBUTING.md for development and packaging.

License

Apache License 2.0.

About

Modal inference and sandboxing provider for MagicMtn.

Topics

Resources

Contributing

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages