modal 1.6.3.dev12__tar.gz → 1.6.4__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (258) hide show
  1. {modal-1.6.3.dev12 → modal-1.6.4}/PKG-INFO +1 -1
  2. {modal-1.6.3.dev12 → modal-1.6.4}/modal/__init__.py +11 -0
  3. {modal-1.6.3.dev12 → modal-1.6.4}/modal/__main__.py +2 -1
  4. modal-1.6.4/modal/_audit_logs/__init__.py +1 -0
  5. modal-1.6.4/modal/_audit_logs/_rpcs.py +66 -0
  6. modal-1.6.4/modal/_audit_logs/count.py +17 -0
  7. modal-1.6.4/modal/_audit_logs/list.py +83 -0
  8. {modal-1.6.3.dev12 → modal-1.6.4}/modal/_cluster.py +1 -1
  9. {modal-1.6.3.dev12 → modal-1.6.4}/modal/_environments.py +1 -1
  10. {modal-1.6.3.dev12 → modal-1.6.4}/modal/_function_variants.py +1 -0
  11. {modal-1.6.3.dev12 → modal-1.6.4}/modal/_functions.py +42 -7
  12. {modal-1.6.3.dev12 → modal-1.6.4}/modal/_image.py +107 -42
  13. {modal-1.6.3.dev12 → modal-1.6.4}/modal/_object.py +17 -11
  14. {modal-1.6.3.dev12 → modal-1.6.4}/modal/_output/manager.py +4 -3
  15. {modal-1.6.3.dev12 → modal-1.6.4}/modal/_output/rich.py +18 -5
  16. {modal-1.6.3.dev12 → modal-1.6.4}/modal/_runtime/task_lifecycle_manager.py +24 -3
  17. {modal-1.6.3.dev12 → modal-1.6.4}/modal/_runtime/task_lifecycle_manager.pyi +6 -0
  18. {modal-1.6.3.dev12 → modal-1.6.4}/modal/_server.py +10 -4
  19. {modal-1.6.3.dev12 → modal-1.6.4}/modal/_server.pyi +8 -1
  20. {modal-1.6.3.dev12 → modal-1.6.4}/modal/_type_manager.py +7 -0
  21. {modal-1.6.3.dev12 → modal-1.6.4}/modal/_utils/async_utils.py +23 -5
  22. {modal-1.6.3.dev12 → modal-1.6.4}/modal/_utils/auth_token_manager.py +17 -0
  23. {modal-1.6.3.dev12 → modal-1.6.4}/modal/_utils/docker_utils.py +10 -1
  24. {modal-1.6.3.dev12 → modal-1.6.4}/modal/_utils/http_utils.py +9 -3
  25. {modal-1.6.3.dev12 → modal-1.6.4}/modal/_utils/name_utils.py +8 -1
  26. {modal-1.6.3.dev12 → modal-1.6.4}/modal/_workspace.py +57 -1
  27. {modal-1.6.3.dev12 → modal-1.6.4}/modal/app.py +161 -17
  28. {modal-1.6.3.dev12 → modal-1.6.4}/modal/app.pyi +309 -9
  29. modal-1.6.4/modal/builder/PREVIEW.txt +17 -0
  30. {modal-1.6.3.dev12 → modal-1.6.4}/modal/builder/base-images.json +3 -0
  31. {modal-1.6.3.dev12 → modal-1.6.4}/modal/cli/_help.py +107 -15
  32. modal-1.6.4/modal/cli/_suggest.py +155 -0
  33. {modal-1.6.3.dev12 → modal-1.6.4}/modal/cli/app.py +221 -2
  34. {modal-1.6.3.dev12 → modal-1.6.4}/modal/cli/endpoint.py +213 -7
  35. {modal-1.6.3.dev12 → modal-1.6.4}/modal/cli/function.py +1 -13
  36. modal-1.6.4/modal/cli/image.py +529 -0
  37. {modal-1.6.3.dev12 → modal-1.6.4}/modal/cli/import_refs.py +7 -4
  38. {modal-1.6.3.dev12 → modal-1.6.4}/modal/cli/profile.py +41 -30
  39. {modal-1.6.3.dev12 → modal-1.6.4}/modal/cli/run.py +66 -26
  40. {modal-1.6.3.dev12 → modal-1.6.4}/modal/cli/server.py +565 -3
  41. {modal-1.6.3.dev12 → modal-1.6.4}/modal/cli/shell.py +3 -17
  42. {modal-1.6.3.dev12 → modal-1.6.4}/modal/cli/token.py +83 -14
  43. {modal-1.6.3.dev12 → modal-1.6.4}/modal/cli/utils.py +60 -2
  44. {modal-1.6.3.dev12 → modal-1.6.4}/modal/cli/workspace.py +97 -1
  45. {modal-1.6.3.dev12 → modal-1.6.4}/modal/client.py +75 -27
  46. {modal-1.6.3.dev12 → modal-1.6.4}/modal/client.pyi +45 -14
  47. {modal-1.6.3.dev12 → modal-1.6.4}/modal/cls.py +1 -1
  48. {modal-1.6.3.dev12 → modal-1.6.4}/modal/config.py +22 -10
  49. {modal-1.6.3.dev12 → modal-1.6.4}/modal/dict.py +1 -1
  50. {modal-1.6.3.dev12 → modal-1.6.4}/modal/experimental/__init__.py +9 -0
  51. modal-1.6.4/modal/experimental/stream.py +889 -0
  52. modal-1.6.4/modal/experimental/stream.pyi +1072 -0
  53. {modal-1.6.3.dev12 → modal-1.6.4}/modal/functions.pyi +14 -6
  54. {modal-1.6.3.dev12 → modal-1.6.4}/modal/image.pyi +47 -26
  55. {modal-1.6.3.dev12 → modal-1.6.4}/modal/io_streams.py +26 -14
  56. {modal-1.6.3.dev12 → modal-1.6.4}/modal/io_streams.pyi +2 -0
  57. {modal-1.6.3.dev12 → modal-1.6.4}/modal/mount.py +11 -2
  58. {modal-1.6.3.dev12 → modal-1.6.4}/modal/network_file_system.py +1 -1
  59. {modal-1.6.3.dev12 → modal-1.6.4}/modal/object.pyi +3 -1
  60. {modal-1.6.3.dev12 → modal-1.6.4}/modal/proxy.py +1 -1
  61. {modal-1.6.3.dev12 → modal-1.6.4}/modal/queue.py +1 -1
  62. {modal-1.6.3.dev12 → modal-1.6.4}/modal/runner.py +10 -7
  63. {modal-1.6.3.dev12 → modal-1.6.4}/modal/runner.pyi +5 -0
  64. {modal-1.6.3.dev12 → modal-1.6.4}/modal/sandbox/_common.py +1 -1
  65. {modal-1.6.3.dev12 → modal-1.6.4}/modal/sandbox/_impl_persistent.py +11 -2
  66. {modal-1.6.3.dev12 → modal-1.6.4}/modal/sandbox/_sandbox.py +65 -3
  67. {modal-1.6.3.dev12 → modal-1.6.4}/modal/sandbox/_sidecar.py +1 -1
  68. {modal-1.6.3.dev12 → modal-1.6.4}/modal/sandbox/_snapshot.py +1 -1
  69. {modal-1.6.3.dev12 → modal-1.6.4}/modal/sandbox/_task_command_router_client.py +33 -5
  70. {modal-1.6.3.dev12 → modal-1.6.4}/modal/sandbox/sandbox.pyi +107 -1
  71. {modal-1.6.3.dev12 → modal-1.6.4}/modal/secret.py +16 -8
  72. {modal-1.6.3.dev12 → modal-1.6.4}/modal/secret.pyi +3 -3
  73. {modal-1.6.3.dev12 → modal-1.6.4}/modal/server.pyi +3 -1
  74. {modal-1.6.3.dev12 → modal-1.6.4}/modal/token_flow.py +32 -2
  75. {modal-1.6.3.dev12 → modal-1.6.4}/modal/token_flow.pyi +2 -0
  76. {modal-1.6.3.dev12 → modal-1.6.4}/modal/types.py +205 -2
  77. {modal-1.6.3.dev12 → modal-1.6.4}/modal/volume.py +1 -1
  78. {modal-1.6.3.dev12 → modal-1.6.4}/modal/workspace.pyi +104 -0
  79. {modal-1.6.3.dev12 → modal-1.6.4}/modal.egg-info/PKG-INFO +1 -1
  80. {modal-1.6.3.dev12 → modal-1.6.4}/modal.egg-info/SOURCES.txt +8 -0
  81. {modal-1.6.3.dev12 → modal-1.6.4}/modal_proto/api_grpc.py +160 -0
  82. {modal-1.6.3.dev12 → modal-1.6.4}/modal_proto/api_pb2.py +2006 -1627
  83. {modal-1.6.3.dev12 → modal-1.6.4}/modal_proto/api_pb2.pyi +906 -84
  84. {modal-1.6.3.dev12 → modal-1.6.4}/modal_proto/api_pb2_grpc.py +333 -0
  85. {modal-1.6.3.dev12 → modal-1.6.4}/modal_proto/api_pb2_grpc.pyi +106 -0
  86. {modal-1.6.3.dev12 → modal-1.6.4}/modal_proto/modal_api_grpc.py +10 -0
  87. {modal-1.6.3.dev12 → modal-1.6.4}/modal_version/__init__.py +1 -1
  88. {modal-1.6.3.dev12 → modal-1.6.4}/pyproject.toml +4 -3
  89. modal-1.6.3.dev12/modal/cli/image.py +0 -243
  90. {modal-1.6.3.dev12 → modal-1.6.4}/LICENSE +0 -0
  91. {modal-1.6.3.dev12 → modal-1.6.4}/README.md +0 -0
  92. {modal-1.6.3.dev12 → modal-1.6.4}/modal/_billing.py +0 -0
  93. {modal-1.6.3.dev12 → modal-1.6.4}/modal/_cluster.pyi +0 -0
  94. {modal-1.6.3.dev12 → modal-1.6.4}/modal/_container_entrypoint.py +0 -0
  95. {modal-1.6.3.dev12 → modal-1.6.4}/modal/_grpc_client.py +0 -0
  96. {modal-1.6.3.dev12 → modal-1.6.4}/modal/_ipython.py +0 -0
  97. {modal-1.6.3.dev12 → modal-1.6.4}/modal/_load_context.py +0 -0
  98. {modal-1.6.3.dev12 → modal-1.6.4}/modal/_location.py +0 -0
  99. {modal-1.6.3.dev12 → modal-1.6.4}/modal/_logs.py +0 -0
  100. {modal-1.6.3.dev12 → modal-1.6.4}/modal/_logs_manager.py +0 -0
  101. {modal-1.6.3.dev12 → modal-1.6.4}/modal/_logs_manager.pyi +0 -0
  102. {modal-1.6.3.dev12 → modal-1.6.4}/modal/_metrics.py +0 -0
  103. {modal-1.6.3.dev12 → modal-1.6.4}/modal/_metrics.pyi +0 -0
  104. {modal-1.6.3.dev12 → modal-1.6.4}/modal/_outbound_policy.py +0 -0
  105. {modal-1.6.3.dev12 → modal-1.6.4}/modal/_outbound_policy.pyi +0 -0
  106. {modal-1.6.3.dev12 → modal-1.6.4}/modal/_output/__init__.py +0 -0
  107. {modal-1.6.3.dev12 → modal-1.6.4}/modal/_output/pty.py +0 -0
  108. {modal-1.6.3.dev12 → modal-1.6.4}/modal/_output/status.py +0 -0
  109. {modal-1.6.3.dev12 → modal-1.6.4}/modal/_partial_function.py +0 -0
  110. {modal-1.6.3.dev12 → modal-1.6.4}/modal/_resolver.py +0 -0
  111. {modal-1.6.3.dev12 → modal-1.6.4}/modal/_resources.py +0 -0
  112. {modal-1.6.3.dev12 → modal-1.6.4}/modal/_runtime/__init__.py +0 -0
  113. {modal-1.6.3.dev12 → modal-1.6.4}/modal/_runtime/asgi.py +0 -0
  114. {modal-1.6.3.dev12 → modal-1.6.4}/modal/_runtime/container_io_manager.py +0 -0
  115. {modal-1.6.3.dev12 → modal-1.6.4}/modal/_runtime/container_io_manager.pyi +0 -0
  116. {modal-1.6.3.dev12 → modal-1.6.4}/modal/_runtime/execution_context.py +0 -0
  117. {modal-1.6.3.dev12 → modal-1.6.4}/modal/_runtime/execution_context.pyi +0 -0
  118. {modal-1.6.3.dev12 → modal-1.6.4}/modal/_runtime/gpu_memory_snapshot.py +0 -0
  119. {modal-1.6.3.dev12 → modal-1.6.4}/modal/_runtime/telemetry.py +0 -0
  120. {modal-1.6.3.dev12 → modal-1.6.4}/modal/_runtime/user_code_event_loop.py +0 -0
  121. {modal-1.6.3.dev12 → modal-1.6.4}/modal/_runtime/user_code_imports.py +0 -0
  122. {modal-1.6.3.dev12 → modal-1.6.4}/modal/_serialization.py +0 -0
  123. {modal-1.6.3.dev12 → modal-1.6.4}/modal/_supports_logs.py +0 -0
  124. {modal-1.6.3.dev12 → modal-1.6.4}/modal/_traceback.py +0 -0
  125. {modal-1.6.3.dev12 → modal-1.6.4}/modal/_tunnel.py +0 -0
  126. {modal-1.6.3.dev12 → modal-1.6.4}/modal/_tunnel.pyi +0 -0
  127. {modal-1.6.3.dev12 → modal-1.6.4}/modal/_utils/__init__.py +0 -0
  128. {modal-1.6.3.dev12 → modal-1.6.4}/modal/_utils/app_utils.py +0 -0
  129. {modal-1.6.3.dev12 → modal-1.6.4}/modal/_utils/blob_utils.py +0 -0
  130. {modal-1.6.3.dev12 → modal-1.6.4}/modal/_utils/browser_utils.py +0 -0
  131. {modal-1.6.3.dev12 → modal-1.6.4}/modal/_utils/bytes_io_segment_payload.py +0 -0
  132. {modal-1.6.3.dev12 → modal-1.6.4}/modal/_utils/curl_utils.py +0 -0
  133. {modal-1.6.3.dev12 → modal-1.6.4}/modal/_utils/deprecation.py +0 -0
  134. {modal-1.6.3.dev12 → modal-1.6.4}/modal/_utils/display_utils.py +0 -0
  135. {modal-1.6.3.dev12 → modal-1.6.4}/modal/_utils/function_utils.py +0 -0
  136. {modal-1.6.3.dev12 → modal-1.6.4}/modal/_utils/git_utils.py +0 -0
  137. {modal-1.6.3.dev12 → modal-1.6.4}/modal/_utils/grpc_testing.py +0 -0
  138. {modal-1.6.3.dev12 → modal-1.6.4}/modal/_utils/grpc_utils.py +0 -0
  139. {modal-1.6.3.dev12 → modal-1.6.4}/modal/_utils/hash_utils.py +0 -0
  140. {modal-1.6.3.dev12 → modal-1.6.4}/modal/_utils/idle_countdown.py +0 -0
  141. {modal-1.6.3.dev12 → modal-1.6.4}/modal/_utils/jwt_utils.py +0 -0
  142. {modal-1.6.3.dev12 → modal-1.6.4}/modal/_utils/logger.py +0 -0
  143. {modal-1.6.3.dev12 → modal-1.6.4}/modal/_utils/mount_utils.py +0 -0
  144. {modal-1.6.3.dev12 → modal-1.6.4}/modal/_utils/oauth.py +0 -0
  145. {modal-1.6.3.dev12 → modal-1.6.4}/modal/_utils/package_utils.py +0 -0
  146. {modal-1.6.3.dev12 → modal-1.6.4}/modal/_utils/pattern_utils.py +0 -0
  147. {modal-1.6.3.dev12 → modal-1.6.4}/modal/_utils/proxy_support.py +0 -0
  148. {modal-1.6.3.dev12 → modal-1.6.4}/modal/_utils/rand_pb_testing.py +0 -0
  149. {modal-1.6.3.dev12 → modal-1.6.4}/modal/_utils/sandbox_fs_utils.py +0 -0
  150. {modal-1.6.3.dev12 → modal-1.6.4}/modal/_utils/shell_utils.py +0 -0
  151. {modal-1.6.3.dev12 → modal-1.6.4}/modal/_utils/time_utils.py +0 -0
  152. {modal-1.6.3.dev12 → modal-1.6.4}/modal/_vendor/__init__.py +0 -0
  153. {modal-1.6.3.dev12 → modal-1.6.4}/modal/_vendor/a2wsgi_wsgi.py +0 -0
  154. {modal-1.6.3.dev12 → modal-1.6.4}/modal/_vendor/cloudpickle.py +0 -0
  155. {modal-1.6.3.dev12 → modal-1.6.4}/modal/_vendor/tblib.py +0 -0
  156. {modal-1.6.3.dev12 → modal-1.6.4}/modal/_vendor/version.py +0 -0
  157. {modal-1.6.3.dev12 → modal-1.6.4}/modal/_watcher.py +0 -0
  158. {modal-1.6.3.dev12 → modal-1.6.4}/modal/billing.py +0 -0
  159. {modal-1.6.3.dev12 → modal-1.6.4}/modal/billing.pyi +0 -0
  160. {modal-1.6.3.dev12 → modal-1.6.4}/modal/builder/2023.12.312.txt +0 -0
  161. {modal-1.6.3.dev12 → modal-1.6.4}/modal/builder/2023.12.txt +0 -0
  162. {modal-1.6.3.dev12 → modal-1.6.4}/modal/builder/2024.04.txt +0 -0
  163. {modal-1.6.3.dev12 → modal-1.6.4}/modal/builder/2024.10.txt +0 -0
  164. {modal-1.6.3.dev12 → modal-1.6.4}/modal/builder/2025.06.txt +0 -0
  165. /modal-1.6.3.dev12/modal/builder/PREVIEW.txt → /modal-1.6.4/modal/builder/2026.10.txt +0 -0
  166. {modal-1.6.3.dev12 → modal-1.6.4}/modal/builder/README.md +0 -0
  167. {modal-1.6.3.dev12 → modal-1.6.4}/modal/call_graph.py +0 -0
  168. {modal-1.6.3.dev12 → modal-1.6.4}/modal/cli/__init__.py +0 -0
  169. {modal-1.6.3.dev12 → modal-1.6.4}/modal/cli/_download.py +0 -0
  170. {modal-1.6.3.dev12 → modal-1.6.4}/modal/cli/_logs.py +0 -0
  171. {modal-1.6.3.dev12 → modal-1.6.4}/modal/cli/_stats.py +0 -0
  172. {modal-1.6.3.dev12 → modal-1.6.4}/modal/cli/_traceback.py +0 -0
  173. {modal-1.6.3.dev12 → modal-1.6.4}/modal/cli/billing.py +0 -0
  174. {modal-1.6.3.dev12 → modal-1.6.4}/modal/cli/changelog.py +0 -0
  175. {modal-1.6.3.dev12 → modal-1.6.4}/modal/cli/config.py +0 -0
  176. {modal-1.6.3.dev12 → modal-1.6.4}/modal/cli/container.py +0 -0
  177. {modal-1.6.3.dev12 → modal-1.6.4}/modal/cli/curl.py +0 -0
  178. {modal-1.6.3.dev12 → modal-1.6.4}/modal/cli/dashboard.py +0 -0
  179. {modal-1.6.3.dev12 → modal-1.6.4}/modal/cli/dict.py +0 -0
  180. {modal-1.6.3.dev12 → modal-1.6.4}/modal/cli/entry_point.py +0 -0
  181. {modal-1.6.3.dev12 → modal-1.6.4}/modal/cli/environment.py +0 -0
  182. {modal-1.6.3.dev12 → modal-1.6.4}/modal/cli/logo.py +0 -0
  183. {modal-1.6.3.dev12 → modal-1.6.4}/modal/cli/network_file_system.py +0 -0
  184. {modal-1.6.3.dev12 → modal-1.6.4}/modal/cli/queues.py +0 -0
  185. {modal-1.6.3.dev12 → modal-1.6.4}/modal/cli/secret.py +0 -0
  186. {modal-1.6.3.dev12 → modal-1.6.4}/modal/cli/selector.py +0 -0
  187. {modal-1.6.3.dev12 → modal-1.6.4}/modal/cli/skills.py +0 -0
  188. {modal-1.6.3.dev12 → modal-1.6.4}/modal/cli/volume.py +0 -0
  189. {modal-1.6.3.dev12 → modal-1.6.4}/modal/cloud_bucket_mount.py +0 -0
  190. {modal-1.6.3.dev12 → modal-1.6.4}/modal/cloud_bucket_mount.pyi +0 -0
  191. {modal-1.6.3.dev12 → modal-1.6.4}/modal/cls.pyi +0 -0
  192. {modal-1.6.3.dev12 → modal-1.6.4}/modal/cluster.py +0 -0
  193. {modal-1.6.3.dev12 → modal-1.6.4}/modal/cluster.pyi +0 -0
  194. {modal-1.6.3.dev12 → modal-1.6.4}/modal/container_process.py +0 -0
  195. {modal-1.6.3.dev12 → modal-1.6.4}/modal/container_process.pyi +0 -0
  196. {modal-1.6.3.dev12 → modal-1.6.4}/modal/dict.pyi +0 -0
  197. {modal-1.6.3.dev12 → modal-1.6.4}/modal/environments.py +0 -0
  198. {modal-1.6.3.dev12 → modal-1.6.4}/modal/environments.pyi +0 -0
  199. {modal-1.6.3.dev12 → modal-1.6.4}/modal/exception.py +0 -0
  200. {modal-1.6.3.dev12 → modal-1.6.4}/modal/experimental/_flash_container_entry.py +0 -0
  201. {modal-1.6.3.dev12 → modal-1.6.4}/modal/experimental/flash.py +0 -0
  202. {modal-1.6.3.dev12 → modal-1.6.4}/modal/experimental/flash.pyi +0 -0
  203. {modal-1.6.3.dev12 → modal-1.6.4}/modal/experimental/flash_server.py +0 -0
  204. {modal-1.6.3.dev12 → modal-1.6.4}/modal/experimental/flash_server.pyi +0 -0
  205. {modal-1.6.3.dev12 → modal-1.6.4}/modal/experimental/ipython.py +0 -0
  206. {modal-1.6.3.dev12 → modal-1.6.4}/modal/file_pattern_matcher.py +0 -0
  207. {modal-1.6.3.dev12 → modal-1.6.4}/modal/functions.py +0 -0
  208. {modal-1.6.3.dev12 → modal-1.6.4}/modal/image.py +0 -0
  209. {modal-1.6.3.dev12 → modal-1.6.4}/modal/mount.pyi +0 -0
  210. {modal-1.6.3.dev12 → modal-1.6.4}/modal/network_file_system.pyi +0 -0
  211. {modal-1.6.3.dev12 → modal-1.6.4}/modal/object.py +0 -0
  212. {modal-1.6.3.dev12 → modal-1.6.4}/modal/output.py +0 -0
  213. {modal-1.6.3.dev12 → modal-1.6.4}/modal/parallel_map.py +0 -0
  214. {modal-1.6.3.dev12 → modal-1.6.4}/modal/parallel_map.pyi +0 -0
  215. {modal-1.6.3.dev12 → modal-1.6.4}/modal/partial_function.py +0 -0
  216. {modal-1.6.3.dev12 → modal-1.6.4}/modal/partial_function.pyi +0 -0
  217. {modal-1.6.3.dev12 → modal-1.6.4}/modal/proxy.pyi +0 -0
  218. {modal-1.6.3.dev12 → modal-1.6.4}/modal/py.typed +0 -0
  219. {modal-1.6.3.dev12 → modal-1.6.4}/modal/queue.pyi +0 -0
  220. {modal-1.6.3.dev12 → modal-1.6.4}/modal/retries.py +0 -0
  221. {modal-1.6.3.dev12 → modal-1.6.4}/modal/running_app.py +0 -0
  222. {modal-1.6.3.dev12 → modal-1.6.4}/modal/sandbox/__init__.py +0 -0
  223. {modal-1.6.3.dev12 → modal-1.6.4}/modal/sandbox/_filesystem.py +0 -0
  224. {modal-1.6.3.dev12 → modal-1.6.4}/modal/sandbox/_impl_v1.py +0 -0
  225. {modal-1.6.3.dev12 → modal-1.6.4}/modal/sandbox/_impl_v2.py +0 -0
  226. {modal-1.6.3.dev12 → modal-1.6.4}/modal/sandbox/sandbox.py +0 -0
  227. {modal-1.6.3.dev12 → modal-1.6.4}/modal/schedule.py +0 -0
  228. {modal-1.6.3.dev12 → modal-1.6.4}/modal/scheduler_placement.py +0 -0
  229. {modal-1.6.3.dev12 → modal-1.6.4}/modal/server.py +0 -0
  230. {modal-1.6.3.dev12 → modal-1.6.4}/modal/serving.py +0 -0
  231. {modal-1.6.3.dev12 → modal-1.6.4}/modal/serving.pyi +0 -0
  232. {modal-1.6.3.dev12 → modal-1.6.4}/modal/skills/modal/SKILL.md +0 -0
  233. {modal-1.6.3.dev12 → modal-1.6.4}/modal/stream_type.py +0 -0
  234. {modal-1.6.3.dev12 → modal-1.6.4}/modal/volume.pyi +0 -0
  235. {modal-1.6.3.dev12 → modal-1.6.4}/modal/workspace.py +0 -0
  236. {modal-1.6.3.dev12 → modal-1.6.4}/modal.egg-info/dependency_links.txt +0 -0
  237. {modal-1.6.3.dev12 → modal-1.6.4}/modal.egg-info/entry_points.txt +0 -0
  238. {modal-1.6.3.dev12 → modal-1.6.4}/modal.egg-info/requires.txt +0 -0
  239. {modal-1.6.3.dev12 → modal-1.6.4}/modal.egg-info/top_level.txt +0 -0
  240. {modal-1.6.3.dev12 → modal-1.6.4}/modal_docs/__init__.py +0 -0
  241. {modal-1.6.3.dev12 → modal-1.6.4}/modal_docs/gen_cli_docs.py +0 -0
  242. {modal-1.6.3.dev12 → modal-1.6.4}/modal_docs/gen_cli_docs_main.py +0 -0
  243. {modal-1.6.3.dev12 → modal-1.6.4}/modal_docs/gen_reference_docs.py +0 -0
  244. {modal-1.6.3.dev12 → modal-1.6.4}/modal_docs/gen_reference_docs_main.py +0 -0
  245. {modal-1.6.3.dev12 → modal-1.6.4}/modal_docs/mdmd/__init__.py +0 -0
  246. {modal-1.6.3.dev12 → modal-1.6.4}/modal_docs/mdmd/mdmd.py +0 -0
  247. {modal-1.6.3.dev12 → modal-1.6.4}/modal_docs/mdmd/signatures.py +0 -0
  248. {modal-1.6.3.dev12 → modal-1.6.4}/modal_docs/mdmd/types.py +0 -0
  249. {modal-1.6.3.dev12 → modal-1.6.4}/modal_docs/reference_intro.md +0 -0
  250. {modal-1.6.3.dev12 → modal-1.6.4}/modal_proto/__init__.py +0 -0
  251. {modal-1.6.3.dev12 → modal-1.6.4}/modal_proto/py.typed +0 -0
  252. {modal-1.6.3.dev12 → modal-1.6.4}/modal_proto/task_command_router_grpc.py +0 -0
  253. {modal-1.6.3.dev12 → modal-1.6.4}/modal_proto/task_command_router_pb2.py +0 -0
  254. {modal-1.6.3.dev12 → modal-1.6.4}/modal_proto/task_command_router_pb2.pyi +0 -0
  255. {modal-1.6.3.dev12 → modal-1.6.4}/modal_proto/task_command_router_pb2_grpc.py +0 -0
  256. {modal-1.6.3.dev12 → modal-1.6.4}/modal_proto/task_command_router_pb2_grpc.pyi +0 -0
  257. {modal-1.6.3.dev12 → modal-1.6.4}/modal_version/__main__.py +0 -0
  258. {modal-1.6.3.dev12 → modal-1.6.4}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: modal
