modal 1.1.5.dev66__py3-none-any.whl → 1.3.1.dev8__py3-none-any.whl

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.

Potentially problematic release.


This version of modal might be problematic. Click here for more details.

Files changed (143) hide show
  1. modal/__init__.py +4 -4
  2. modal/__main__.py +4 -29
  3. modal/_billing.py +84 -0
  4. modal/_clustered_functions.py +1 -3
  5. modal/_container_entrypoint.py +33 -208
  6. modal/_functions.py +171 -138
  7. modal/_grpc_client.py +191 -0
  8. modal/_ipython.py +16 -6
  9. modal/_load_context.py +106 -0
  10. modal/_object.py +72 -21
  11. modal/_output.py +12 -14
  12. modal/_partial_function.py +31 -4
  13. modal/_resolver.py +44 -57
  14. modal/_runtime/container_io_manager.py +30 -28
  15. modal/_runtime/container_io_manager.pyi +42 -44
  16. modal/_runtime/gpu_memory_snapshot.py +9 -7
  17. modal/_runtime/user_code_event_loop.py +80 -0
  18. modal/_runtime/user_code_imports.py +236 -10
  19. modal/_serialization.py +2 -1
  20. modal/_traceback.py +4 -13
  21. modal/_tunnel.py +16 -11
  22. modal/_tunnel.pyi +25 -3
  23. modal/_utils/async_utils.py +337 -10
  24. modal/_utils/auth_token_manager.py +1 -4
  25. modal/_utils/blob_utils.py +29 -22
  26. modal/_utils/function_utils.py +20 -21
  27. modal/_utils/grpc_testing.py +6 -3
  28. modal/_utils/grpc_utils.py +223 -64
  29. modal/_utils/mount_utils.py +26 -1
  30. modal/_utils/name_utils.py +2 -3
  31. modal/_utils/package_utils.py +0 -1
  32. modal/_utils/rand_pb_testing.py +8 -1
  33. modal/_utils/task_command_router_client.py +524 -0
  34. modal/_vendor/cloudpickle.py +144 -48
  35. modal/app.py +285 -105
  36. modal/app.pyi +216 -53
  37. modal/billing.py +5 -0
  38. modal/builder/2025.06.txt +6 -3
  39. modal/builder/PREVIEW.txt +2 -1
  40. modal/builder/base-images.json +4 -2
  41. modal/cli/_download.py +19 -3
  42. modal/cli/cluster.py +4 -2
  43. modal/cli/config.py +3 -1
  44. modal/cli/container.py +5 -4
  45. modal/cli/dict.py +5 -2
  46. modal/cli/entry_point.py +26 -2
  47. modal/cli/environment.py +2 -16
  48. modal/cli/launch.py +1 -76
  49. modal/cli/network_file_system.py +5 -20
  50. modal/cli/programs/run_jupyter.py +1 -1
  51. modal/cli/programs/vscode.py +1 -1
  52. modal/cli/queues.py +5 -4
  53. modal/cli/run.py +24 -204
  54. modal/cli/secret.py +1 -2
  55. modal/cli/shell.py +375 -0
  56. modal/cli/utils.py +1 -13
  57. modal/cli/volume.py +11 -17
  58. modal/client.py +16 -125
  59. modal/client.pyi +94 -144
  60. modal/cloud_bucket_mount.py +3 -1
  61. modal/cloud_bucket_mount.pyi +4 -0
  62. modal/cls.py +101 -64
  63. modal/cls.pyi +9 -8
  64. modal/config.py +21 -1
  65. modal/container_process.py +288 -12
  66. modal/container_process.pyi +99 -38
  67. modal/dict.py +72 -33
  68. modal/dict.pyi +88 -57
  69. modal/environments.py +16 -8
  70. modal/environments.pyi +6 -2
  71. modal/exception.py +154 -16
  72. modal/experimental/__init__.py +24 -53
  73. modal/experimental/flash.py +161 -74
  74. modal/experimental/flash.pyi +97 -49
  75. modal/file_io.py +50 -92
  76. modal/file_io.pyi +117 -89
  77. modal/functions.pyi +70 -87
  78. modal/image.py +82 -47
  79. modal/image.pyi +51 -30
  80. modal/io_streams.py +500 -149
  81. modal/io_streams.pyi +279 -189
  82. modal/mount.py +60 -46
  83. modal/mount.pyi +41 -17
  84. modal/network_file_system.py +19 -11
  85. modal/network_file_system.pyi +72 -39
  86. modal/object.pyi +114 -22
  87. modal/parallel_map.py +42 -44
  88. modal/parallel_map.pyi +9 -17
  89. modal/partial_function.pyi +4 -2
  90. modal/proxy.py +14 -6
  91. modal/proxy.pyi +10 -2
  92. modal/queue.py +45 -38
  93. modal/queue.pyi +88 -52
  94. modal/runner.py +96 -96
  95. modal/runner.pyi +44 -27
  96. modal/sandbox.py +225 -107
  97. modal/sandbox.pyi +226 -60
  98. modal/secret.py +58 -56
  99. modal/secret.pyi +28 -13
  100. modal/serving.py +7 -11
  101. modal/serving.pyi +7 -8
  102. modal/snapshot.py +29 -15
  103. modal/snapshot.pyi +18 -10
  104. modal/token_flow.py +1 -1
  105. modal/token_flow.pyi +4 -6
  106. modal/volume.py +102 -55
  107. modal/volume.pyi +125 -66
  108. {modal-1.1.5.dev66.dist-info → modal-1.3.1.dev8.dist-info}/METADATA +10 -9
  109. modal-1.3.1.dev8.dist-info/RECORD +189 -0
  110. modal_proto/api.proto +141 -70
  111. modal_proto/api_grpc.py +42 -26
  112. modal_proto/api_pb2.py +1123 -1103
  113. modal_proto/api_pb2.pyi +331 -83
  114. modal_proto/api_pb2_grpc.py +80 -48
  115. modal_proto/api_pb2_grpc.pyi +26 -18
  116. modal_proto/modal_api_grpc.py +175 -174
  117. modal_proto/task_command_router.proto +164 -0
  118. modal_proto/task_command_router_grpc.py +138 -0
  119. modal_proto/task_command_router_pb2.py +180 -0
  120. modal_proto/{sandbox_router_pb2.pyi → task_command_router_pb2.pyi} +148 -57
  121. modal_proto/task_command_router_pb2_grpc.py +272 -0
  122. modal_proto/task_command_router_pb2_grpc.pyi +100 -0
  123. modal_version/__init__.py +1 -1
  124. modal_version/__main__.py +1 -1
  125. modal/cli/programs/launch_instance_ssh.py +0 -94
  126. modal/cli/programs/run_marimo.py +0 -95
  127. modal-1.1.5.dev66.dist-info/RECORD +0 -191
  128. modal_proto/modal_options_grpc.py +0 -3
  129. modal_proto/options.proto +0 -19
  130. modal_proto/options_grpc.py +0 -3
  131. modal_proto/options_pb2.py +0 -35
  132. modal_proto/options_pb2.pyi +0 -20
  133. modal_proto/options_pb2_grpc.py +0 -4
  134. modal_proto/options_pb2_grpc.pyi +0 -7
  135. modal_proto/sandbox_router.proto +0 -125
  136. modal_proto/sandbox_router_grpc.py +0 -89
  137. modal_proto/sandbox_router_pb2.py +0 -128
  138. modal_proto/sandbox_router_pb2_grpc.py +0 -169
  139. modal_proto/sandbox_router_pb2_grpc.pyi +0 -63
  140. {modal-1.1.5.dev66.dist-info → modal-1.3.1.dev8.dist-info}/WHEEL +0 -0
  141. {modal-1.1.5.dev66.dist-info → modal-1.3.1.dev8.dist-info}/entry_points.txt +0 -0
  142. {modal-1.1.5.dev66.dist-info → modal-1.3.1.dev8.dist-info}/licenses/LICENSE +0 -0
  143. {modal-1.1.5.dev66.dist-info → modal-1.3.1.dev8.dist-info}/top_level.txt +0 -0
