Modal can instantly scale to hundreds of containers for your Function. Let’s invoke our Function with .map to process 100 inputs in parallel.

  1. We’ll need a way to call the Function outside of the command line. One way to do this is to invoke the Modal Function from another function. Wrap the local caller function with @app.local_entrypoint.
  2. Call the Modal Function with .map and pass in a list of inputs.

$ modal run scaling_out.py