TOOL WIKI · RUNTIME & DEPLOYMENT
Modal
Runs application functions and compute workloads in managed environments.
Jump to a section 10 sections
EXAMPLE USE CASE
Run a support lookup as a remote function
A developer needs a concrete execution environment for a background task, browser operation or service, with a visible terminal result.
- Input
- A104 sent to the deployed Modal function.
- Expected output
- A remote packed result returned to the local entrypoint.
- Success check: A remote CPU function returns the fixture result and exits.
- Try a failure: Use A999 to verify the missing-record path and inspect remote function failures.
Example scope: Actual remote CPU execution of a fixture; model loading and authenticated application access are separate.
Set the allowed runtime, network access, credentials, and maximum duration.
inputTo 02 · ModalAgent tools or processing jobs that need hosted compute. Match startup time and resource requirements to the user’s latency budget.
processTo 03 · Worker environmentRun only the workload and dependencies required for the task.
Check permissions at each resource service and reconcile uncertain writes.
Inspect files, records, and task-level acceptance criteria.
outputTo 06 · LifecycleRetain required artifacts, release temporary compute, and expire task credentials.
Result or stopping point
Agent tools or processing jobs that need hosted compute. Match startup time and resource requirements to the user’s latency budget.
When to consider it
- Agent tools or processing jobs that need hosted compute.
A design decision to make
- Match startup time and resource requirements to the user’s latency budget.
Prerequisites and setup
- A Modal account with workload access and Python 3.11+. modal setup performs your normal account authentication.
python3 -m venv .venv
source .venv/bin/activate
pip install modal
modal setupTry a small integration
job.py
import modal
app = modal.App("asg-order-demo")
@app.function(timeout=30)
def lookup(order_id: str) -> dict:
return {"order_id":order_id,"status":{"A104":"packed"}.get(order_id,"not_found")}
@app.local_entrypoint()
def main():
print(lookup.remote("A104"))Run and check the result
modal run job.py- A remote CPU function returns the fixture result and exits.
- The local entrypoint is the caller; the decorated function executes on Modal.
Common failures
- A worker accepting a job does not establish completion. Inspect the task result, failure and retry history.
- Do not expose a development control plane or unauthenticated execution endpoint publicly.
Production decisions
- Use bounded CPU/memory/time, restricted filesystem mounts and network access, short-lived secrets and per-user isolation.
- Preserve run/operation identifiers, cancellation and terminal states. Retryable remote writes need provider idempotency or reconciliation.
- Pin container dependencies, set concurrency/scaling limits and use scoped Modal secrets for workloads that need credentials.
Keep exploring
Explore the same layer
Compare candidates on your own workload. This entry describes a product’s role; it is not a claim that products in the category are interchangeable.