modal/functions.pyi CHANGED
@@ -1,6 +1,7 @@
1
1
  import collections.abc
2
2
  import google.protobuf.message
3
3
  import modal._functions
4
+ import modal._load_context
4
5
  import modal._utils.async_utils
5
6
  import modal._utils.function_utils
6
7
  import modal.app
@@ -17,7 +18,6 @@ import modal.parallel_map
17
18
  import modal.proxy
18
19
  import modal.retries
19
20
  import modal.schedule
20
- import modal.scheduler_placement
21
21
  import modal.secret
22
22
  import modal.volume
23
23
  import modal_proto.api_pb2
@@ -25,8 +25,6 @@ import pathlib
25
25
  import typing
26
26
  import typing_extensions
27
27
 
28
- SUPERSELF = typing.TypeVar("SUPERSELF", covariant=True)
29
-
30
28
  ReturnType_INNER = typing.TypeVar("ReturnType_INNER", covariant=True)
31
29
 
32
30
  P_INNER = typing_extensions.ParamSpec("P_INNER")
@@ -66,7 +64,7 @@ class Function(
66
64
  @staticmethod
67
65
  def from_local(
68
66
  info: modal._utils.function_utils.FunctionInfo,
69
- app,
67
+ app: typing.Optional[modal.app.App],
70
68
  image: modal.image.Image,
71
69
  env: typing.Optional[dict[str, typing.Optional[str]]] = None,
72
70
  secrets: typing.Optional[collections.abc.Collection[modal.secret.Secret]] = None,
@@ -96,7 +94,8 @@ class Function(
96
94
  batch_max_size: typing.Optional[int] = None,
97
95
  batch_wait_ms: typing.Optional[int] = None,
98
96
  cloud: typing.Optional[str] = None,
99
- scheduler_placement: typing.Optional[modal.scheduler_placement.SchedulerPlacement] = None,
97
+ region: typing.Union[str, collections.abc.Sequence[str], None] = None,
98
+ nonpreemptible: bool = False,
100
99
  is_builder_function: bool = False,
101
100
  is_auto_snapshot: bool = False,
102
101
  enable_memory_snapshot: bool = False,
@@ -105,13 +104,14 @@ class Function(
105
104
  i6pn_enabled: bool = False,
106
105
  cluster_size: typing.Optional[int] = None,
107
106
  rdma: typing.Optional[bool] = None,
108
- max_inputs: typing.Optional[int] = None,
107
+ single_use_containers: bool = False,
109
108
  ephemeral_disk: typing.Optional[int] = None,
110
109
  include_source: bool = True,
111
110
  experimental_options: typing.Optional[dict[str, str]] = None,
112
111
  _experimental_proxy_ip: typing.Optional[str] = None,
113
112
  _experimental_custom_scaling_factor: typing.Optional[float] = None,
114
113
  restrict_output: bool = False,
114
+ http_config: typing.Optional[modal_proto.api_pb2.HTTPConfig] = None,
115
115
  ) -> Function:
116
116
  """mdmd:hidden
117
117
 
@@ -132,7 +132,7 @@ class Function(
132
132
  """
133
133
  ...
134
134
 
135
- class __update_autoscaler_spec(typing_extensions.Protocol[SUPERSELF]):
135
+ class __update_autoscaler_spec(typing_extensions.Protocol):
136
136
  def __call__(
137
137
  self,
138
138
  /,
@@ -203,9 +203,9 @@ class Function(
203
203
  """
204
204
  ...
205
205
 
206
- update_autoscaler: __update_autoscaler_spec[typing_extensions.Self]
206
+ update_autoscaler: __update_autoscaler_spec
207
207
 
208
- class __keep_warm_spec(typing_extensions.Protocol[SUPERSELF]):
208
+ class __keep_warm_spec(typing_extensions.Protocol):
209
209
  def __call__(self, /, warm_pool_size: int) -> None:
210
210
  """mdmd:hidden
211
211
  Set the warm pool size for the Function.
@@ -242,13 +242,19 @@ class Function(
242
242
  """
243
243
  ...
244
244
 
245
- keep_warm: __keep_warm_spec[typing_extensions.Self]
245
+ keep_warm: __keep_warm_spec
246
246
 
247
247
  @classmethod
248
- def _from_name(cls, app_name: str, name: str, namespace=None, environment_name: typing.Optional[str] = None): ...
248
+ def _from_name(cls, app_name: str, name: str, *, load_context_overrides: modal._load_context.LoadContext): ...
249
249
  @classmethod
250
250
  def from_name(
251
- cls: type[Function], app_name: str, name: str, *, namespace=None, environment_name: typing.Optional[str] = None
251
+ cls: type[Function],
252
+ app_name: str,
253
+ name: str,
254
+ *,
255
+ namespace=None,
256
+ environment_name: typing.Optional[str] = None,
257
+ client: typing.Optional[modal.client.Client] = None,
252
258
  ) -> Function:
253
259
  """Reference a Function from a deployed App by its name.
254
260
 
@@ -305,7 +311,7 @@ class Function(
305
311
  """
306
312
  ...
307
313
 
308
- class __get_web_url_spec(typing_extensions.Protocol[SUPERSELF]):
314
+ class __get_web_url_spec(typing_extensions.Protocol):
309
315
  def __call__(self, /) -> typing.Optional[str]:
310
316
  """URL of a Function running as a web endpoint."""
311
317
  ...
@@ -314,9 +320,9 @@ class Function(
314
320
  """URL of a Function running as a web endpoint."""
315
321
  ...
316
322
 
317
- get_web_url: __get_web_url_spec[typing_extensions.Self]
323
+ get_web_url: __get_web_url_spec
318
324
 
319
- class ___experimental_get_flash_urls_spec(typing_extensions.Protocol[SUPERSELF]):
325
+ class ___experimental_get_flash_urls_spec(typing_extensions.Protocol):
320
326
  def __call__(self, /) -> typing.Optional[list[str]]:
321
327
  """URL of the flash service for the function."""
322
328
  ...
@@ -325,14 +331,14 @@ class Function(
325
331
  """URL of the flash service for the function."""
326
332
  ...
327
333
 
328
- _experimental_get_flash_urls: ___experimental_get_flash_urls_spec[typing_extensions.Self]
334
+ _experimental_get_flash_urls: ___experimental_get_flash_urls_spec
329
335
 
330
336
  @property
331
337
  def is_generator(self) -> bool:
332
338
  """mdmd:hidden"""
333
339
  ...
334
340
 
335
- class ___map_spec(typing_extensions.Protocol[SUPERSELF]):
341
+ class ___map_spec(typing_extensions.Protocol):
336
342
  def __call__(
337
343
  self,
338
344
  /,
@@ -371,21 +377,21 @@ class Function(
371
377
  """
372
378
  ...
373
379
 
374
- _map: ___map_spec[typing_extensions.Self]
380
+ _map: ___map_spec
375
381
 
376
- class ___spawn_map_spec(typing_extensions.Protocol[ReturnType_INNER, SUPERSELF]):
382
+ class ___spawn_map_spec(typing_extensions.Protocol[ReturnType_INNER]):
377
383
  def __call__(self, /, input_queue: modal.parallel_map.SynchronizedQueue) -> FunctionCall[ReturnType_INNER]: ...
378
384
  async def aio(self, /, input_queue: modal.parallel_map.SynchronizedQueue) -> FunctionCall[ReturnType_INNER]: ...
379
385
 
380
- _spawn_map: ___spawn_map_spec[modal._functions.ReturnType, typing_extensions.Self]
386
+ _spawn_map: ___spawn_map_spec[modal._functions.ReturnType]
381
387
 
382
- class ___call_function_spec(typing_extensions.Protocol[ReturnType_INNER, SUPERSELF]):
388
+ class ___call_function_spec(typing_extensions.Protocol[ReturnType_INNER]):
383
389
  def __call__(self, /, args, kwargs) -> ReturnType_INNER: ...
384
390
  async def aio(self, /, args, kwargs) -> ReturnType_INNER: ...
385
391
 
386
- _call_function: ___call_function_spec[modal._functions.ReturnType, typing_extensions.Self]
392
+ _call_function: ___call_function_spec[modal._functions.ReturnType]
387
393
 
388
- class ___call_function_nowait_spec(typing_extensions.Protocol[SUPERSELF]):
394
+ class ___call_function_nowait_spec(typing_extensions.Protocol):
389
395
  def __call__(
390
396
  self, /, args, kwargs, function_call_invocation_type: int, from_spawn_map: bool = False
391
397
  ) -> modal._functions._Invocation: ...
@@ -393,15 +399,15 @@ class Function(
393
399
  self, /, args, kwargs, function_call_invocation_type: int, from_spawn_map: bool = False
394
400
  ) -> modal._functions._Invocation: ...
395
401
 
396
- _call_function_nowait: ___call_function_nowait_spec[typing_extensions.Self]
402
+ _call_function_nowait: ___call_function_nowait_spec
397
403
 
398
- class ___call_generator_spec(typing_extensions.Protocol[SUPERSELF]):
404
+ class ___call_generator_spec(typing_extensions.Protocol):
399
405
  def __call__(self, /, args, kwargs): ...
400
406
  def aio(self, /, args, kwargs): ...
401
407
 
402
- _call_generator: ___call_generator_spec[typing_extensions.Self]
408
+ _call_generator: ___call_generator_spec
403
409
 
404
- class __remote_spec(typing_extensions.Protocol[P_INNER, ReturnType_INNER, SUPERSELF]):
410
+ class __remote_spec(typing_extensions.Protocol[ReturnType_INNER, P_INNER]):
405
411
  def __call__(self, /, *args: P_INNER.args, **kwargs: P_INNER.kwargs) -> ReturnType_INNER:
406
412
  """Calls the function remotely, executing it with the given arguments and returning the execution's result."""
407
413
  ...
@@ -410,9 +416,9 @@ class Function(
410
416
  """Calls the function remotely, executing it with the given arguments and returning the execution's result."""
411
417
  ...
412
418
 
413
- remote: __remote_spec[modal._functions.P, modal._functions.ReturnType, typing_extensions.Self]
419
+ remote: __remote_spec[modal._functions.ReturnType, modal._functions.P]
414
420
 
415
- class __remote_gen_spec(typing_extensions.Protocol[SUPERSELF]):
421
+ class __remote_gen_spec(typing_extensions.Protocol):
416
422
  def __call__(self, /, *args, **kwargs) -> typing.Generator[typing.Any, None, None]:
417
423
  """Calls the generator remotely, executing it with the given arguments and returning the execution's result."""
418
424
  ...
@@ -421,7 +427,7 @@ class Function(
421
427
  """Calls the generator remotely, executing it with the given arguments and returning the execution's result."""
422
428
  ...
423
429
 
424
- remote_gen: __remote_gen_spec[typing_extensions.Self]
430
+ remote_gen: __remote_gen_spec
425
431
 
426
432
  def _is_local(self): ...
427
433
  def _get_info(self) -> modal._utils.function_utils.FunctionInfo: ...
@@ -437,7 +443,7 @@ class Function(
437
443
  """
438
444
  ...
439
445
 
440
- class ___experimental_spawn_spec(typing_extensions.Protocol[P_INNER, ReturnType_INNER, SUPERSELF]):
446
+ class ___experimental_spawn_spec(typing_extensions.Protocol[ReturnType_INNER, P_INNER]):
441
447
  def __call__(self, /, *args: P_INNER.args, **kwargs: P_INNER.kwargs) -> FunctionCall[ReturnType_INNER]:
442
448
  """[Experimental] Calls the function with the given arguments, without waiting for the results.
443
449
 
@@ -460,17 +466,15 @@ class Function(
460
466
  """
461
467
  ...
462
468
 
463
- _experimental_spawn: ___experimental_spawn_spec[
464
- modal._functions.P, modal._functions.ReturnType, typing_extensions.Self
465
- ]
469
+ _experimental_spawn: ___experimental_spawn_spec[modal._functions.ReturnType, modal._functions.P]
466
470
 
467
- class ___spawn_map_inner_spec(typing_extensions.Protocol[P_INNER, SUPERSELF]):
471
+ class ___spawn_map_inner_spec(typing_extensions.Protocol[P_INNER]):
468
472
  def __call__(self, /, *args: P_INNER.args, **kwargs: P_INNER.kwargs) -> None: ...
469
473
  async def aio(self, /, *args: P_INNER.args, **kwargs: P_INNER.kwargs) -> None: ...
470
474
 
471
- _spawn_map_inner: ___spawn_map_inner_spec[modal._functions.P, typing_extensions.Self]
475
+ _spawn_map_inner: ___spawn_map_inner_spec[modal._functions.P]
472
476
 
473
- class __spawn_spec(typing_extensions.Protocol[P_INNER, ReturnType_INNER, SUPERSELF]):
477
+ class __spawn_spec(typing_extensions.Protocol[ReturnType_INNER, P_INNER]):
474
478
  def __call__(self, /, *args: P_INNER.args, **kwargs: P_INNER.kwargs) -> FunctionCall[ReturnType_INNER]:
475
479
  """Calls the function with the given arguments, without waiting for the results.
476
480
 
@@ -491,13 +495,13 @@ class Function(
491
495
  """
492
496
  ...
493
497
 
494
- spawn: __spawn_spec[modal._functions.P, modal._functions.ReturnType, typing_extensions.Self]
498
+ spawn: __spawn_spec[modal._functions.ReturnType, modal._functions.P]
495
499
 
496
500
  def get_raw_f(self) -> collections.abc.Callable[..., typing.Any]:
497
501
  """Return the inner Python object wrapped by this Modal Function."""
498
502
  ...
499
503
 
500
- class __get_current_stats_spec(typing_extensions.Protocol[SUPERSELF]):
504
+ class __get_current_stats_spec(typing_extensions.Protocol):
501
505
  def __call__(self, /) -> modal._functions.FunctionStats:
502
506
  """Return a `FunctionStats` object describing the current function's queue and runner counts."""
503
507
  ...
@@ -506,9 +510,9 @@ class Function(
506
510
  """Return a `FunctionStats` object describing the current function's queue and runner counts."""
507
511
  ...
508
512
 
509
- get_current_stats: __get_current_stats_spec[typing_extensions.Self]
513
+ get_current_stats: __get_current_stats_spec
510
514
 
511
- class ___get_schema_spec(typing_extensions.Protocol[SUPERSELF]):
515
+ class ___get_schema_spec(typing_extensions.Protocol):
512
516
  def __call__(self, /) -> modal_proto.api_pb2.FunctionSchema:
513
517
  """Returns recorded schema for function, internal use only for now"""
514
518
  ...
@@ -517,9 +521,9 @@ class Function(
517
521
  """Returns recorded schema for function, internal use only for now"""
518
522
  ...
519
523
 
520
- _get_schema: ___get_schema_spec[typing_extensions.Self]
524
+ _get_schema: ___get_schema_spec
521
525
 
522
- class __map_spec(typing_extensions.Protocol[SUPERSELF]):
526
+ class __map_spec(typing_extensions.Protocol):
523
527
  def __call__(
524
528
  self,
525
529
  /,
@@ -577,9 +581,9 @@ class Function(
577
581
  wrap_returned_exceptions: bool = True,
578
582
  ) -> typing.AsyncGenerator[typing.Any, None]: ...
579
583
 
580
- map: __map_spec[typing_extensions.Self]
584
+ map: __map_spec
581
585
 
582
- class __starmap_spec(typing_extensions.Protocol[SUPERSELF]):
586
+ class __starmap_spec(typing_extensions.Protocol):
583
587
  def __call__(
584
588
  self,
585
589
  /,
@@ -621,9 +625,9 @@ class Function(
621
625
  wrap_returned_exceptions: bool = True,
622
626
  ) -> typing.AsyncIterable[typing.Any]: ...
623
627
 
624
- starmap: __starmap_spec[typing_extensions.Self]
628
+ starmap: __starmap_spec
625
629
 
626
- class __for_each_spec(typing_extensions.Protocol[SUPERSELF]):
630
+ class __for_each_spec(typing_extensions.Protocol):
627
631
  def __call__(self, /, *input_iterators, kwargs={}, ignore_exceptions: bool = False):
628
632
  """Execute function for all inputs, ignoring outputs. Waits for completion of the inputs.
629
633
 
@@ -634,9 +638,9 @@ class Function(
634
638
 
635
639
  async def aio(self, /, *input_iterators, kwargs={}, ignore_exceptions: bool = False) -> None: ...
636
640
 
637
- for_each: __for_each_spec[typing_extensions.Self]
641
+ for_each: __for_each_spec
638
642
 
639
- class __spawn_map_spec(typing_extensions.Protocol[SUPERSELF]):
643
+ class __spawn_map_spec(typing_extensions.Protocol):
640
644
  def __call__(self, /, *input_iterators, kwargs={}) -> None:
641
645
  """Spawn parallel execution over a set of inputs, exiting as soon as the inputs are created (without waiting
642
646
  for the map to complete).
@@ -665,9 +669,9 @@ class Function(
665
669
  """
666
670
  ...
667
671
 
668
- spawn_map: __spawn_map_spec[typing_extensions.Self]
672
+ spawn_map: __spawn_map_spec
669
673
 
670
- class __experimental_spawn_map_spec(typing_extensions.Protocol[SUPERSELF]):
674
+ class __experimental_spawn_map_spec(typing_extensions.Protocol):
671
675
  def __call__(self, /, *input_iterators, kwargs={}) -> modal._functions._FunctionCall:
672
676
  """mdmd:hidden
673
677
  Spawn parallel execution over a set of inputs, returning as soon as the inputs are created.
@@ -693,7 +697,7 @@ class Function(
693
697
 
694
698
  async def aio(self, /, *input_iterators, kwargs={}) -> modal._functions._FunctionCall: ...
695
699
 
696
- experimental_spawn_map: __experimental_spawn_map_spec[typing_extensions.Self]
700
+ experimental_spawn_map: __experimental_spawn_map_spec
697
701
 
698
702
  class FunctionCall(typing.Generic[modal._functions.ReturnType], modal.object.Object):
699
703
  """A reference to an executed function call.
@@ -714,9 +718,8 @@ class FunctionCall(typing.Generic[modal._functions.ReturnType], modal.object.Obj
714
718
  ...
715
719
 
716
720
  def _invocation(self): ...
717
- def _hydrate_metadata(self, metadata: typing.Optional[google.protobuf.message.Message]): ...
718
721
 
719
- class __num_inputs_spec(typing_extensions.Protocol[SUPERSELF]):
722
+ class __num_inputs_spec(typing_extensions.Protocol):
720
723
  def __call__(self, /) -> int:
721
724
  """Get the number of inputs in the function call."""
722
725
  ...
@@ -725,9 +728,9 @@ class FunctionCall(typing.Generic[modal._functions.ReturnType], modal.object.Obj
725
728
  """Get the number of inputs in the function call."""
726
729
  ...
727
730
 
728
- num_inputs: __num_inputs_spec[typing_extensions.Self]
731
+ num_inputs: __num_inputs_spec
729
732
 
730
- class __get_spec(typing_extensions.Protocol[ReturnType_INNER, SUPERSELF]):
733
+ class __get_spec(typing_extensions.Protocol[ReturnType_INNER]):
731
734
  def __call__(self, /, timeout: typing.Optional[float] = None, *, index: int = 0) -> ReturnType_INNER:
732
735
  """Get the result of the index-th input of the function call.
733
736
  `.spawn()` calls have a single output, so only specifying `index=0` is valid.
@@ -754,9 +757,9 @@ class FunctionCall(typing.Generic[modal._functions.ReturnType], modal.object.Obj
754
757
  """
755
758
  ...
756
759
 
757
- get: __get_spec[modal._functions.ReturnType, typing_extensions.Self]
760
+ get: __get_spec[modal._functions.ReturnType]
758
761
 
759
- class __iter_spec(typing_extensions.Protocol[ReturnType_INNER, SUPERSELF]):
762
+ class __iter_spec(typing_extensions.Protocol[ReturnType_INNER]):
760
763
  def __call__(self, /, *, start: int = 0, end: typing.Optional[int] = None) -> typing.Iterator[ReturnType_INNER]:
761
764
  """Iterate in-order over the results of the function call.
762
765
 
@@ -803,9 +806,9 @@ class FunctionCall(typing.Generic[modal._functions.ReturnType], modal.object.Obj
803
806
  """
804
807
  ...
805
808
 
806
- iter: __iter_spec[modal._functions.ReturnType, typing_extensions.Self]
809
+ iter: __iter_spec[modal._functions.ReturnType]
807
810
 
808
- class __get_call_graph_spec(typing_extensions.Protocol[SUPERSELF]):
811
+ class __get_call_graph_spec(typing_extensions.Protocol):
809
812
  def __call__(self, /) -> list[modal.call_graph.InputInfo]:
810
813
  """Returns a structure representing the call graph from a given root
811
814
  call ID, along with the status of execution for each node.
@@ -824,9 +827,9 @@ class FunctionCall(typing.Generic[modal._functions.ReturnType], modal.object.Obj
824
827
  """
825
828
  ...
826
829
 
827
- get_call_graph: __get_call_graph_spec[typing_extensions.Self]
830
+ get_call_graph: __get_call_graph_spec
828
831
 
829
- class __cancel_spec(typing_extensions.Protocol[SUPERSELF]):
832
+ class __cancel_spec(typing_extensions.Protocol):
830
833
  def __call__(self, /, terminate_containers: bool = False):
831
834
  """Cancels the function call, which will stop its execution and mark its inputs as
832
835
  [`TERMINATED`](https://modal.com/docs/reference/modal.call_graph#modalcall_graphinputstatus).
@@ -845,7 +848,7 @@ class FunctionCall(typing.Generic[modal._functions.ReturnType], modal.object.Obj
845
848
  """
846
849
  ...
847
850
 
848
- cancel: __cancel_spec[typing_extensions.Self]
851
+ cancel: __cancel_spec
849
852
 
850
853
  class __from_id_spec(typing_extensions.Protocol):
851
854
  def __call__(
@@ -861,7 +864,7 @@ class FunctionCall(typing.Generic[modal._functions.ReturnType], modal.object.Obj
861
864
  fc_id = fc.object_id
862
865
 
863
866
  # Later, use the ID to re-instantiate the FunctionCall object
864
- fc = _FunctionCall.from_id(fc_id)
867
+ fc = FunctionCall.from_id(fc_id)
865
868
  result = fc.get()
866
869
  ```
867
870
 
@@ -870,29 +873,9 @@ class FunctionCall(typing.Generic[modal._functions.ReturnType], modal.object.Obj
870
873
  """
871
874
  ...
872
875
 
873
- async def aio(
874
- self, /, function_call_id: str, client: typing.Optional[modal.client.Client] = None
875
- ) -> FunctionCall[typing.Any]:
876
- """Instantiate a FunctionCall object from an existing ID.
877
-
878
- Examples:
879
-
880
- ```python notest
881
- # Spawn a FunctionCall and keep track of its object ID
882
- fc = my_func.spawn()
883
- fc_id = fc.object_id
884
-
885
- # Later, use the ID to re-instantiate the FunctionCall object
886
- fc = _FunctionCall.from_id(fc_id)
887
- result = fc.get()
888
- ```
889
-
890
- Note that it's only necessary to re-instantiate the `FunctionCall` with this method
891
- if you no longer have access to the original object returned from `Function.spawn`.
892
- """
893
- ...
876
+ async def aio(self, /, function_call_id: str, client: typing.Optional[modal.client.Client] = None): ...
894
877
 
895
- from_id: __from_id_spec
878
+ from_id: typing.ClassVar[__from_id_spec]
896
879
 
897
880
  class __gather_spec(typing_extensions.Protocol):
898
881
  def __call__(self, /, *function_calls: FunctionCall[modal._functions.T]) -> typing.Sequence[modal._functions.T]:
@@ -939,7 +922,7 @@ class FunctionCall(typing.Generic[modal._functions.ReturnType], modal.object.Obj
939
922
  """
940
923
  ...
941
924
 
942
- gather: __gather_spec
925
+ gather: typing.ClassVar[__gather_spec]
943
926
 
944
927
  class __gather_spec(typing_extensions.Protocol):
945
928
  def __call__(self, /, *function_calls) -> typing.Sequence[modal._functions.T]: