modal 1.6.5.dev11__tar.gz → 1.7.0.dev0__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 (262) hide show
  1. {modal-1.6.5.dev11 → modal-1.7.0.dev0}/PKG-INFO +4 -4
  2. {modal-1.6.5.dev11 → modal-1.7.0.dev0}/README.md +1 -1
  3. {modal-1.6.5.dev11 → modal-1.7.0.dev0}/modal/__init__.py +2 -14
  4. {modal-1.6.5.dev11 → modal-1.7.0.dev0}/modal/_environments.py +8 -2
  5. {modal-1.6.5.dev11 → modal-1.7.0.dev0}/modal/_image.py +34 -36
  6. {modal-1.6.5.dev11 → modal-1.7.0.dev0}/modal/_partial_function.py +2 -1
  7. {modal-1.6.5.dev11 → modal-1.7.0.dev0}/modal/_runtime/user_code_imports.py +1 -2
  8. {modal-1.6.5.dev11 → modal-1.7.0.dev0}/modal/_server.pyi +1 -1
  9. {modal-1.6.5.dev11 → modal-1.7.0.dev0}/modal/app.pyi +3 -3
  10. {modal-1.6.5.dev11 → modal-1.7.0.dev0}/modal/cli/container.py +1 -1
  11. {modal-1.6.5.dev11 → modal-1.7.0.dev0}/modal/cli/image.py +22 -2
  12. {modal-1.6.5.dev11 → modal-1.7.0.dev0}/modal/cli/shell.py +21 -2
  13. {modal-1.6.5.dev11 → modal-1.7.0.dev0}/modal/client.pyi +2 -2
  14. {modal-1.6.5.dev11 → modal-1.7.0.dev0}/modal/experimental/__init__.py +0 -9
  15. modal-1.7.0.dev0/modal/experimental/_flash_container_entry.py +36 -0
  16. {modal-1.6.5.dev11 → modal-1.7.0.dev0}/modal/experimental/flash_server.py +0 -3
  17. {modal-1.6.5.dev11 → modal-1.7.0.dev0}/modal/experimental/flash_server.pyi +0 -7
  18. {modal-1.6.5.dev11 → modal-1.7.0.dev0}/modal/functions.pyi +6 -6
  19. {modal-1.6.5.dev11 → modal-1.7.0.dev0}/modal/image.pyi +17 -5
  20. {modal-1.6.5.dev11 → modal-1.7.0.dev0}/modal/object.pyi +6 -18
  21. {modal-1.6.5.dev11 → modal-1.7.0.dev0}/modal/partial_function.pyi +3 -2
  22. {modal-1.6.5.dev11 → modal-1.7.0.dev0}/modal/runner.py +2 -2
  23. {modal-1.6.5.dev11 → modal-1.7.0.dev0}/modal/sandbox/_common.py +23 -6
  24. {modal-1.6.5.dev11 → modal-1.7.0.dev0}/modal/sandbox/_impl_persistent.py +28 -7
  25. {modal-1.6.5.dev11 → modal-1.7.0.dev0}/modal/sandbox/_impl_v1.py +42 -9
  26. {modal-1.6.5.dev11 → modal-1.7.0.dev0}/modal/sandbox/_impl_v2.py +42 -9
  27. {modal-1.6.5.dev11 → modal-1.7.0.dev0}/modal/sandbox/_sandbox.py +41 -40
  28. {modal-1.6.5.dev11 → modal-1.7.0.dev0}/modal/sandbox/sandbox.pyi +8 -5
  29. {modal-1.6.5.dev11 → modal-1.7.0.dev0}/modal/server.pyi +1 -1
  30. {modal-1.6.5.dev11 → modal-1.7.0.dev0}/modal/volume.pyi +6 -6
  31. {modal-1.6.5.dev11 → modal-1.7.0.dev0}/modal.egg-info/PKG-INFO +4 -4
  32. {modal-1.6.5.dev11 → modal-1.7.0.dev0}/modal.egg-info/SOURCES.txt +0 -2
  33. {modal-1.6.5.dev11 → modal-1.7.0.dev0}/modal.egg-info/requires.txt +1 -1
  34. modal-1.7.0.dev0/modal_proto/api_pb2.py +1875 -0
  35. {modal-1.6.5.dev11 → modal-1.7.0.dev0}/modal_proto/api_pb2.pyi +51 -2
  36. modal-1.7.0.dev0/modal_proto/task_command_router_pb2.py +138 -0
  37. {modal-1.6.5.dev11 → modal-1.7.0.dev0}/modal_version/__init__.py +1 -1
  38. {modal-1.6.5.dev11 → modal-1.7.0.dev0}/pyproject.toml +2 -3
  39. modal-1.6.5.dev11/modal/experimental/_flash_container_entry.py +0 -67
  40. modal-1.6.5.dev11/modal/experimental/flash.py +0 -327
  41. modal-1.6.5.dev11/modal/experimental/flash.pyi +0 -205
  42. modal-1.6.5.dev11/modal_proto/api_pb2.py +0 -8586
  43. modal-1.6.5.dev11/modal_proto/task_command_router_pb2.py +0 -552
  44. {modal-1.6.5.dev11 → modal-1.7.0.dev0}/LICENSE +0 -0
  45. {modal-1.6.5.dev11 → modal-1.7.0.dev0}/modal/__main__.py +0 -0
  46. {modal-1.6.5.dev11 → modal-1.7.0.dev0}/modal/_audit_logs/__init__.py +0 -0
  47. {modal-1.6.5.dev11 → modal-1.7.0.dev0}/modal/_audit_logs/_rpcs.py +0 -0
  48. {modal-1.6.5.dev11 → modal-1.7.0.dev0}/modal/_audit_logs/count.py +0 -0
  49. {modal-1.6.5.dev11 → modal-1.7.0.dev0}/modal/_audit_logs/list.py +0 -0
  50. {modal-1.6.5.dev11 → modal-1.7.0.dev0}/modal/_billing.py +0 -0
  51. {modal-1.6.5.dev11 → modal-1.7.0.dev0}/modal/_cluster.py +0 -0
  52. {modal-1.6.5.dev11 → modal-1.7.0.dev0}/modal/_cluster.pyi +0 -0
  53. {modal-1.6.5.dev11 → modal-1.7.0.dev0}/modal/_container_entrypoint.py +0 -0
  54. {modal-1.6.5.dev11 → modal-1.7.0.dev0}/modal/_experimental_outbound_policy.py +0 -0
  55. {modal-1.6.5.dev11 → modal-1.7.0.dev0}/modal/_experimental_outbound_policy.pyi +0 -0
  56. {modal-1.6.5.dev11 → modal-1.7.0.dev0}/modal/_function_variants.py +0 -0
  57. {modal-1.6.5.dev11 → modal-1.7.0.dev0}/modal/_functions.py +0 -0
  58. {modal-1.6.5.dev11 → modal-1.7.0.dev0}/modal/_grpc_client.py +0 -0
  59. {modal-1.6.5.dev11 → modal-1.7.0.dev0}/modal/_ipython.py +0 -0
  60. {modal-1.6.5.dev11 → modal-1.7.0.dev0}/modal/_load_context.py +0 -0
  61. {modal-1.6.5.dev11 → modal-1.7.0.dev0}/modal/_location.py +0 -0
  62. {modal-1.6.5.dev11 → modal-1.7.0.dev0}/modal/_logs.py +0 -0
  63. {modal-1.6.5.dev11 → modal-1.7.0.dev0}/modal/_logs_manager.py +0 -0
  64. {modal-1.6.5.dev11 → modal-1.7.0.dev0}/modal/_logs_manager.pyi +0 -0
  65. {modal-1.6.5.dev11 → modal-1.7.0.dev0}/modal/_metrics.py +0 -0
  66. {modal-1.6.5.dev11 → modal-1.7.0.dev0}/modal/_metrics.pyi +0 -0
  67. {modal-1.6.5.dev11 → modal-1.7.0.dev0}/modal/_object.py +0 -0
  68. {modal-1.6.5.dev11 → modal-1.7.0.dev0}/modal/_outbound_policy.py +0 -0
  69. {modal-1.6.5.dev11 → modal-1.7.0.dev0}/modal/_outbound_policy.pyi +0 -0
  70. {modal-1.6.5.dev11 → modal-1.7.0.dev0}/modal/_output/__init__.py +0 -0
  71. {modal-1.6.5.dev11 → modal-1.7.0.dev0}/modal/_output/manager.py +0 -0
  72. {modal-1.6.5.dev11 → modal-1.7.0.dev0}/modal/_output/pty.py +0 -0
  73. {modal-1.6.5.dev11 → modal-1.7.0.dev0}/modal/_output/rich.py +0 -0
  74. {modal-1.6.5.dev11 → modal-1.7.0.dev0}/modal/_output/status.py +0 -0
  75. {modal-1.6.5.dev11 → modal-1.7.0.dev0}/modal/_resolver.py +0 -0
  76. {modal-1.6.5.dev11 → modal-1.7.0.dev0}/modal/_resources.py +0 -0
  77. {modal-1.6.5.dev11 → modal-1.7.0.dev0}/modal/_runtime/__init__.py +0 -0
  78. {modal-1.6.5.dev11 → modal-1.7.0.dev0}/modal/_runtime/asgi.py +0 -0
  79. {modal-1.6.5.dev11 → modal-1.7.0.dev0}/modal/_runtime/container_io_manager.py +0 -0
  80. {modal-1.6.5.dev11 → modal-1.7.0.dev0}/modal/_runtime/container_io_manager.pyi +0 -0
  81. {modal-1.6.5.dev11 → modal-1.7.0.dev0}/modal/_runtime/execution_context.py +0 -0
  82. {modal-1.6.5.dev11 → modal-1.7.0.dev0}/modal/_runtime/execution_context.pyi +0 -0
  83. {modal-1.6.5.dev11 → modal-1.7.0.dev0}/modal/_runtime/gpu_memory_snapshot.py +0 -0
  84. {modal-1.6.5.dev11 → modal-1.7.0.dev0}/modal/_runtime/task_lifecycle_manager.py +0 -0
  85. {modal-1.6.5.dev11 → modal-1.7.0.dev0}/modal/_runtime/task_lifecycle_manager.pyi +0 -0
  86. {modal-1.6.5.dev11 → modal-1.7.0.dev0}/modal/_runtime/telemetry.py +0 -0
  87. {modal-1.6.5.dev11 → modal-1.7.0.dev0}/modal/_runtime/user_code_event_loop.py +0 -0
  88. {modal-1.6.5.dev11 → modal-1.7.0.dev0}/modal/_serialization.py +0 -0
  89. {modal-1.6.5.dev11 → modal-1.7.0.dev0}/modal/_server.py +0 -0
  90. {modal-1.6.5.dev11 → modal-1.7.0.dev0}/modal/_supports_logs.py +0 -0
  91. {modal-1.6.5.dev11 → modal-1.7.0.dev0}/modal/_traceback.py +0 -0
  92. {modal-1.6.5.dev11 → modal-1.7.0.dev0}/modal/_tunnel.py +0 -0
  93. {modal-1.6.5.dev11 → modal-1.7.0.dev0}/modal/_tunnel.pyi +0 -0
  94. {modal-1.6.5.dev11 → modal-1.7.0.dev0}/modal/_type_manager.py +0 -0
  95. {modal-1.6.5.dev11 → modal-1.7.0.dev0}/modal/_utils/__init__.py +0 -0
  96. {modal-1.6.5.dev11 → modal-1.7.0.dev0}/modal/_utils/app_utils.py +0 -0
  97. {modal-1.6.5.dev11 → modal-1.7.0.dev0}/modal/_utils/async_utils.py +0 -0
  98. {modal-1.6.5.dev11 → modal-1.7.0.dev0}/modal/_utils/auth_token_manager.py +0 -0
  99. {modal-1.6.5.dev11 → modal-1.7.0.dev0}/modal/_utils/blob_utils.py +0 -0
  100. {modal-1.6.5.dev11 → modal-1.7.0.dev0}/modal/_utils/browser_utils.py +0 -0
  101. {modal-1.6.5.dev11 → modal-1.7.0.dev0}/modal/_utils/bytes_io_segment_payload.py +0 -0
  102. {modal-1.6.5.dev11 → modal-1.7.0.dev0}/modal/_utils/curl_utils.py +0 -0
  103. {modal-1.6.5.dev11 → modal-1.7.0.dev0}/modal/_utils/deprecation.py +0 -0
  104. {modal-1.6.5.dev11 → modal-1.7.0.dev0}/modal/_utils/display_utils.py +0 -0
  105. {modal-1.6.5.dev11 → modal-1.7.0.dev0}/modal/_utils/docker_utils.py +0 -0
  106. {modal-1.6.5.dev11 → modal-1.7.0.dev0}/modal/_utils/function_utils.py +0 -0
  107. {modal-1.6.5.dev11 → modal-1.7.0.dev0}/modal/_utils/git_utils.py +0 -0
  108. {modal-1.6.5.dev11 → modal-1.7.0.dev0}/modal/_utils/grpc_testing.py +0 -0
  109. {modal-1.6.5.dev11 → modal-1.7.0.dev0}/modal/_utils/grpc_utils.py +0 -0
  110. {modal-1.6.5.dev11 → modal-1.7.0.dev0}/modal/_utils/hash_utils.py +0 -0
  111. {modal-1.6.5.dev11 → modal-1.7.0.dev0}/modal/_utils/http_utils.py +0 -0
  112. {modal-1.6.5.dev11 → modal-1.7.0.dev0}/modal/_utils/idle_countdown.py +0 -0
  113. {modal-1.6.5.dev11 → modal-1.7.0.dev0}/modal/_utils/jwt_utils.py +0 -0
  114. {modal-1.6.5.dev11 → modal-1.7.0.dev0}/modal/_utils/logger.py +0 -0
  115. {modal-1.6.5.dev11 → modal-1.7.0.dev0}/modal/_utils/mount_utils.py +0 -0
  116. {modal-1.6.5.dev11 → modal-1.7.0.dev0}/modal/_utils/name_utils.py +0 -0
  117. {modal-1.6.5.dev11 → modal-1.7.0.dev0}/modal/_utils/oauth.py +0 -0
  118. {modal-1.6.5.dev11 → modal-1.7.0.dev0}/modal/_utils/package_utils.py +0 -0
  119. {modal-1.6.5.dev11 → modal-1.7.0.dev0}/modal/_utils/pattern_utils.py +0 -0
  120. {modal-1.6.5.dev11 → modal-1.7.0.dev0}/modal/_utils/proxy_support.py +0 -0
  121. {modal-1.6.5.dev11 → modal-1.7.0.dev0}/modal/_utils/rand_pb_testing.py +0 -0
  122. {modal-1.6.5.dev11 → modal-1.7.0.dev0}/modal/_utils/sandbox_fs_utils.py +0 -0
  123. {modal-1.6.5.dev11 → modal-1.7.0.dev0}/modal/_utils/shell_utils.py +0 -0
  124. {modal-1.6.5.dev11 → modal-1.7.0.dev0}/modal/_utils/time_utils.py +0 -0
  125. {modal-1.6.5.dev11 → modal-1.7.0.dev0}/modal/_vendor/__init__.py +0 -0
  126. {modal-1.6.5.dev11 → modal-1.7.0.dev0}/modal/_vendor/a2wsgi_wsgi.py +0 -0
  127. {modal-1.6.5.dev11 → modal-1.7.0.dev0}/modal/_vendor/cloudpickle.py +0 -0
  128. {modal-1.6.5.dev11 → modal-1.7.0.dev0}/modal/_vendor/tblib.py +0 -0
  129. {modal-1.6.5.dev11 → modal-1.7.0.dev0}/modal/_vendor/version.py +0 -0
  130. {modal-1.6.5.dev11 → modal-1.7.0.dev0}/modal/_watcher.py +0 -0
  131. {modal-1.6.5.dev11 → modal-1.7.0.dev0}/modal/_workspace.py +0 -0
  132. {modal-1.6.5.dev11 → modal-1.7.0.dev0}/modal/app.py +0 -0
  133. {modal-1.6.5.dev11 → modal-1.7.0.dev0}/modal/billing.py +0 -0
  134. {modal-1.6.5.dev11 → modal-1.7.0.dev0}/modal/billing.pyi +0 -0
  135. {modal-1.6.5.dev11 → modal-1.7.0.dev0}/modal/builder/2023.12.312.txt +0 -0
  136. {modal-1.6.5.dev11 → modal-1.7.0.dev0}/modal/builder/2023.12.txt +0 -0
  137. {modal-1.6.5.dev11 → modal-1.7.0.dev0}/modal/builder/2024.04.txt +0 -0
  138. {modal-1.6.5.dev11 → modal-1.7.0.dev0}/modal/builder/2024.10.txt +0 -0
  139. {modal-1.6.5.dev11 → modal-1.7.0.dev0}/modal/builder/2025.06.txt +0 -0
  140. {modal-1.6.5.dev11 → modal-1.7.0.dev0}/modal/builder/2026.10.txt +0 -0
  141. {modal-1.6.5.dev11 → modal-1.7.0.dev0}/modal/builder/PREVIEW.txt +0 -0
  142. {modal-1.6.5.dev11 → modal-1.7.0.dev0}/modal/builder/README.md +0 -0
  143. {modal-1.6.5.dev11 → modal-1.7.0.dev0}/modal/builder/base-images.json +0 -0
  144. {modal-1.6.5.dev11 → modal-1.7.0.dev0}/modal/call_graph.py +0 -0
  145. {modal-1.6.5.dev11 → modal-1.7.0.dev0}/modal/cli/__init__.py +0 -0
  146. {modal-1.6.5.dev11 → modal-1.7.0.dev0}/modal/cli/_audit_logs.py +0 -0
  147. {modal-1.6.5.dev11 → modal-1.7.0.dev0}/modal/cli/_download.py +0 -0
  148. {modal-1.6.5.dev11 → modal-1.7.0.dev0}/modal/cli/_help.py +0 -0
  149. {modal-1.6.5.dev11 → modal-1.7.0.dev0}/modal/cli/_logs.py +0 -0
  150. {modal-1.6.5.dev11 → modal-1.7.0.dev0}/modal/cli/_stats.py +0 -0
  151. {modal-1.6.5.dev11 → modal-1.7.0.dev0}/modal/cli/_suggest.py +0 -0
  152. {modal-1.6.5.dev11 → modal-1.7.0.dev0}/modal/cli/_traceback.py +0 -0
  153. {modal-1.6.5.dev11 → modal-1.7.0.dev0}/modal/cli/app.py +0 -0
  154. {modal-1.6.5.dev11 → modal-1.7.0.dev0}/modal/cli/billing.py +0 -0
  155. {modal-1.6.5.dev11 → modal-1.7.0.dev0}/modal/cli/changelog.py +0 -0
  156. {modal-1.6.5.dev11 → modal-1.7.0.dev0}/modal/cli/config.py +0 -0
  157. {modal-1.6.5.dev11 → modal-1.7.0.dev0}/modal/cli/curl.py +0 -0
  158. {modal-1.6.5.dev11 → modal-1.7.0.dev0}/modal/cli/dashboard.py +0 -0
  159. {modal-1.6.5.dev11 → modal-1.7.0.dev0}/modal/cli/dict.py +0 -0
  160. {modal-1.6.5.dev11 → modal-1.7.0.dev0}/modal/cli/endpoint.py +0 -0
  161. {modal-1.6.5.dev11 → modal-1.7.0.dev0}/modal/cli/entry_point.py +0 -0
  162. {modal-1.6.5.dev11 → modal-1.7.0.dev0}/modal/cli/environment.py +0 -0
  163. {modal-1.6.5.dev11 → modal-1.7.0.dev0}/modal/cli/function.py +0 -0
  164. {modal-1.6.5.dev11 → modal-1.7.0.dev0}/modal/cli/import_refs.py +0 -0
  165. {modal-1.6.5.dev11 → modal-1.7.0.dev0}/modal/cli/logo.py +0 -0
  166. {modal-1.6.5.dev11 → modal-1.7.0.dev0}/modal/cli/network_file_system.py +0 -0
  167. {modal-1.6.5.dev11 → modal-1.7.0.dev0}/modal/cli/profile.py +0 -0
  168. {modal-1.6.5.dev11 → modal-1.7.0.dev0}/modal/cli/queues.py +0 -0
  169. {modal-1.6.5.dev11 → modal-1.7.0.dev0}/modal/cli/run.py +0 -0
  170. {modal-1.6.5.dev11 → modal-1.7.0.dev0}/modal/cli/secret.py +0 -0
  171. {modal-1.6.5.dev11 → modal-1.7.0.dev0}/modal/cli/selector.py +0 -0
  172. {modal-1.6.5.dev11 → modal-1.7.0.dev0}/modal/cli/server.py +0 -0
  173. {modal-1.6.5.dev11 → modal-1.7.0.dev0}/modal/cli/skills.py +0 -0
  174. {modal-1.6.5.dev11 → modal-1.7.0.dev0}/modal/cli/token.py +0 -0
  175. {modal-1.6.5.dev11 → modal-1.7.0.dev0}/modal/cli/utils.py +0 -0
  176. {modal-1.6.5.dev11 → modal-1.7.0.dev0}/modal/cli/volume.py +0 -0
  177. {modal-1.6.5.dev11 → modal-1.7.0.dev0}/modal/cli/workspace.py +0 -0
  178. {modal-1.6.5.dev11 → modal-1.7.0.dev0}/modal/client.py +0 -0
  179. {modal-1.6.5.dev11 → modal-1.7.0.dev0}/modal/cloud_bucket_mount.py +0 -0
  180. {modal-1.6.5.dev11 → modal-1.7.0.dev0}/modal/cloud_bucket_mount.pyi +0 -0
  181. {modal-1.6.5.dev11 → modal-1.7.0.dev0}/modal/cls.py +0 -0
  182. {modal-1.6.5.dev11 → modal-1.7.0.dev0}/modal/cls.pyi +0 -0
  183. {modal-1.6.5.dev11 → modal-1.7.0.dev0}/modal/cluster.py +0 -0
  184. {modal-1.6.5.dev11 → modal-1.7.0.dev0}/modal/cluster.pyi +0 -0
  185. {modal-1.6.5.dev11 → modal-1.7.0.dev0}/modal/config.py +0 -0
  186. {modal-1.6.5.dev11 → modal-1.7.0.dev0}/modal/container_process.py +0 -0
  187. {modal-1.6.5.dev11 → modal-1.7.0.dev0}/modal/container_process.pyi +0 -0
  188. {modal-1.6.5.dev11 → modal-1.7.0.dev0}/modal/dict.py +0 -0
  189. {modal-1.6.5.dev11 → modal-1.7.0.dev0}/modal/dict.pyi +0 -0
  190. {modal-1.6.5.dev11 → modal-1.7.0.dev0}/modal/environments.py +0 -0
  191. {modal-1.6.5.dev11 → modal-1.7.0.dev0}/modal/environments.pyi +0 -0
  192. {modal-1.6.5.dev11 → modal-1.7.0.dev0}/modal/exception.py +0 -0
  193. {modal-1.6.5.dev11 → modal-1.7.0.dev0}/modal/experimental/stream.py +0 -0
  194. {modal-1.6.5.dev11 → modal-1.7.0.dev0}/modal/experimental/stream.pyi +0 -0
  195. {modal-1.6.5.dev11 → modal-1.7.0.dev0}/modal/file_pattern_matcher.py +0 -0
  196. {modal-1.6.5.dev11 → modal-1.7.0.dev0}/modal/functions.py +0 -0
  197. {modal-1.6.5.dev11 → modal-1.7.0.dev0}/modal/image.py +0 -0
  198. {modal-1.6.5.dev11 → modal-1.7.0.dev0}/modal/io_streams.py +0 -0
  199. {modal-1.6.5.dev11 → modal-1.7.0.dev0}/modal/io_streams.pyi +0 -0
  200. {modal-1.6.5.dev11 → modal-1.7.0.dev0}/modal/mount.py +0 -0
  201. {modal-1.6.5.dev11 → modal-1.7.0.dev0}/modal/mount.pyi +0 -0
  202. {modal-1.6.5.dev11 → modal-1.7.0.dev0}/modal/network_file_system.py +0 -0
  203. {modal-1.6.5.dev11 → modal-1.7.0.dev0}/modal/network_file_system.pyi +0 -0
  204. {modal-1.6.5.dev11 → modal-1.7.0.dev0}/modal/object.py +0 -0
  205. {modal-1.6.5.dev11 → modal-1.7.0.dev0}/modal/output.py +0 -0
  206. {modal-1.6.5.dev11 → modal-1.7.0.dev0}/modal/parallel_map.py +0 -0
  207. {modal-1.6.5.dev11 → modal-1.7.0.dev0}/modal/parallel_map.pyi +0 -0
  208. {modal-1.6.5.dev11 → modal-1.7.0.dev0}/modal/partial_function.py +0 -0
  209. {modal-1.6.5.dev11 → modal-1.7.0.dev0}/modal/proxy.py +0 -0
  210. {modal-1.6.5.dev11 → modal-1.7.0.dev0}/modal/proxy.pyi +0 -0
  211. {modal-1.6.5.dev11 → modal-1.7.0.dev0}/modal/py.typed +0 -0
  212. {modal-1.6.5.dev11 → modal-1.7.0.dev0}/modal/queue.py +0 -0
  213. {modal-1.6.5.dev11 → modal-1.7.0.dev0}/modal/queue.pyi +0 -0
  214. {modal-1.6.5.dev11 → modal-1.7.0.dev0}/modal/retries.py +0 -0
  215. {modal-1.6.5.dev11 → modal-1.7.0.dev0}/modal/runner.pyi +0 -0
  216. {modal-1.6.5.dev11 → modal-1.7.0.dev0}/modal/running_app.py +0 -0
  217. {modal-1.6.5.dev11 → modal-1.7.0.dev0}/modal/sandbox/__init__.py +0 -0
  218. {modal-1.6.5.dev11 → modal-1.7.0.dev0}/modal/sandbox/_filesystem.py +0 -0
  219. {modal-1.6.5.dev11 → modal-1.7.0.dev0}/modal/sandbox/_sidecar.py +0 -0
  220. {modal-1.6.5.dev11 → modal-1.7.0.dev0}/modal/sandbox/_snapshot.py +0 -0
  221. {modal-1.6.5.dev11 → modal-1.7.0.dev0}/modal/sandbox/_task_command_router_client.py +0 -0
  222. {modal-1.6.5.dev11 → modal-1.7.0.dev0}/modal/sandbox/sandbox.py +0 -0
  223. {modal-1.6.5.dev11 → modal-1.7.0.dev0}/modal/schedule.py +0 -0
  224. {modal-1.6.5.dev11 → modal-1.7.0.dev0}/modal/scheduler_placement.py +0 -0
  225. {modal-1.6.5.dev11 → modal-1.7.0.dev0}/modal/secret.py +0 -0
  226. {modal-1.6.5.dev11 → modal-1.7.0.dev0}/modal/secret.pyi +0 -0
  227. {modal-1.6.5.dev11 → modal-1.7.0.dev0}/modal/server.py +0 -0
  228. {modal-1.6.5.dev11 → modal-1.7.0.dev0}/modal/serving.py +0 -0
  229. {modal-1.6.5.dev11 → modal-1.7.0.dev0}/modal/serving.pyi +0 -0
  230. {modal-1.6.5.dev11 → modal-1.7.0.dev0}/modal/skills/modal/SKILL.md +0 -0
  231. {modal-1.6.5.dev11 → modal-1.7.0.dev0}/modal/stream_type.py +0 -0
  232. {modal-1.6.5.dev11 → modal-1.7.0.dev0}/modal/token_flow.py +0 -0
  233. {modal-1.6.5.dev11 → modal-1.7.0.dev0}/modal/token_flow.pyi +0 -0
  234. {modal-1.6.5.dev11 → modal-1.7.0.dev0}/modal/types.py +0 -0
  235. {modal-1.6.5.dev11 → modal-1.7.0.dev0}/modal/volume.py +0 -0
  236. {modal-1.6.5.dev11 → modal-1.7.0.dev0}/modal/workspace.py +0 -0
  237. {modal-1.6.5.dev11 → modal-1.7.0.dev0}/modal/workspace.pyi +0 -0
  238. {modal-1.6.5.dev11 → modal-1.7.0.dev0}/modal.egg-info/dependency_links.txt +0 -0
  239. {modal-1.6.5.dev11 → modal-1.7.0.dev0}/modal.egg-info/entry_points.txt +0 -0
  240. {modal-1.6.5.dev11 → modal-1.7.0.dev0}/modal.egg-info/top_level.txt +0 -0
  241. {modal-1.6.5.dev11 → modal-1.7.0.dev0}/modal_docs/__init__.py +0 -0
  242. {modal-1.6.5.dev11 → modal-1.7.0.dev0}/modal_docs/gen_cli_docs.py +0 -0
  243. {modal-1.6.5.dev11 → modal-1.7.0.dev0}/modal_docs/gen_cli_docs_main.py +0 -0
  244. {modal-1.6.5.dev11 → modal-1.7.0.dev0}/modal_docs/gen_reference_docs.py +0 -0
  245. {modal-1.6.5.dev11 → modal-1.7.0.dev0}/modal_docs/gen_reference_docs_main.py +0 -0
  246. {modal-1.6.5.dev11 → modal-1.7.0.dev0}/modal_docs/mdmd/__init__.py +0 -0
  247. {modal-1.6.5.dev11 → modal-1.7.0.dev0}/modal_docs/mdmd/mdmd.py +0 -0
  248. {modal-1.6.5.dev11 → modal-1.7.0.dev0}/modal_docs/mdmd/signatures.py +0 -0
  249. {modal-1.6.5.dev11 → modal-1.7.0.dev0}/modal_docs/mdmd/types.py +0 -0
  250. {modal-1.6.5.dev11 → modal-1.7.0.dev0}/modal_docs/reference_intro.md +0 -0
  251. {modal-1.6.5.dev11 → modal-1.7.0.dev0}/modal_proto/__init__.py +0 -0
  252. {modal-1.6.5.dev11 → modal-1.7.0.dev0}/modal_proto/api_grpc.py +0 -0
  253. {modal-1.6.5.dev11 → modal-1.7.0.dev0}/modal_proto/api_pb2_grpc.py +0 -0
  254. {modal-1.6.5.dev11 → modal-1.7.0.dev0}/modal_proto/api_pb2_grpc.pyi +0 -0
  255. {modal-1.6.5.dev11 → modal-1.7.0.dev0}/modal_proto/modal_api_grpc.py +0 -0
  256. {modal-1.6.5.dev11 → modal-1.7.0.dev0}/modal_proto/py.typed +0 -0
  257. {modal-1.6.5.dev11 → modal-1.7.0.dev0}/modal_proto/task_command_router_grpc.py +0 -0
  258. {modal-1.6.5.dev11 → modal-1.7.0.dev0}/modal_proto/task_command_router_pb2.pyi +0 -0
  259. {modal-1.6.5.dev11 → modal-1.7.0.dev0}/modal_proto/task_command_router_pb2_grpc.py +0 -0
  260. {modal-1.6.5.dev11 → modal-1.7.0.dev0}/modal_proto/task_command_router_pb2_grpc.pyi +0 -0
  261. {modal-1.6.5.dev11 → modal-1.7.0.dev0}/modal_version/__main__.py +0 -0
  262. {modal-1.6.5.dev11 → modal-1.7.0.dev0}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: modal
3
- Version: 1.6.5.dev11
3
+ Version: 1.7.0.dev0
4
4
  Summary: Python client library for Modal
5
5
  Author-email: Modal Labs <support@modal.com>
6
6
  License-Expression: Apache-2.0
@@ -12,7 +12,7 @@ Keywords: modal,client,cloud,serverless,infrastructure
12
12
  Classifier: Topic :: System :: Distributed Computing
13
13
  Classifier: Operating System :: OS Independent
14
14
  Classifier: Programming Language :: Python :: 3
15
- Requires-Python: <3.16,>=3.10
15
+ Requires-Python: <3.16,>=3.11
16
16
  Description-Content-Type: text/markdown
17
17
  License-File: LICENSE
18
18
  Requires-Dist: aiohttp
@@ -21,7 +21,7 @@ Requires-Dist: certifi
21
21
  Requires-Dist: click~=8.1
22
22
  Requires-Dist: grpclib<0.4.10,>=0.4.7; python_version < "3.14"
23
23
  Requires-Dist: grpclib<0.4.10,>=0.4.9; python_version >= "3.14"
24
- Requires-Dist: protobuf!=4.24.0,<8.0,>=3.19
24
+ Requires-Dist: protobuf!=4.24.0,<8.0,>=4.21.3
25
25
  Requires-Dist: rich>=12.0.0