3
- Version: 1.6.3.dev12
3
+ Version: 1.6.4
4
4
  Summary: Python client library for Modal
5
5
  Author-email: Modal Labs <support@modal.com>
6
6
  License-Expression: Apache-2.0
@@ -1,4 +1,5 @@
1
1
  # Copyright Modal Labs 2022
2
+ import os
2
3
  import sys
3
4
 
4
5
  if sys.version_info[:2] < (3, 10):
@@ -59,6 +60,16 @@ except Exception:
59
60
  print()
60
61
  raise
61
62
 
63
+ if sys.version_info[:2] == (3, 10) and os.environ.get("MODAL_IS_REMOTE") != "1":
64
+ from ._utils.deprecation import deprecation_warning
65
+
66
+ deprecation_warning(
67
+ (2026, 11, 4),
68
+ "Python 3.10 is EOL and Modal will not support it in version 1.7.0. "
69
+ "Please upgrade your local Python to 3.11 or later.",
70
+ show_source=False,
71
+ )
72
+
62
73
 
63
74
  __all__ = [
64
75
  "__version__",
@@ -2,6 +2,7 @@
2
2
  import sys
3
3
 
4
4
  from ._traceback import reduce_traceback_to_user_code
5
+ from .cli._suggest import get_hint
5
6
  from .cli._traceback import highlight_modal_warnings, setup_rich_traceback
6
7
  from .cli.entry_point import entrypoint_cli
7
8
  from .cli.import_refs import _CliUserExecutionError
@@ -41,7 +42,7 @@ def main():
41
42
  if notes := getattr(exc, "__notes__", []):
42
43
  content = f"{content}\n\nNote: {' '.join(notes)}"
43
44
 
44
- OutputManager.get().print_error(content)
45
+ OutputManager.get().print_error(content, hint=get_hint(exc))
45
46
  sys.exit(1)
46
47
 
47
48
 
@@ -0,0 +1 @@
1
+ # Copyright Modal Labs 2026
@@ -0,0 +1,66 @@
1
+ # Copyright Modal Labs 2026
2
+ """The audit log RPCs, one call each, retried with backoff. Ordering and batching live in list.py."""
3
+
4
+ from __future__ import annotations
5
+
6
+ from collections.abc import Awaitable, Callable
7
+ from typing import TYPE_CHECKING, TypeVar
8
+
9
+ from modal._utils.grpc_utils import Retry
10
+ from modal_proto import api_pb2
11
+
12
+ if TYPE_CHECKING:
13
+ from modal.client import _Client
14
+
15
+
16
+ _Resp = TypeVar("_Resp")
17
+
18
+
19
+ _MAX_RETRIES = 4
20
+ _PLAN_MAX_RETRIES = 2
21
+
22
+
23
+ async def _call(
24
+ rpc: Callable[..., Awaitable[_Resp]], req: object, *, timeout: float, max_retries: int = _MAX_RETRIES
25
+ ) -> _Resp:
26
+ """Call with backoff on timeouts and transient errors; rate and resource limits wait as the server says."""
27
+ retry = Retry(base_delay=1.0, delay_factor=2.0, max_delay=8.0, max_retries=max_retries, attempt_timeout=timeout)
28
+ return await rpc(req, retry=retry)
29
+
30
+
31
+ async def get_settings(client: _Client) -> api_pb2.AuditLogSettingsGetResponse:
32
+ return await client._stub.AuditLogSettingsGet(api_pb2.AuditLogSettingsGetRequest())
33
+
34
+
35
+ async def count_entries(
36
+ client: _Client, q: str, oldest_ms: int, newest_ms: int, config: api_pb2.AuditLogSettingsGetResponse
37
+ ) -> int:
38
+ req = api_pb2.AuditLogCountRequest(q=q, oldest_ms=oldest_ms, newest_ms=newest_ms)
39
+ resp = await _call(client._stub.AuditLogCount, req, timeout=config.request_timeout_secs)
40
+ return resp.count
41
+
42
+
43
+ async def list_page(
44
+ client: _Client,
45
+ q: str,
46
+ oldest_ms: int,
47
+ newest_ms: int,
48
+ limit: int,
49
+ config: api_pb2.AuditLogSettingsGetResponse,
50
+ newest_cursor: api_pb2.AuditLogCursor | None = None,
51
+ oldest_cursor: api_pb2.AuditLogCursor | None = None,
52
+ ) -> api_pb2.AuditLogListResponse:
53
+ req = api_pb2.AuditLogListRequest(q=q, oldest_ms=oldest_ms, newest_ms=newest_ms, limit=limit)
54
+ if newest_cursor is not None:
55
+ req.newest_cursor.CopyFrom(newest_cursor)
56
+ if oldest_cursor is not None:
57
+ req.oldest_cursor.CopyFrom(oldest_cursor)
58
+ return await _call(client._stub.AuditLogList, req, timeout=config.request_timeout_secs)
59
+
60
+
61
+ async def plan_buckets(
62
+ client: _Client, q: str, oldest_ms: int, newest_ms: int, config: api_pb2.AuditLogSettingsGetResponse
63
+ ) -> list[api_pb2.AuditLogCursor]:
64
+ req = api_pb2.AuditLogBucketsRequest(q=q, oldest_ms=oldest_ms, newest_ms=newest_ms, bucket_size=config.bucket_size)
65
+ resp = await _call(client._stub.AuditLogPlan, req, timeout=config.plan_timeout_secs, max_retries=_PLAN_MAX_RETRIES)
66
+ return list(resp.cursors)
@@ -0,0 +1,17 @@
1
+ # Copyright Modal Labs 2026
2
+ from __future__ import annotations
3
+
4
+ from typing import TYPE_CHECKING
5
+
6
+ from modal._audit_logs import _rpcs
7
+ from modal_proto import api_pb2
8
+
9
+ if TYPE_CHECKING:
10
+ from modal.client import _Client
11
+
12
+
13
+ async def count_audit_logs(
14
+ client: _Client, q: str, oldest_ms: int, newest_ms: int, config: api_pb2.AuditLogSettingsGetResponse
15
+ ) -> int:
16
+ """Count the entries in [oldest_ms, newest_ms) that match the query."""
17
+ return await _rpcs.count_entries(client, q, oldest_ms, newest_ms, config)
@@ -0,0 +1,83 @@
1
+ # Copyright Modal Labs 2026
2
+ from __future__ import annotations
3
+
4
+ from collections.abc import AsyncGenerator
5
+ from contextlib import aclosing
6
+
7
+ from modal._audit_logs import _rpcs
8
+ from modal._utils.async_utils import async_map_ordered
9
+ from modal.client import _Client
10
+ from modal_proto import api_pb2
11
+
12
+ # (newest_cursor, oldest_cursor); None where the bucket is open-ended.
13
+ Bucket = tuple[api_pb2.AuditLogCursor | None, api_pb2.AuditLogCursor | None]
14
+
15
+
16
+ async def get_bucket_cursors(
17
+ client: _Client, q: str, oldest_ms: int, newest_ms: int, config: api_pb2.AuditLogSettingsGetResponse
18
+ ) -> list[Bucket]:
19
+ """Split the range into buckets, as (newest_cursor, oldest_cursor) pairs ordered oldest to newest.
20
+
21
+ The first bucket has no oldest cursor and the last has no newest cursor.
22
+ """
23
+ cursors = await _rpcs.plan_buckets(client, q, oldest_ms, newest_ms, config)
24
+ return list(zip([None, *cursors], [*cursors, None]))[::-1]
25
+
26
+
27
+ async def _fetch_bucket(
28
+ client: _Client,
29
+ q: str,
30
+ oldest_ms: int,
31
+ newest_ms: int,
32
+ config: api_pb2.AuditLogSettingsGetResponse,
33
+ bucket: Bucket,
34
+ ) -> list[api_pb2.AuditLogEntry]:
35
+ """Read one bucket's entries, oldest to newest, using pagination"""
36
+ newest_cursor, oldest_cursor = bucket
37
+ entries: list[api_pb2.AuditLogEntry] = []
38
+ while True:
39
+ resp = await _rpcs.list_page(
40
+ client, q, oldest_ms, newest_ms, config.page_size, config, newest_cursor, oldest_cursor
41
+ )
42
+ entries.extend(resp.items)
43
+ # Skips the empty request a full last page would otherwise trigger; an unset next_cursor also ends the loop.
44
+ if oldest_cursor is not None and resp.items and resp.items[-1].id == oldest_cursor.id:
45
+ break
46
+ if not resp.HasField("next_cursor"):
47
+ break
48
+ newest_cursor = resp.next_cursor
49
+ entries.reverse()
50
+ return entries
51
+
52
+
53
+ async def fetch_audit_logs(
54
+ q: str,
55
+ oldest_ms: int,
56
+ newest_ms: int,
57
+ *,
58
+ client: _Client | None = None,
59
+ config: api_pb2.AuditLogSettingsGetResponse,
60
+ ) -> AsyncGenerator[api_pb2.AuditLogEntry]:
61
+ """Yield the range's entries from the oldest to the newest, one bucket at a time.
62
+
63
+ At most `max_concurrent_requests` buckets are fetched at once, and at most `max_buffered_buckets` are fetched
64
+ or held at once. A new bucket is admitted only after the consumer has taken all of a bucket's entries, so a slow
65
+ consumer or a stalled request cannot grow memory.
66
+ If any request fails after its attempts, the remaining requests are cancelled and the error is raised.
67
+ """
68
+ if client is None:
69
+ client = await _Client.from_env()
70
+ buckets = await get_bucket_cursors(client, q, oldest_ms, newest_ms, config)
71
+
72
+ async def bucket_stream() -> AsyncGenerator[Bucket]:
73
+ for bucket in buckets:
74
+ yield bucket
75
+
76
+ async def fetch(bucket: Bucket) -> list[api_pb2.AuditLogEntry]:
77
+ return await _fetch_bucket(client, q, oldest_ms, newest_ms, config, bucket)
78
+
79
+ fetched = async_map_ordered(bucket_stream(), fetch, config.max_concurrent_requests, config.max_buffered_buckets)
80
+ async with aclosing(fetched) as stream:
81
+ async for entries in stream:
82
+ for entry in entries:
83
+ yield entry
@@ -40,7 +40,7 @@ def get_current_cluster_context() -> ClusterContext:
40
40
  return current_cluster_context
41
41
 
42
42
 
43
- class _Cluster(_Object, type_prefix="cu"):
43
+ class _Cluster(_Object, type_prefixes=("cu",)):
44
44
  """A group of containers scheduled together for a clustered Function or Server.
45
45
 
46
46
  Use `Cluster.from_context()` inside a cluster, or `Cluster.from_id()` to
@@ -353,7 +353,7 @@ class _EnvironmentAppsManager:
353
353
  ]
354
354
 
355
355
 
356
- class _Environment(_Object, type_prefix="en"):
356
+ class _Environment(_Object, type_prefixes=("en",)):
357
357
  _name: str | None = None
358
358
  _settings: EnvironmentSettings
359
359
 
@@ -408,6 +408,7 @@ def _make_function_variant(
408
408
  if not base_function._is_hydrated:
409
409
  await base_function.hydrate(load_context.client)
410
410
 
411
+ base_function._check_not_observability_only()
411
412
  assert base_function._client and base_function._client._stub
412
413
 
413
414
  if parameter_schema is None:
@@ -119,6 +119,16 @@ if TYPE_CHECKING:
119
119
  import modal.functions
120
120
 
121
121
  MAX_INTERNAL_FAILURE_COUNT = 8
122
+ _OBSERVABILITY_ONLY_APIS = (
123
+ ".logs",
124
+ ".metrics",
125
+ ".info()",
126
+ ".stats()",
127
+ ".get_current_stats()",
128
+ ".get_web_url()",
129
+ ".autoscaler",
130
+ ".update_autoscaler()",
131
+ )
122
132
  TERMINAL_STATUSES = (
123
133
  api_pb2.GenericResult.GENERIC_STATUS_SUCCESS,
124
134
  api_pb2.GenericResult.GENERIC_STATUS_TERMINATED,
@@ -610,7 +620,7 @@ OriginalReturnType = typing.TypeVar(
610
620
  T = typing.TypeVar("T", covariant=True)
611
621
 
612
622
 
613
- class _Function(typing.Generic[P, ReturnType, OriginalReturnType], _Object, type_prefix="fu"):
623
+ class _Function(typing.Generic[P, ReturnType, OriginalReturnType], _Object, type_prefixes=("fu",)):
614
624
  """Functions are the basic units of serverless execution on Modal.
615
625
 
616
626
  Generally, you will not construct a `Function` directly. Instead, use the
@@ -651,6 +661,7 @@ class _Function(typing.Generic[P, ReturnType, OriginalReturnType], _Object, type
651
661
  _base_function: "_Function | None" = None
652
662
  _app_id: str | None = None
653
663
  _function_info: FunctionInfo | None = None
664
+ _is_observability_only: bool = False
654
665
 
655
666
  async def _get_log_query_data(self) -> _LogQueryData:
656
667
  await self.hydrate()
@@ -734,6 +745,7 @@ class _Function(typing.Generic[P, ReturnType, OriginalReturnType], _Object, type
734
745
  experimental_options: dict[str, str] | None = None,
735
746
  restrict_output: bool = False,
736
747
  http_config: api_pb2.HTTPConfig | None = None,
748
+ include_client_mounts: bool = True,
737
749
  ) -> "_Function":
738
750
  """mdmd:hidden
739
751
 
@@ -777,7 +789,7 @@ class _Function(typing.Generic[P, ReturnType, OriginalReturnType], _Object, type
777
789
 
778
790
  entrypoint_mount = info.get_entrypoint_mount() if include_source else {}
779
791
  all_mounts = [
780
- _get_client_mount(),
792
+ *([_get_client_mount()] if include_client_mounts else []),
781
793
  *entrypoint_mount.values(),
782
794
  ]
783
795
 
@@ -1485,16 +1497,15 @@ class _Function(typing.Generic[P, ReturnType, OriginalReturnType], _Object, type
1485
1497
  # refine the error message
1486
1498
  msg = f"Lookup failed for {called_from} '{function_id}': {exc}."
1487
1499
  raise NotFoundError(msg) from None
1488
- if called_from == "Function" and (response.function.is_server or response.function.is_class):
1489
- if response.function.is_server:
1490
- raise InvalidError(f"{function_id} is a Server. Use \n ``modal.Server.from_id('{function_id}')``")
1491
- raise InvalidError(f"{function_id} is a Cls and cannot be loaded with Function.from_id().")
1500
+ if called_from == "Function" and response.function.is_server:
1501
+ raise InvalidError(f"{function_id} is a Server. Use \n ``modal.Server.from_id('{function_id}')``")
1492
1502
  if called_from == "Server" and not response.function.is_server:
1493
1503
  if response.function.is_class:
1494
1504
  raise InvalidError(f"{function_id} is a Cls and cannot be loaded with Server.from_id().")
1495
1505
  raise InvalidError(f"{function_id} is a Function. Use \n ``modal.Function.from_id('{function_id}')``")
1496
1506
  self._hydrate(function_id, load_context.client, response.handle_metadata)
1497
1507
  self._function_info = FunctionInfo._from_function_proto(response.function)
1508
+ self._is_observability_only = called_from == "Function" and response.function.is_class
1498
1509
 
1499
1510
  rep = f"modal.Function.from_id('{function_id}')"
1500
1511
  return cls._from_loader(
@@ -1514,6 +1525,11 @@ class _Function(typing.Generic[P, ReturnType, OriginalReturnType], _Object, type
1514
1525
  object with metadata from Modal servers until the first
1515
1526
  time it is actually used.
1516
1527
 
1528
+ If the ID belongs to a Cls, the Function only supports the following APIs:
1529
+ `.logs`, `.metrics`, `.info()`, `.stats()`, `.get_current_stats()`,
1530
+ `.get_web_url()`, `.autoscaler` and `.update_autoscaler()`. Use `modal.Cls.from_name(...)`
1531
+ to invoke all other methods.
1532
+
1517
1533
  Args:
1518
1534
  function_id: ID of the function.
1519
1535
  client: Modal client to use; defaults to `Client.from_env()` when omitted.
@@ -1744,6 +1760,18 @@ class _Function(typing.Generic[P, ReturnType, OriginalReturnType], _Object, type
1744
1760
  + f"or call it locally: {self._function_name}.local()"
1745
1761
  )
1746
1762
 
1763
+ def _check_not_observability_only(self):
1764
+ if self._is_observability_only:
1765
+ assert self._function_name
1766
+ class_name = self._function_name.removesuffix(".*")
1767
+ apis = [f"`{name}`" for name in _OBSERVABILITY_ONLY_APIS]
1768
+ allowed_apis = ", ".join(apis[:-1]) + " and " + apis[-1]
1769
+ raise InvalidError(
1770
+ f"`{self.object_id}` belongs to the Cls `{class_name}`. A Function loaded with "
1771
+ f"`Function.from_id` only supports {allowed_apis}. "
1772
+ "Use `modal.Cls.from_name(...)` to invoke all other methods."
1773
+ )
1774
+
1747
1775
  @live_method
1748
1776
  async def get_web_url(self) -> str | None:
1749
1777
  """URL for addressing a Web Function via HTTP.
@@ -1779,6 +1807,7 @@ class _Function(typing.Generic[P, ReturnType, OriginalReturnType], _Object, type
1779
1807
  config_method_name: str,
1780
1808
  ) -> "_Function[P, ReturnType, OriginalReturnType]":
1781
1809
  base_function = self._base_function or self
1810
+ base_function._check_not_observability_only()
1782
1811
  combined_options = self._options.merge_options(new_options)
1783
1812
 
1784
1813
  # For "True Functions" (i.e. not the Function inside a Cls), we will use
@@ -1941,6 +1970,7 @@ class _Function(typing.Generic[P, ReturnType, OriginalReturnType], _Object, type
1941
1970
  _SynchronizedQueue is used instead of asyncio.Queue so that the main thread can put
1942
1971
  items in the queue safely.
1943
1972
  """
1973
+ self._check_not_observability_only()
1944
1974
  self._check_no_web_url("map")
1945
1975
  if self._is_generator:
1946
1976
  raise InvalidError("A generator function cannot be called with `.map(...)`.")
@@ -1978,6 +2008,7 @@ class _Function(typing.Generic[P, ReturnType, OriginalReturnType], _Object, type
1978
2008
 
1979
2009
  @live_method
1980
2010
  async def _spawn_map(self, input_queue: _SynchronizedQueue) -> "_FunctionCall[ReturnType]":
2011
+ self._check_not_observability_only()
1981
2012
  self._check_no_web_url("spawn_map")
1982
2013
  if self._is_generator:
1983
2014
  raise InvalidError("A generator function cannot be called with `.spawn_map(...)`.")
@@ -1995,6 +2026,7 @@ class _Function(typing.Generic[P, ReturnType, OriginalReturnType], _Object, type
1995
2026
  return fc
1996
2027
 
1997
2028
  async def _call_function(self, args, kwargs) -> ReturnType:
2029
+ self._check_not_observability_only()
1998
2030
  invocation: _Invocation | _InputPlaneInvocation
1999
2031
  if self._input_plane_url:
2000
2032
  invocation = await _InputPlaneInvocation.create(
@@ -2024,6 +2056,7 @@ class _Function(typing.Generic[P, ReturnType, OriginalReturnType], _Object, type
2024
2056
  function_call_invocation_type: "api_pb2.FunctionCallInvocationType.ValueType",
2025
2057
  from_spawn_map: bool = False,
2026
2058
  ) -> _Invocation:
2059
+ self._check_not_observability_only()
2027
2060
  return await _Invocation.create(
2028
2061
  self,
2029
2062
  args,
@@ -2037,6 +2070,7 @@ class _Function(typing.Generic[P, ReturnType, OriginalReturnType], _Object, type
2037
2070
  @live_method_gen
2038
2071
  @synchronizer.no_input_translation
2039
2072
  async def _call_generator(self, args, kwargs):
2073
+ self._check_not_observability_only()
2040
2074
  invocation: _Invocation | _InputPlaneInvocation
2041
2075
  if self._input_plane_url:
2042
2076
  invocation = await _InputPlaneInvocation.create(
@@ -2093,6 +2127,7 @@ class _Function(typing.Generic[P, ReturnType, OriginalReturnType], _Object, type
2093
2127
  Values produced by the remote generator.
2094
2128
  """
2095
2129
  # TODO: Generics/TypeVars
2130
+ self._check_not_observability_only()
2096
2131
  self._check_no_web_url("remote_gen")
2097
2132
 
2098
2133
  if not self._is_generator:
@@ -2336,7 +2371,7 @@ class _Function(typing.Generic[P, ReturnType, OriginalReturnType], _Object, type
2336
2371
  experimental_spawn_map = MethodWithAio(_experimental_spawn_map_sync, _experimental_spawn_map_async, synchronizer)
2337
2372
 
2338
2373
 
2339
- class _FunctionCall(typing.Generic[ReturnType], _Object, type_prefix="fc"):
2374
+ class _FunctionCall(typing.Generic[ReturnType], _Object, type_prefixes=("fc",)):
2340
2375
  """A reference to an executed function call.
2341
2376
 
2342
2377
  Constructed using `.spawn(...)` on a Modal function with the same