modal serve

Run a web endpoint(s) associated with a Modal stub and hot-reload code.

Examples:

modal serve hello_world.py

Usage:

modal serve [OPTIONS] STUB_REF

Arguments:

  • STUB_REF: Path to a Python file with a stub. [required]

Options:

  • --timeout FLOAT
  • --env TEXT: Environment to interact with

If none is specified, Modal will use the default environment of your current profile (can also be specified via the environment variable MODAL_ENVIRONMENT). If neither is set, Modal will assume there is only one environment in the active workspace and use that one, or raise an error if there are multiple environments.

  • --help: Show this message and exit.