26
26
  Requires-Dist: synchronicity~=0.12.7
27
27
  Requires-Dist: toml
@@ -55,7 +55,7 @@ a [user guide](https://modal.com/docs/guide), and the detailed
55
55
 
56
56
  ## Installation
57
57
 
58
- **This library requires Python 3.10 – 3.15.**
58
+ **This library requires Python 3.11 – 3.15.**
59
59
 
60
60
  Install the package with `uv` or `pip`:
61
61
 
@@ -16,7 +16,7 @@ a [user guide](https://modal.com/docs/guide), and the detailed
16
16
 
17
17
  ## Installation
18
18
 
19
- **This library requires Python 3.10 – 3.15.**
19
+ **This library requires Python 3.11 – 3.15.**
20
20
 
21
21
  Install the package with `uv` or `pip`:
22
22
 
@@ -1,9 +1,8 @@
1
1
  # Copyright Modal Labs 2022
2
- import os
3
2
  import sys
4
3
 
5
- if sys.version_info[:2] < (3, 10):
6
- raise RuntimeError("This version of Modal requires at least Python 3.10")
4
+ if sys.version_info[:2] < (3, 11):
5
+ raise RuntimeError("This version of Modal requires at least Python 3.11")
7
6
  if sys.version_info[:2] >= (3, 16):
8
7
  raise RuntimeError("This version of Modal does not support Python 3.16+")
9
8
 
@@ -61,17 +60,6 @@ except Exception:
61
60
  print()
62
61
  raise
63
62
 
64
- if sys.version_info[:2] == (3, 10) and os.environ.get("MODAL_IS_REMOTE") != "1":
65
- from ._utils.deprecation import deprecation_warning
66
-
67
- deprecation_warning(
68
- (2026, 11, 4),
69
- "Python 3.10 is EOL and Modal will not support it in version 1.7.0. "
70
- "Please upgrade your local Python to 3.11 or later.",
71
- show_source=False,
72
- )
73
-
74
-
75
63
  __all__ = [
76
64
  "__version__",
77
65
  "App",
@@ -57,10 +57,16 @@ class _EnvironmentManager:
57
57
  check_environment_name(name, allow_periods=False)
58
58
 
59
59
  client = await _Client.from_env() if client is None else client
60
- request = api_pb2.EnvironmentCreateRequest(name=name, is_managed=restricted)
60
+ options = dict(experimental_options or {})
61
+ is_public = options.pop("is_public", False)
62
+ request = api_pb2.EnvironmentCreateRequest(
63
+ name=name,
64
+ is_managed=restricted,
65
+ experimental_options={k: str(v) for k, v in options.items()},
66
+ )
61
67
  if default_role:
62
68
  request.default_member_role_str = default_role
63
- if (experimental_options or {}).get("is_public", False):
69
+ if is_public:
64
70
  request.environment_type = api_pb2.ENVIRONMENT_TYPE_PUBLIC
65
71
  await client._stub.EnvironmentCreate(request)
66
72
 
@@ -37,7 +37,6 @@ from ._serialization import get_preferred_payload_format, serialize
37
37
  from ._supports_logs import _ImageLogQueryData
38
38
  from ._utils.async_utils import TaskContext, deprecate_aio_usage, synchronizer
39
39
  from ._utils.blob_utils import MAX_OBJECT_SIZE_BYTES
40
- from ._utils.deprecation import deprecation_warning
41
40
  from ._utils.docker_utils import (
42
41
  extract_copy_command_patterns,
43
42
  find_dockerignore_file,
@@ -82,29 +81,13 @@ LATEST_IMAGE_BUILDER_VERSION: ImageBuilderVersion = "2026.10"
82
81
  SUPPORTED_PYTHON_SERIES: dict[ImageBuilderVersion, list[str]] = {
83
82
  "PREVIEW": ["3.11", "3.12", "3.13", "3.14", "3.14t", "3.15", "3.15t"],
84
83
  "2026.10": ["3.11", "3.12", "3.13", "3.14", "3.14t", "3.15", "3.15t"],
85
- "2025.06": ["3.10", "3.11", "3.12", "3.13", "3.14", "3.14t", "3.15", "3.15t"],
86
- "2024.10": ["3.10", "3.11", "3.12", "3.13"],
87
- "2024.04": ["3.10", "3.11", "3.12"],
88
- "2023.12": ["3.10", "3.11", "3.12"],
84
+ "2025.06": ["3.11", "3.12", "3.13", "3.14", "3.14t", "3.15", "3.15t"],
85
+ "2024.10": ["3.11", "3.12", "3.13"],
86
+ "2024.04": ["3.11", "3.12"],
87
+ "2023.12": ["3.11", "3.12"],
89
88
  }
90
89
 
91
90
 
92
- def _uses_python_310(metadata: api_pb2.ImageMetadata | None) -> bool:
93
- return metadata is not None and bool(re.match(r"Python 3\.10\.", metadata.python_version_info))
94
-
95
-
96
- def _warn_if_python_310(image_id: str, metadata: api_pb2.ImageMetadata | None) -> None:
97
- if _uses_python_310(metadata):
98
- deprecation_warning(
99
- (2026, 11, 4),
100
- f"Image {image_id} uses Python 3.10, which is EOL. Modal 1.7.0 and later will not run or deploy apps "
101
- "that use Images with Python 3.10; apps already deployed with older clients keep working. "
102
- "Please update the Image to use Python 3.11 or later "
103
- "(e.g. via `python_version=` or `add_python=`).",
104
- show_source=False,
105
- )
106
-
107
-
108
91
  LOCAL_REQUIREMENTS_DIR = Path(__file__).parent / "builder"
109
92
  CONTAINER_REQUIREMENTS_PATH = "/modal_requirements.txt"
110
93
 
@@ -532,6 +515,10 @@ class DockerfileSpec:
532
515
  context_files: dict[str, str] = field(default_factory=dict)
533
516
 
534
517
 
518
+ def _standalone_python_arch(platform: str | None) -> str:
519
+ return "aarch64" if platform == "linux/arm64" else "x86_64"
520
+
521
+
535
522
  async def _image_await_build_result(image_id: str, client: _Client) -> api_pb2.ImageJoinStreamingResponse:
536
523
  last_entry_id: str = ""
537
524
  result_response: api_pb2.ImageJoinStreamingResponse | None = None
@@ -708,7 +695,7 @@ class _Image(_Object, type_prefixes=("im",)):
708
695
  # For internal use only.
709
696
  _namespace: "api_pb2.DeploymentNamespace.ValueType" = api_pb2.DEPLOYMENT_NAMESPACE_WORKSPACE,
710
697
  _do_assert_no_mount_layers: bool = True,
711
- _arch: "api_pb2.Arch.ValueType" = api_pb2.ARCH_UNSPECIFIED,
698
+ _platform: str | None = None,
712
699
  ):
713
700
  if base_images is None:
714
701
  base_images = {}
@@ -832,7 +819,7 @@ class _Image(_Object, type_prefixes=("im",)):
832
819
  build_function=_build_function,
833
820
  build_args=build_args,
834
821
  volume_mounts=volume_mounts,
835
- arch=_arch,
822
+ platform=_platform or "",
836
823
  )
837
824
 
838
825
  req = api_pb2.ImageGetOrCreateRequest(
@@ -897,8 +884,6 @@ class _Image(_Object, type_prefixes=("im",)):
897
884
  raise ImageBuildError("Unknown status %s!" % result.status, image_id)
898
885
 
899
886
  self._hydrate(image_id, load_context.client, metadata)
900
- if not any(_uses_python_310(base._metadata) for base in base_images.values()):
901
- _warn_if_python_310(image_id, metadata)
902
887
  local_mounts: set[_Mount] = set()
903
888
  for base in base_images.values():
904
889
  local_mounts |= base._serve_mounts
@@ -1120,7 +1105,6 @@ class _Image(_Object, type_prefixes=("im",)):
1120
1105
  async def _load(self: _Image, resolver: Resolver, load_context: LoadContext, existing_object_id: str | None):
1121
1106
  resp = await load_context.client._stub.ImageFromId(api_pb2.ImageFromIdRequest(image_id=image_id))
1122
1107
  self._hydrate(resp.image_id, load_context.client, resp.metadata)
1123
- _warn_if_python_310(resp.image_id, resp.metadata)
1124
1108
 
1125
1109
  rep = f"Image.from_id({image_id!r})"
1126
1110
 
@@ -2170,12 +2154,15 @@ class _Image(_Object, type_prefixes=("im",)):
2170
2154
  def micromamba(
2171
2155
  python_version: str | None = None,
2172
2156
  force_build: bool = False,
2157
+ *,
2158
+ platform: str | None = None,
2173
2159
  ) -> "_Image":
2174
2160
  """A Micromamba base image. Micromamba allows for fast building of small Conda-based containers.
2175
2161
 
2176
2162
  Args:
2177
2163
  python_version: Python series or full version to install in the base conda environment.
2178
2164
  force_build: If True, skip cached image builds.
2165
+ platform: Platform of the Image as `"linux/<arch>"`, e.g. `"linux/arm64"`. Defaults to `"linux/amd64"`.
2179
2166
 
2180
2167
  Returns:
2181
2168
  A Micromamba-based `Image`.
@@ -2205,6 +2192,7 @@ class _Image(_Object, type_prefixes=("im",)):
2205
2192
  dockerfile_function=build_dockerfile,
2206
2193
  force_build=force_build,
2207
2194
  _namespace=api_pb2.DEPLOYMENT_NAMESPACE_GLOBAL,
2195
+ _platform=platform,
2208
2196
  )
2209
2197
 
2210
2198
  @_requires_image_instance
@@ -2319,11 +2307,12 @@ class _Image(_Object, type_prefixes=("im",)):
2319
2307
  setup_dockerfile_commands: list[str] = [],
2320
2308
  force_build: bool = False,
2321
2309
  add_python: str | None = None,
2310
+ platform: str | None = None,
2322
2311
  **kwargs,
2323
2312
  ) -> "_Image":
2324
2313
  """Build a Modal Image from a public or private image registry, such as Docker Hub.
2325
2314
 
2326
- The image must be built for the `linux/amd64` platform.
2315
+ The registry image must have a variant for `platform`, if set.
2327
2316
 
2328
2317
  If your image does not come with Python installed, you can use the `add_python` parameter
2329
2318
  to specify a version of Python to add to the image. Otherwise, the image is expected to
@@ -2351,6 +2340,7 @@ class _Image(_Object, type_prefixes=("im",)):
2351
2340
  setup_dockerfile_commands: Extra Dockerfile lines run after ``FROM`` during base setup.
2352
2341
  force_build: If True, skip cached image builds.
2353
2342
  add_python: Optional standalone Python series to inject when the base image lacks Python.
2343
+ platform: Platform of the Image as `"linux/<arch>"`, e.g. `"linux/arm64"`.
2354
2344
  **kwargs: Additional arguments forwarded to the internal image constructor (e.g. registry config).
2355
2345
 
2356
2346
  Returns:
@@ -2361,6 +2351,7 @@ class _Image(_Object, type_prefixes=("im",)):
2361
2351
  modal.Image.from_registry("python:3.11-slim-bookworm")
2362
2352
  modal.Image.from_registry("ubuntu:22.04", add_python="3.11")
2363
2353
  modal.Image.from_registry("nvcr.io/nvidia/pytorch:22.12-py3")
2354
+ modal.Image.from_registry("python:3.12-slim", platform="linux/arm64")
2364
2355
  modal.Image.from_registry(
2365
2356
  "ghcr.io/my-org/my-image:latest",
2366
2357
  secret=modal.Secret.from_name("my-registry-secret"),
@@ -2368,14 +2359,10 @@ class _Image(_Object, type_prefixes=("im",)):
2368
2359
  ```
2369
2360
  """
2370
2361
 
2371
- arch = kwargs.get("_arch", api_pb2.ARCH_UNSPECIFIED)
2372
-
2373
2362
  def context_mount_function(builder_version: ImageBuilderVersion) -> _Mount | None:
2374
2363
  return (
2375
2364
  _Mount.from_name(
2376
- python_standalone_mount_name(
2377
- add_python, builder_version, "aarch64" if arch == api_pb2.ARCH_AARCH64 else "x86_64"
2378
- ),
2365
+ python_standalone_mount_name(add_python, builder_version, _standalone_python_arch(platform)),
2379
2366
  namespace=api_pb2.DEPLOYMENT_NAMESPACE_GLOBAL,
2380
2367
  )
2381
2368
  if add_python
@@ -2396,6 +2383,7 @@ class _Image(_Object, type_prefixes=("im",)):
2396
2383
  dockerfile_function=build_dockerfile,
2397
2384
  context_mount_function=context_mount_function,
2398
2385
  force_build=force_build,
2386
+ _platform=platform,
2399
2387
  **kwargs,
2400
2388
  )
2401
2389
  if not add_python:
@@ -2406,7 +2394,7 @@ class _Image(_Object, type_prefixes=("im",)):
2406
2394
  dockerfile_function=lambda version: DockerfileSpec(commands=[f"FROM {tag}"], context_files={}),
2407
2395
  image_registry_config=kwargs.get("image_registry_config"),
2408
2396
  force_build=force_build,
2409
- _arch=arch,
2397
+ _platform=platform,
2410
2398
  )
2411
2399
 
2412
2400
  def build_python_dockerfile(version: ImageBuilderVersion) -> DockerfileSpec:
@@ -2579,6 +2567,7 @@ class _Image(_Object, type_prefixes=("im",)):
2579
2567
  env: dict[str, str | None] | None = None,
2580
2568
  gpu: str | None = None,
2581
2569
  add_python: str | None = None,
2570
+ platform: str | None = None,
2582
2571
  ) -> "_Image":
2583
2572
  """Build a Modal image from a local Dockerfile.
2584
2573
 
@@ -2599,6 +2588,7 @@ class _Image(_Object, type_prefixes=("im",)):
2599
2588
  env: Environment variables set in the build container.
2600
2589
  gpu: GPU type to attach to the build container.
2601
2590
  add_python: Standalone Python version to add when the Dockerfile does not install Python.
2591
+ platform: Platform of the Image as `"linux/<arch>"`, e.g. `"linux/arm64"`.
2602
2592
 
2603
2593
  Returns:
2604
2594
  An `Image` built from the Dockerfile plus Modal runtime dependencies.
@@ -2680,12 +2670,13 @@ class _Image(_Object, type_prefixes=("im",)):
2680
2670
  build_args=build_args,
2681
2671
  image_registry_config=image_registry_config,
2682
2672
  force_build=force_build,
2673
+ _platform=platform if base_images is None else None,
2683
2674
  )
2684
2675
 
2685
2676
  def add_python_mount(builder_version: ImageBuilderVersion) -> _Mount | None:
2686
2677
  return (
2687
2678
  _Mount.from_name(
2688
- python_standalone_mount_name(add_python, builder_version),
2679
+ python_standalone_mount_name(add_python, builder_version, _standalone_python_arch(platform)),
2689
2680
  namespace=api_pb2.DEPLOYMENT_NAMESPACE_GLOBAL,
2690
2681
  )
2691
2682
  if add_python
@@ -2735,6 +2726,7 @@ class _Image(_Object, type_prefixes=("im",)):
2735
2726
  dockerfile_function=lambda version: DockerfileSpec(commands=from_lines, context_files={}),
2736
2727
  image_registry_config=registry_config,
2737
2728
  force_build=force_build,
2729
+ _platform=platform,
2738
2730
  )
2739
2731
  rest = dockerfile_lines[from_index + 1 :]
2740
2732
  rest_is_empty = all(not line.strip() or line.strip().startswith("#") for line in rest)
@@ -2757,7 +2749,7 @@ class _Image(_Object, type_prefixes=("im",)):
2757
2749
  return obj
2758
2750
 
2759
2751
  @staticmethod
2760
- def from_scratch(force_build: bool = False) -> "_Image":
2752
+ def from_scratch(force_build: bool = False, *, platform: str | None = None) -> "_Image":
2761
2753
  """Create an empty Image, equivalent to `FROM scratch` in Docker.
2762
2754
 
2763
2755
  The resulting Image has no operating system, shell, or package manager. It is
@@ -2770,6 +2762,7 @@ class _Image(_Object, type_prefixes=("im",)):
2770
2762
 
2771
2763
  Args:
2772
2764
  force_build: If True, skip cached image builds.
2765
+ platform: Platform of the Image as `"linux/<arch>"`, e.g. `"linux/arm64"`. Defaults to `"linux/amd64"`.
2773
2766
 
2774
2767
  Returns:
2775
2768
  An empty `Image` suitable for minimal filesystem mounts.
@@ -2787,17 +2780,21 @@ class _Image(_Object, type_prefixes=("im",)):
2787
2780
  dockerfile_function=build_dockerfile,
2788
2781
  force_build=force_build,
2789
2782
  _namespace=api_pb2.DEPLOYMENT_NAMESPACE_GLOBAL,
2783
+ _platform=platform,
2790
2784
  )
2791
2785
  image._is_empty = True
2792
2786
  return image
2793
2787
 
2794
2788
  @staticmethod
2795
- def debian_slim(python_version: str | None = None, force_build: bool = False) -> "_Image":
2789
+ def debian_slim(
2790
+ python_version: str | None = None, force_build: bool = False, *, platform: str | None = None
2791
+ ) -> "_Image":
2796
2792
  """Default image, based on the official `python` Docker images.
2797
2793
 
2798
2794
  Args:
2799
2795
  python_version: Python series or full version to use from the Debian slim images.
2800
2796
  force_build: If True, skip cached image builds.
2797
+ platform: Platform of the Image as `"linux/<arch>"`, e.g. `"linux/arm64"`. Defaults to `"linux/amd64"`.
2801
2798
 
2802
2799
  Returns:
2803
2800
  The standard Debian slim Python `Image` used as Modal's default base.
@@ -2855,6 +2852,7 @@ class _Image(_Object, type_prefixes=("im",)):
2855
2852
  dockerfile_function=build_dockerfile,
2856
2853
  force_build=force_build,
2857
2854
  _namespace=api_pb2.DEPLOYMENT_NAMESPACE_GLOBAL,
2855
+ _platform=platform,
2858
2856
  )
2859
2857
 
2860
2858
  @_requires_image_instance
@@ -910,8 +910,9 @@ def _localized(
910
910
  max_distance="long",
911
911
  )
912
912
  ```
913
+
914
+ See the [localized placement guide](https://modal.com/docs/guide/localized) for more information.
913
915
  """
914
- # TODO(clairec): Add the localized placement guide link once available.
915
916
  localized = {
916
917
  "target_location": target_location,
917
918
  "preferred_distance": preferred_distance,
@@ -367,7 +367,7 @@ class _LifecycleManager:
367
367
  task_lifecycle_manager: "modal._runtime.task_lifecycle_manager.TaskLifecycleManager",
368
368
  ):
369
369
  # Identify the "enter" methods to run after resuming from a snapshot.
370
- flash_entry = _FlashContainerEntry(self.function_def.http_config, is_server=self.function_def.is_server)
370
+ flash_entry = _FlashContainerEntry(self.function_def.http_config)
371
371
  if not self.function_def.is_auto_snapshot:
372
372
  post_snapshot_methods = _find_callables_for_obj(
373
373
  self.user_cls_instance, _PartialFunctionFlags.ENTER_POST_SNAPSHOT
@@ -378,7 +378,6 @@ class _LifecycleManager:
378
378
  yield
379
379
  finally:
380
380
  if not self.function_def.is_auto_snapshot:
381
- flash_entry.stop()
382
381
  exit_methods = _find_callables_for_obj(self.user_cls_instance, _PartialFunctionFlags.EXIT)
383
382
  call_lifecycle_functions(event_loop, task_lifecycle_manager, list(exit_methods.values()))
384
383
  flash_entry.close()
@@ -185,7 +185,7 @@ class _Server:
185
185
  @classmethod
186
186
  def _new_from_function(
187
187
  cls, object_id: str, client: modal.client._Client, metadata: modal_proto.api_pb2.FunctionHandleMetadata
188
- ) -> typing_extensions.Self:
188
+ ) -> typing.Self:
189
189
  """mdmd:hidden
190
190
 
191
191
  Callers which already have handle metadata for a Server service function can use this method to
@@ -438,7 +438,7 @@ class _App:
438
438
  tag: str = "",
439
439
  client: typing.Optional[modal.client._Client] = None,
440
440
  strategy: str = "rolling",
441
- ) -> typing_extensions.Self:
441
+ ) -> typing.Self:
442
442
  """Deploy the App so that it is available persistently.
443
443
 
444
444
  Deployed Apps will be available for lookup or web-based invocations until they are stopped.
@@ -901,7 +901,7 @@ class _App:
901
901
  """
902
902
  ...
903
903
 
904
- def include(self, /, other_app: _App, inherit_tags: bool = True) -> typing_extensions.Self:
904
+ def include(self, /, other_app: _App, inherit_tags: bool = True) -> typing.Self:
905
905
  """Include another App's objects in this one.
906
906
 
907
907
  Useful for splitting up Modal Apps across different self-contained files.
@@ -2118,7 +2118,7 @@ class App:
2118
2118
  """
2119
2119
  ...
2120
2120
 
2121
- def include(self, /, other_app: App, inherit_tags: bool = True) -> typing_extensions.Self:
2121
+ def include(self, /, other_app: App, inherit_tags: bool = True) -> typing.Self:
2122
2122
  """Include another App's objects in this one.
2123
2123
 
2124
2124
  Useful for splitting up Modal Apps across different self-contained files.
@@ -209,7 +209,7 @@ async def logs(
209
209
  if is_v2_sandbox:
210
210
  assert sandbox_id is not None
211
211
  sandbox = await _Sandbox.from_id(sandbox_id, client)
212
- app_id = sandbox._app_id or ""
212
+ app_id = await sandbox._get_app_id()
213
213
  try:
214
214
  task_id = await asyncio.wait_for(
215
215
  sandbox._get_task_id(raise_if_task_complete=True),
@@ -122,6 +122,13 @@ def _check_registry_host(image_ref: str) -> None:
122
122
  ),
123
123
  )
124
124
  @click.option("--force-build", is_flag=True, help="Rebuild every layer of the Image, ignoring cached builds.")
125
+ @click.option(
126
+ "--platform",
127
+ "image_platform",
128
+ default=None,
129
+ metavar="OS/ARCH",
130
+ help="Platform of the Image, e.g. `linux/arm64`.",
131
+ )
125
132
  @env_option
126
133
  @synchronizer.create_blocking
127
134
  async def build(
@@ -131,6 +138,7 @@ async def build(
131
138
  registry_secret_name: Optional[str],
132
139
  registry_secret_vars: Optional[str],
133
140
  force_build: bool,
141
+ image_platform: Optional[str],
134
142
  env: Optional[str],
135
143
  ) -> None:
136
144
  """Build an Image from a Dockerfile and publish it as NAME.
@@ -145,6 +153,7 @@ async def build(
145
153
 
146
154
  ```
147
155
  modal image build -t my-image .
156
+ modal image build -t my-image --platform linux/arm64 .
148
157
  modal image build --name my-image:v2 -f docker/Dockerfile .
149
158
  modal image build -t my-env/my-image .
150
159
  modal image build -t my-image --registry-secret my-registry-creds .
@@ -170,7 +179,9 @@ async def build(
170
179
  _infer_registry_auth_type(keys)
171
180
  except InvalidError as exc:
172
181
  raise click.UsageError(str(exc)) from exc
173
- image = _Image.from_dockerfile(dockerfile, context_dir=context_dir, registry_secret=secret, force_build=force_build)
182
+ image = _Image.from_dockerfile(
183
+ dockerfile, context_dir=context_dir, registry_secret=secret, force_build=force_build, platform=image_platform
184
+ )
174
185
  app = _App("modal-image-build")
175
186
  # Only show the Image build output, which includes its logs
176
187
  async with _run_app(app, environment_name=env, stream_output=False):
@@ -213,6 +224,13 @@ async def build(
213
224
  is_flag=True,
214
225
  help="Pull the image from the registry again, replacing a cached Image.",
215
226
  )
227
+ @click.option(
228
+ "--platform",
229
+ "image_platform",
230
+ default=None,
231
+ metavar="OS/ARCH",
232
+ help="Platform of the Image, e.g. `linux/arm64`.",
233
+ )
216
234
  @env_option
217
235
  @synchronizer.create_blocking
218
236
  async def pull(
@@ -222,6 +240,7 @@ async def pull(
222
240
  registry_secret_name: Optional[str] = None,
223
241
  registry_secret_vars: Optional[str] = None,
224
242
  force_build: bool = False,
243
+ image_platform: Optional[str] = None,
225
244
  env: Optional[str] = None,
226
245
  ) -> None:
227
246
  """Pull an Image from a container registry into Modal.
@@ -236,6 +255,7 @@ async def pull(
236
255
 
237
256
  ```bash
238
257
  modal image pull docker.io/node:20
258
+ modal image pull docker.io/node:20 --platform linux/arm64
239
259
  modal image pull nvcr.io/nvidia/pytorch:25.01-py3 --name pytorch:25
240
260
  modal image pull docker.io/node:20 --name prod/node:20
241
261
  ```
@@ -270,7 +290,7 @@ async def pull(
270
290
  _infer_registry_auth_type(keys)
271
291
  except InvalidError as exc:
272
292
  raise click.UsageError(str(exc)) from exc
273
- image = _Image.from_registry(image_ref, secret, force_build=force_build)
293
+ image = _Image.from_registry(image_ref, secret, force_build=force_build, platform=image_platform)
274
294
 
275
295
  app = _App("modal-image-pull")
276
296
  async with _run_app(app, environment_name=env, stream_output=False):
@@ -276,6 +276,13 @@ def _start_shell_from_image(
276
276
  @click.option("-e", "--env", default=None, help=ENV_OPTION_HELP)
277
277
  @click.option("--image", default=None, help="Container image tag for inside the shell (if not using REF).")
278
278
  @click.option("--add-python", default=None, help="Add Python to the image (if not using REF).")
279
+ @click.option(
280
+ "--platform",
281
+ "image_platform",
282
+ default=None,
283
+ metavar="OS/ARCH",
284
+ help="Platform of the image, e.g. `linux/arm64` (if not using REF).",
285
+ )
279
286
  @click.option(
280
287
  "--volume",
281
288
  multiple=True,
@@ -357,6 +364,7 @@ def shell(
357
364
  env: str | None = None,
358
365
  image: str | None = None,
359
366
  add_python: str | None = None,
367
+ image_platform: str | None = None,
360
368
  volume: tuple[str, ...] = (),
361
369
  add_local: tuple[str, ...] = (),
362
370
  secret: tuple[str, ...] = (),
@@ -407,6 +415,12 @@ def shell(
407
415
  modal shell hello_world.py -c 'uv pip list' > env.txt
408
416
  ```
409
417
 
418
+ Start a shell inside an arm64 image:
419
+
420
+ ```
421
+ modal shell --platform linux/arm64
422
+ ```
423
+
410
424
  Start a shell inside a virtual machine:
411
425
 
412
426
  ```
@@ -472,7 +486,7 @@ def shell(
472
486
  if ref is not None and _is_valid_modal_id(ref, "im-"):
473
487
  ctx = click.get_current_context()
474
488
  if passed_forbidden := _passed_forbidden_args(
475
- shell.params, ctx, locals(), allowed=lambda p: p not in {"add_python", "image"}
489
+ shell.params, ctx, locals(), allowed=lambda p: p not in {"add_python", "image", "image_platform"}
476
490
  ):
477
491
  raise ClickException(
478
492
  f"Cannot specify {', '.join(passed_forbidden)} argument(s) "
@@ -480,7 +494,12 @@ def shell(
480
494
  )
481
495
  modal_image = Image.from_id(ref)
482
496
  else:
483
- modal_image = Image.from_registry(image, add_python=add_python) if image else None
497
+ if image:
498
+ modal_image = Image.from_registry(image, add_python=add_python, platform=image_platform)
499
+ elif image_platform:
500
+ modal_image = Image.debian_slim(platform=image_platform)
501
+ else:
502
+ modal_image = None
484
503
 
485
504
  _start_shell_from_image(
486
505
  app,
@@ -78,7 +78,7 @@ class _Client:
78
78
  server_url: str,
79
79
  client_type: int,
80
80
  credentials: typing.Optional[tuple[str, str]],
81
- version: str = "1.6.5.dev11",
81
+ version: str = "1.7.0.dev0",
82
82
  *,
83
83
  oauth_credentials: typing.Optional[_OAuthCredentials] = None,
84
84
  ):
@@ -295,7 +295,7 @@ class Client:
295
295
  server_url: str,
296
296
  client_type: int,
297
297
  credentials: typing.Optional[tuple[str, str]],
298
- version: str = "1.6.5.dev11",
298
+ version: str = "1.7.0.dev0",
299
299
  *,
300
300
  oauth_credentials: typing.Optional[_OAuthCredentials] = None,
301
301
  ):
@@ -27,15 +27,6 @@ from ..cls import _Cls
27
27
  from ..exception import InvalidError as InvalidError
28
28
  from ..partial_function import clustered as _public_clustered, localized as localized
29
29
  from ..secret import _Secret as _Secret
30
- from .flash import ( # noqa: F401
31
- flash_forward,
32
- flash_get_containers,
33
- http_server,
34
- )
35
- from .flash_server import ( # noqa: F401
36
- ServerManager,
37
- server_forward,
38
- )
39
30
  from .stream import (
40
31
  AppendResult as AppendResult,
41
32
  Entry as Entry,
@@ -0,0 +1,36 @@
1
+ # Copyright Modal Labs 2025
2
+
3
+
4
+ from modal_proto import api_pb2
5
+
6
+ from .._runtime.task_lifecycle_manager import UserException
7
+ from ..config import logger
8
+ from .flash_server import ServerManager, server_forward
9
+
10
+
11
+ class _FlashContainerEntry:
12
+ """
13
+ A class that manages the lifecycle of Flash manager for Flash containers.
14
+
15
+ It is intentional that stop() runs before exit handlers and close(): new requests stop arriving
16
+ before exit handlers run, and in-flight requests keep working until the exit grace period has
17
+ elapsed. For server containers both calls are no-ops.
18
+ """
19
+
20
+ flash_manager: ServerManager | None
21
+
22
+ def __init__(self, http_config: api_pb2.HTTPConfig):
23
+ self.http_config: api_pb2.HTTPConfig = http_config
24
+ self.flash_manager = None
25
+
26
+ def enter(self):
27
+ if self.http_config != api_pb2.HTTPConfig():
28
+ try:
29
+ self.flash_manager = server_forward()
30
+ except Exception as e:
31
+ logger.warning(f"[Modal Server] Startup failed: {e}")
32
+ raise UserException()
33
+
34
+ def close(self):
35
+ if self.flash_manager:
36
+ self.flash_manager.close()
@@ -20,9 +20,6 @@ class _ServerManager:
20
20
  await self.client._stub.ContainerServerLifecycleReady(api_pb2.ContainerServerLifecycleReadyRequest())
21
21
  logger.warning(f"[Modal Server] Ready for task {self.task_id}.")
22
22
 
23
- async def stop(self):
24
- pass
25
-
26
23
  async def close(self):
27
24
  logger.warning(f"[Modal Server] Drained for task {self.task_id}.")
28
25
 
@@ -7,7 +7,6 @@ class _ServerManager:
7
7
  ...
8
8
 
9
9
  async def _start(self): ...
10
- async def stop(self): ...
11
10
  async def close(self): ...
12
11
 
13
12
  class ServerManager:
@@ -19,12 +18,6 @@ class ServerManager:
19
18
 
20
19
  _start: ___start_spec
21
20
 
22
- class __stop_spec(typing_extensions.Protocol):
23
- def __call__(self, /): ...
24
- async def aio(self, /): ...
25
-
26
- stop: __stop_spec
27
-
28
21
  class __close_spec(typing_extensions.Protocol):
29
22
  def __call__(self, /): ...
30
23
  async def aio(self, /): ...