TOOL WIKI · RUNTIME & DEPLOYMENT

Modal

Runs application functions and compute workloads in managed environments.

Download example files Code + setup + checks in a ZIP
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.

Official reference · Modal

WHAT IT ISApplication compute platform
WHERE IT FITSRuntime & deployment
SEE HOW THE SYSTEM FITS TOGETHERSELECT A COMPONENT
inputprocessresultcheckoutputTask requestGoal + resource budgetModalApplication compute platformWorker environmentScoped executionExternal operationsAuthorized servicesArtifacts + outcomeValidate the resultLifecyclePersist or clean up
  1. Set the allowed runtime, network access, credentials, and maximum duration.

  2. Agent tools or processing jobs that need hosted compute. Match startup time and resource requirements to the user’s latency budget.

  3. Run only the workload and dependencies required for the task.

  4. Check permissions at each resource service and reconcile uncertain writes.

  5. Inspect files, records, and task-level acceptance criteria.

  6. Retain required artifacts, release temporary compute, and expire task credentials.

    Result or stopping point
Modal

Agent tools or processing jobs that need hosted compute. Match startup time and resource requirements to the user’s latency budget.

Follow the arrows, then select a component to inspect its responsibility. On mobile, downward arrows connect the next step; bent arrows identify branches and return paths. Select a destination to jump to that component.

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.
Shell
python3 -m venv .venv
source .venv/bin/activate
pip install modal
modal setup

Try a small integration

job.py

Python · 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

Shell
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

An agent that can pause and resumeA browser or coding agent in a sandbox

Explore the same layer

TemporalInngestTrigger.devE2B

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.