Modal
Modal is a serverless cloud for AI, data, and general compute. Developers define infrastructure as code in Python (with JavaScript and Go SDKs) and run functions, GPUs, sandboxes, web endpoints, cron jobs, and volumes on demand. The primary developer interface is the Modal SDK and CLI communicating with a gRPC backend, not a conventional first-party REST API. User-deployed Modal Functions can be exposed as HTTPS web endpoints (@modal.fastapi_endpoint / asgi_app / wsgi_app / web_server) on *.modal.run, and Sandboxes can expose ports via network tunnels.
APIs
Modal Functions and Remote Invocation
Decorate Python functions with @app.function to run them remotely on Modal's cloud. Invoke deployed functions synchronously (.remote), asynchronously (.spawn), in parallel (.map...
Modal Web Endpoints
The genuine HTTPS surface of the platform. User functions decorated with @modal.fastapi_endpoint, @modal.asgi_app, @modal.wsgi_app, or @modal.web_server are auto-deployed as HTT...
Modal Sandboxes
Secure containers for executing untrusted user or agent-generated code, created via Sandbox.create() in the Python, JavaScript, and Go SDKs. Supports exec() for arbitrary comman...
Modal Volumes
Distributed, high-performance file system volumes for sharing state across functions and containers, managed via modal.Volume in the SDK and the `modal volume` CLI. Read/write, ...
Modal Dicts and Queues
Distributed key-value store (modal.Dict) and distributed queue (modal.Queue) for passing state and messages between functions and containers. Accessed exclusively through the SD...
Modal Secrets
Securely inject environment variables and credentials into functions and sandboxes via modal.Secret, managed in the dashboard, CLI, or SDK (Secret.from_name / from_dict). SDK/CL...
Modal Cron and Scheduled Functions
Run functions on a recurring schedule using modal.Period or modal.Cron passed to @app.function(schedule=...). Schedules are declared in code and managed through deployment; ther...
Modal Images and GPU
Define container images programmatically with modal.Image (from_registry, debian_slim, pip_install, run_commands) and attach GPUs by passing gpu= (T4, L4, A10, L40S, A100, H100,...
Modal CLI
The `modal` command-line interface for deploying apps, running functions, tailing logs, managing volumes/secrets/dicts, and launching shells. Wraps the same gRPC control plane t...