ob-metaflow-stubs 6.0.4.4__py2.py3-none-any.whl → 6.0.4.5__py2.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.
Files changed (261) hide show
  1. metaflow-stubs/__init__.pyi +690 -696
  2. metaflow-stubs/cards.pyi +2 -2
  3. metaflow-stubs/cli.pyi +2 -3
  4. metaflow-stubs/cli_components/__init__.pyi +2 -2
  5. metaflow-stubs/cli_components/utils.pyi +2 -2
  6. metaflow-stubs/client/__init__.pyi +2 -2
  7. metaflow-stubs/client/core.pyi +7 -6
  8. metaflow-stubs/client/filecache.pyi +2 -2
  9. metaflow-stubs/events.pyi +2 -2
  10. metaflow-stubs/exception.pyi +2 -2
  11. metaflow-stubs/flowspec.pyi +8 -8
  12. metaflow-stubs/generated_for.txt +1 -1
  13. metaflow-stubs/includefile.pyi +3 -3
  14. metaflow-stubs/{meta_files.pyi → info_file.pyi} +6 -2
  15. metaflow-stubs/metadata_provider/__init__.pyi +2 -2
  16. metaflow-stubs/metadata_provider/heartbeat.pyi +2 -2
  17. metaflow-stubs/metadata_provider/metadata.pyi +2 -2
  18. metaflow-stubs/metadata_provider/util.pyi +2 -2
  19. metaflow-stubs/metaflow_config.pyi +2 -6
  20. metaflow-stubs/metaflow_current.pyi +40 -40
  21. metaflow-stubs/metaflow_git.pyi +2 -2
  22. metaflow-stubs/mf_extensions/__init__.pyi +2 -2
  23. metaflow-stubs/mf_extensions/obcheckpoint/__init__.pyi +2 -2
  24. metaflow-stubs/mf_extensions/obcheckpoint/plugins/__init__.pyi +2 -2
  25. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/__init__.pyi +2 -2
  26. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/card_utils/__init__.pyi +2 -2
  27. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/card_utils/async_cards.pyi +3 -3
  28. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/card_utils/deco_injection_mixin.pyi +2 -2
  29. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/card_utils/extra_components.pyi +3 -3
  30. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/checkpoints/__init__.pyi +2 -2
  31. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/checkpoints/cards/__init__.pyi +2 -2
  32. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/checkpoints/cards/checkpoint_lister.pyi +3 -3
  33. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/checkpoints/cards/lineage_card.pyi +2 -2
  34. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/checkpoints/checkpoint_storage.pyi +5 -5
  35. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/checkpoints/constructors.pyi +2 -2
  36. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/checkpoints/core.pyi +4 -4
  37. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/checkpoints/decorator.pyi +5 -5
  38. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/checkpoints/exceptions.pyi +2 -2
  39. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/checkpoints/final_api.pyi +3 -3
  40. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/checkpoints/lineage.pyi +2 -2
  41. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/datastore/__init__.pyi +2 -2
  42. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/datastore/context.pyi +2 -2
  43. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/datastore/core.pyi +3 -3
  44. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/datastore/decorator.pyi +2 -2
  45. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/datastore/exceptions.pyi +2 -2
  46. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/datastore/task_utils.pyi +2 -2
  47. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/datastore/utils.pyi +2 -2
  48. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/datastructures.pyi +2 -2
  49. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/exceptions.pyi +2 -2
  50. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/hf_hub/__init__.pyi +2 -2
  51. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/hf_hub/decorator.pyi +3 -3
  52. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/modeling_utils/__init__.pyi +2 -2
  53. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/modeling_utils/core.pyi +4 -4
  54. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/modeling_utils/exceptions.pyi +2 -2
  55. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/modeling_utils/model_storage.pyi +4 -4
  56. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/utils/__init__.pyi +2 -2
  57. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/utils/flowspec_utils.pyi +2 -2
  58. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/utils/general.pyi +2 -2
  59. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/utils/identity_utils.pyi +2 -2
  60. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/utils/serialization_handler/__init__.pyi +2 -2
  61. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/utils/serialization_handler/base.pyi +2 -2
  62. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/utils/serialization_handler/tar.pyi +2 -2
  63. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/utils/tar_utils.pyi +2 -2
  64. metaflow-stubs/mf_extensions/outerbounds/__init__.pyi +2 -2
  65. metaflow-stubs/mf_extensions/outerbounds/plugins/__init__.pyi +2 -2
  66. metaflow-stubs/mf_extensions/outerbounds/plugins/apps/__init__.pyi +2 -2
  67. metaflow-stubs/mf_extensions/outerbounds/plugins/apps/core/__init__.pyi +2 -2
  68. metaflow-stubs/mf_extensions/outerbounds/plugins/apps/core/_state_machine.pyi +2 -2
  69. metaflow-stubs/mf_extensions/outerbounds/plugins/apps/core/_vendor/__init__.pyi +2 -2
  70. metaflow-stubs/mf_extensions/outerbounds/plugins/apps/core/_vendor/spinner/__init__.pyi +2 -2
  71. metaflow-stubs/mf_extensions/outerbounds/plugins/apps/core/_vendor/spinner/spinners.pyi +2 -2
  72. metaflow-stubs/mf_extensions/outerbounds/plugins/apps/core/app_cli.pyi +2 -2
  73. metaflow-stubs/mf_extensions/outerbounds/plugins/apps/core/app_config.pyi +2 -2
  74. metaflow-stubs/mf_extensions/outerbounds/plugins/apps/core/capsule.pyi +4 -4
  75. metaflow-stubs/mf_extensions/outerbounds/plugins/apps/core/click_importer.pyi +2 -2
  76. metaflow-stubs/mf_extensions/outerbounds/plugins/apps/core/code_package/__init__.pyi +2 -2
  77. metaflow-stubs/mf_extensions/outerbounds/plugins/apps/core/code_package/code_packager.pyi +2 -2
  78. metaflow-stubs/mf_extensions/outerbounds/plugins/apps/core/config/__init__.pyi +2 -2
  79. metaflow-stubs/mf_extensions/outerbounds/plugins/apps/core/config/cli_generator.pyi +2 -2
  80. metaflow-stubs/mf_extensions/outerbounds/plugins/apps/core/config/config_utils.pyi +3 -3
  81. metaflow-stubs/mf_extensions/outerbounds/plugins/apps/core/config/schema_export.pyi +2 -2
  82. metaflow-stubs/mf_extensions/outerbounds/plugins/apps/core/config/typed_configs.pyi +2 -2
  83. metaflow-stubs/mf_extensions/outerbounds/plugins/apps/core/config/unified_config.pyi +2 -2
  84. metaflow-stubs/mf_extensions/outerbounds/plugins/apps/core/dependencies.pyi +4 -4
  85. metaflow-stubs/mf_extensions/outerbounds/plugins/apps/core/deployer.pyi +4 -4
  86. metaflow-stubs/mf_extensions/outerbounds/plugins/apps/core/experimental/__init__.pyi +2 -2
  87. metaflow-stubs/mf_extensions/outerbounds/plugins/apps/core/perimeters.pyi +2 -2
  88. metaflow-stubs/mf_extensions/outerbounds/plugins/apps/core/utils.pyi +4 -4
  89. metaflow-stubs/mf_extensions/outerbounds/plugins/aws/__init__.pyi +2 -2
  90. metaflow-stubs/mf_extensions/outerbounds/plugins/aws/assume_role_decorator.pyi +8 -12
  91. metaflow-stubs/mf_extensions/outerbounds/plugins/card_utilities/__init__.pyi +2 -2
  92. metaflow-stubs/mf_extensions/outerbounds/plugins/card_utilities/async_cards.pyi +3 -3
  93. metaflow-stubs/mf_extensions/outerbounds/plugins/card_utilities/injector.pyi +2 -2
  94. metaflow-stubs/mf_extensions/outerbounds/plugins/checkpoint_datastores/__init__.pyi +2 -2
  95. metaflow-stubs/mf_extensions/outerbounds/plugins/checkpoint_datastores/coreweave.pyi +11 -13
  96. metaflow-stubs/mf_extensions/outerbounds/plugins/checkpoint_datastores/nebius.pyi +11 -13
  97. metaflow-stubs/mf_extensions/outerbounds/plugins/fast_bakery/__init__.pyi +2 -2
  98. metaflow-stubs/mf_extensions/outerbounds/plugins/fast_bakery/baker.pyi +3 -3
  99. metaflow-stubs/mf_extensions/outerbounds/plugins/fast_bakery/docker_environment.pyi +3 -3
  100. metaflow-stubs/mf_extensions/outerbounds/plugins/fast_bakery/fast_bakery.pyi +2 -2
  101. metaflow-stubs/mf_extensions/outerbounds/plugins/kubernetes/__init__.pyi +2 -2
  102. metaflow-stubs/mf_extensions/outerbounds/plugins/kubernetes/pod_killer.pyi +2 -2
  103. metaflow-stubs/mf_extensions/outerbounds/plugins/ollama/__init__.pyi +2 -2
  104. metaflow-stubs/mf_extensions/outerbounds/plugins/ollama/constants.pyi +2 -2
  105. metaflow-stubs/mf_extensions/outerbounds/plugins/ollama/exceptions.pyi +2 -2
  106. metaflow-stubs/mf_extensions/outerbounds/plugins/ollama/ollama.pyi +2 -2
  107. metaflow-stubs/mf_extensions/outerbounds/plugins/ollama/status_card.pyi +2 -2
  108. metaflow-stubs/mf_extensions/outerbounds/plugins/snowflake/__init__.pyi +2 -2
  109. metaflow-stubs/mf_extensions/outerbounds/plugins/snowflake/snowflake.pyi +2 -2
  110. metaflow-stubs/mf_extensions/outerbounds/profilers/__init__.pyi +2 -2
  111. metaflow-stubs/mf_extensions/outerbounds/profilers/gpu.pyi +2 -2
  112. metaflow-stubs/mf_extensions/outerbounds/remote_config.pyi +2 -2
  113. metaflow-stubs/mf_extensions/outerbounds/toplevel/__init__.pyi +2 -2
  114. metaflow-stubs/mf_extensions/outerbounds/toplevel/global_aliases_for_metaflow_package.pyi +2 -2
  115. metaflow-stubs/multicore_utils.pyi +2 -2
  116. metaflow-stubs/ob_internal.pyi +2 -2
  117. metaflow-stubs/parameters.pyi +3 -3
  118. metaflow-stubs/plugins/__init__.pyi +10 -10
  119. metaflow-stubs/plugins/airflow/__init__.pyi +2 -2
  120. metaflow-stubs/plugins/airflow/airflow_utils.pyi +2 -2
  121. metaflow-stubs/plugins/airflow/exception.pyi +2 -2
  122. metaflow-stubs/plugins/airflow/sensors/__init__.pyi +2 -2
  123. metaflow-stubs/plugins/airflow/sensors/base_sensor.pyi +2 -2
  124. metaflow-stubs/plugins/airflow/sensors/external_task_sensor.pyi +2 -2
  125. metaflow-stubs/plugins/airflow/sensors/s3_sensor.pyi +2 -2
  126. metaflow-stubs/plugins/argo/__init__.pyi +2 -2
  127. metaflow-stubs/plugins/argo/argo_client.pyi +2 -2
  128. metaflow-stubs/plugins/argo/argo_events.pyi +2 -2
  129. metaflow-stubs/plugins/argo/argo_workflows.pyi +3 -3
  130. metaflow-stubs/plugins/argo/argo_workflows_decorator.pyi +4 -4
  131. metaflow-stubs/plugins/argo/argo_workflows_deployer.pyi +3 -3
  132. metaflow-stubs/plugins/argo/argo_workflows_deployer_objects.pyi +3 -3
  133. metaflow-stubs/plugins/argo/exit_hooks.pyi +3 -3
  134. metaflow-stubs/plugins/aws/__init__.pyi +2 -2
  135. metaflow-stubs/plugins/aws/aws_client.pyi +2 -2
  136. metaflow-stubs/plugins/aws/aws_utils.pyi +2 -2
  137. metaflow-stubs/plugins/aws/batch/__init__.pyi +2 -2
  138. metaflow-stubs/plugins/aws/batch/batch.pyi +4 -4
  139. metaflow-stubs/plugins/aws/batch/batch_client.pyi +2 -2
  140. metaflow-stubs/plugins/aws/batch/batch_decorator.pyi +2 -4
  141. metaflow-stubs/plugins/aws/secrets_manager/__init__.pyi +2 -2
  142. metaflow-stubs/plugins/aws/secrets_manager/aws_secrets_manager_secrets_provider.pyi +4 -4
  143. metaflow-stubs/plugins/aws/step_functions/__init__.pyi +2 -2
  144. metaflow-stubs/plugins/aws/step_functions/event_bridge_client.pyi +2 -2
  145. metaflow-stubs/plugins/aws/step_functions/schedule_decorator.pyi +2 -2
  146. metaflow-stubs/plugins/aws/step_functions/step_functions.pyi +3 -3
  147. metaflow-stubs/plugins/aws/step_functions/step_functions_client.pyi +2 -2
  148. metaflow-stubs/plugins/aws/step_functions/step_functions_deployer.pyi +3 -3
  149. metaflow-stubs/plugins/aws/step_functions/step_functions_deployer_objects.pyi +3 -3
  150. metaflow-stubs/plugins/azure/__init__.pyi +2 -2
  151. metaflow-stubs/plugins/azure/azure_credential.pyi +2 -2
  152. metaflow-stubs/plugins/azure/azure_exceptions.pyi +2 -2
  153. metaflow-stubs/plugins/azure/azure_secret_manager_secrets_provider.pyi +4 -4
  154. metaflow-stubs/plugins/azure/azure_utils.pyi +2 -2
  155. metaflow-stubs/plugins/azure/blob_service_client_factory.pyi +2 -2
  156. metaflow-stubs/plugins/azure/includefile_support.pyi +2 -2
  157. metaflow-stubs/plugins/cards/__init__.pyi +2 -2
  158. metaflow-stubs/plugins/cards/card_client.pyi +3 -3
  159. metaflow-stubs/plugins/cards/card_creator.pyi +2 -2
  160. metaflow-stubs/plugins/cards/card_datastore.pyi +2 -2
  161. metaflow-stubs/plugins/cards/card_decorator.pyi +4 -2
  162. metaflow-stubs/plugins/cards/card_modules/__init__.pyi +2 -2
  163. metaflow-stubs/plugins/cards/card_modules/basic.pyi +3 -3
  164. metaflow-stubs/plugins/cards/card_modules/card.pyi +2 -2
  165. metaflow-stubs/plugins/cards/card_modules/components.pyi +4 -4
  166. metaflow-stubs/plugins/cards/card_modules/convert_to_native_type.pyi +2 -2
  167. metaflow-stubs/plugins/cards/card_modules/renderer_tools.pyi +2 -2
  168. metaflow-stubs/plugins/cards/card_modules/test_cards.pyi +2 -2
  169. metaflow-stubs/plugins/cards/card_resolver.pyi +2 -2
  170. metaflow-stubs/plugins/cards/component_serializer.pyi +2 -2
  171. metaflow-stubs/plugins/cards/exception.pyi +2 -2
  172. metaflow-stubs/plugins/catch_decorator.pyi +2 -2
  173. metaflow-stubs/plugins/datatools/__init__.pyi +2 -2
  174. metaflow-stubs/plugins/datatools/local.pyi +2 -2
  175. metaflow-stubs/plugins/datatools/s3/__init__.pyi +2 -2
  176. metaflow-stubs/plugins/datatools/s3/s3.pyi +4 -4
  177. metaflow-stubs/plugins/datatools/s3/s3tail.pyi +2 -2
  178. metaflow-stubs/plugins/datatools/s3/s3util.pyi +2 -2
  179. metaflow-stubs/plugins/debug_logger.pyi +2 -2
  180. metaflow-stubs/plugins/debug_monitor.pyi +2 -2
  181. metaflow-stubs/plugins/environment_decorator.pyi +2 -2
  182. metaflow-stubs/plugins/events_decorator.pyi +2 -2
  183. metaflow-stubs/plugins/exit_hook/__init__.pyi +2 -2
  184. metaflow-stubs/plugins/exit_hook/exit_hook_decorator.pyi +2 -2
  185. metaflow-stubs/plugins/frameworks/__init__.pyi +2 -2
  186. metaflow-stubs/plugins/frameworks/pytorch.pyi +2 -2
  187. metaflow-stubs/plugins/gcp/__init__.pyi +2 -2
  188. metaflow-stubs/plugins/gcp/gcp_secret_manager_secrets_provider.pyi +4 -4
  189. metaflow-stubs/plugins/gcp/gs_exceptions.pyi +2 -2
  190. metaflow-stubs/plugins/gcp/gs_storage_client_factory.pyi +2 -2
  191. metaflow-stubs/plugins/gcp/gs_utils.pyi +2 -2
  192. metaflow-stubs/plugins/gcp/includefile_support.pyi +2 -2
  193. metaflow-stubs/plugins/kubernetes/__init__.pyi +2 -2
  194. metaflow-stubs/plugins/kubernetes/kube_utils.pyi +2 -2
  195. metaflow-stubs/plugins/kubernetes/kubernetes.pyi +4 -4
  196. metaflow-stubs/plugins/kubernetes/kubernetes_client.pyi +2 -2
  197. metaflow-stubs/plugins/kubernetes/kubernetes_decorator.pyi +2 -4
  198. metaflow-stubs/plugins/kubernetes/kubernetes_jobsets.pyi +2 -2
  199. metaflow-stubs/plugins/kubernetes/spot_monitor_sidecar.pyi +2 -2
  200. metaflow-stubs/plugins/ollama/__init__.pyi +3 -3
  201. metaflow-stubs/plugins/parallel_decorator.pyi +3 -3
  202. metaflow-stubs/plugins/perimeters.pyi +2 -2
  203. metaflow-stubs/plugins/project_decorator.pyi +2 -2
  204. metaflow-stubs/plugins/pypi/__init__.pyi +3 -3
  205. metaflow-stubs/plugins/pypi/conda_decorator.pyi +8 -5
  206. metaflow-stubs/plugins/pypi/conda_environment.pyi +5 -6
  207. metaflow-stubs/plugins/pypi/parsers.pyi +2 -2
  208. metaflow-stubs/plugins/pypi/pypi_decorator.pyi +4 -4
  209. metaflow-stubs/plugins/pypi/pypi_environment.pyi +2 -2
  210. metaflow-stubs/plugins/pypi/utils.pyi +2 -2
  211. metaflow-stubs/plugins/resources_decorator.pyi +2 -2
  212. metaflow-stubs/plugins/retry_decorator.pyi +2 -2
  213. metaflow-stubs/plugins/secrets/__init__.pyi +3 -3
  214. metaflow-stubs/plugins/secrets/inline_secrets_provider.pyi +3 -3
  215. metaflow-stubs/plugins/secrets/secrets_decorator.pyi +2 -2
  216. metaflow-stubs/plugins/secrets/secrets_func.pyi +2 -2
  217. metaflow-stubs/plugins/secrets/secrets_spec.pyi +2 -2
  218. metaflow-stubs/plugins/secrets/utils.pyi +2 -2
  219. metaflow-stubs/plugins/snowflake/__init__.pyi +2 -2
  220. metaflow-stubs/plugins/storage_executor.pyi +2 -2
  221. metaflow-stubs/plugins/test_unbounded_foreach_decorator.pyi +3 -3
  222. metaflow-stubs/plugins/timeout_decorator.pyi +2 -2
  223. metaflow-stubs/plugins/torchtune/__init__.pyi +2 -2
  224. metaflow-stubs/plugins/uv/__init__.pyi +2 -2
  225. metaflow-stubs/plugins/uv/uv_environment.pyi +2 -3
  226. metaflow-stubs/profilers/__init__.pyi +2 -2
  227. metaflow-stubs/pylint_wrapper.pyi +2 -2
  228. metaflow-stubs/runner/__init__.pyi +2 -2
  229. metaflow-stubs/runner/deployer.pyi +4 -4
  230. metaflow-stubs/runner/deployer_impl.pyi +3 -3
  231. metaflow-stubs/runner/metaflow_runner.pyi +2 -2
  232. metaflow-stubs/runner/nbdeploy.pyi +2 -2
  233. metaflow-stubs/runner/nbrun.pyi +2 -2
  234. metaflow-stubs/runner/subprocess_manager.pyi +2 -3
  235. metaflow-stubs/runner/utils.pyi +2 -2
  236. metaflow-stubs/system/__init__.pyi +2 -2
  237. metaflow-stubs/system/system_logger.pyi +3 -3
  238. metaflow-stubs/system/system_monitor.pyi +2 -2
  239. metaflow-stubs/tagging_util.pyi +2 -2
  240. metaflow-stubs/tuple_util.pyi +2 -2
  241. metaflow-stubs/user_configs/__init__.pyi +3 -2
  242. metaflow-stubs/user_configs/config_decorators.pyi +251 -0
  243. metaflow-stubs/user_configs/config_options.pyi +5 -4
  244. metaflow-stubs/user_configs/config_parameters.pyi +9 -7
  245. {ob_metaflow_stubs-6.0.4.4.dist-info → ob_metaflow_stubs-6.0.4.5.dist-info}/METADATA +1 -1
  246. ob_metaflow_stubs-6.0.4.5.dist-info/RECORD +249 -0
  247. metaflow-stubs/packaging_sys/__init__.pyi +0 -430
  248. metaflow-stubs/packaging_sys/backend.pyi +0 -73
  249. metaflow-stubs/packaging_sys/distribution_support.pyi +0 -57
  250. metaflow-stubs/packaging_sys/tar_backend.pyi +0 -53
  251. metaflow-stubs/packaging_sys/utils.pyi +0 -26
  252. metaflow-stubs/packaging_sys/v1.pyi +0 -145
  253. metaflow-stubs/user_decorators/__init__.pyi +0 -15
  254. metaflow-stubs/user_decorators/common.pyi +0 -38
  255. metaflow-stubs/user_decorators/mutable_flow.pyi +0 -223
  256. metaflow-stubs/user_decorators/mutable_step.pyi +0 -152
  257. metaflow-stubs/user_decorators/user_flow_decorator.pyi +0 -137
  258. metaflow-stubs/user_decorators/user_step_decorator.pyi +0 -323
  259. ob_metaflow_stubs-6.0.4.4.dist-info/RECORD +0 -260
  260. {ob_metaflow_stubs-6.0.4.4.dist-info → ob_metaflow_stubs-6.0.4.5.dist-info}/WHEEL +0 -0
  261. {ob_metaflow_stubs-6.0.4.4.dist-info → ob_metaflow_stubs-6.0.4.5.dist-info}/top_level.txt +0 -0
@@ -1,7 +1,7 @@
1
1
  ######################################################################################################
2
2
  # Auto-generated Metaflow stub file #
3
- # MF version: 2.16.2.1+obcheckpoint(0.2.4);ob(v1) #
4
- # Generated on 2025-07-16T08:15:48.145976 #
3
+ # MF version: 2.15.21.2+obcheckpoint(0.2.4);ob(v1) #
4
+ # Generated on 2025-07-16T21:13:36.500276 #
5
5
  ######################################################################################################
6
6
 
7
7
  from __future__ import annotations
@@ -13,8 +13,7 @@ if typing.TYPE_CHECKING:
13
13
  FlowSpecDerived = typing.TypeVar("FlowSpecDerived", bound="FlowSpec", contravariant=False, covariant=False)
14
14
  StepFlag = typing.NewType("StepFlag", bool)
15
15
 
16
- from . import meta_files as meta_files
17
- from . import packaging_sys as packaging_sys
16
+ from . import info_file as info_file
18
17
  from . import exception as exception
19
18
  from . import metaflow_config as metaflow_config
20
19
  from . import multicore_utils as multicore_utils
@@ -24,7 +23,6 @@ from . import metaflow_current as metaflow_current
24
23
  from .metaflow_current import current as current
25
24
  from . import parameters as parameters
26
25
  from . import user_configs as user_configs
27
- from . import user_decorators as user_decorators
28
26
  from . import tagging_util as tagging_util
29
27
  from . import metadata_provider as metadata_provider
30
28
  from . import flowspec as flowspec
@@ -35,12 +33,10 @@ from .parameters import JSONType as JSONType
35
33
  from .user_configs.config_parameters import Config as Config
36
34
  from .user_configs.config_parameters import ConfigValue as ConfigValue
37
35
  from .user_configs.config_parameters import config_expr as config_expr
38
- from .user_decorators.user_step_decorator import UserStepDecorator as UserStepDecorator
39
- from .user_decorators.user_step_decorator import StepMutator as StepMutator
40
- from .user_decorators.user_step_decorator import user_step_decorator as user_step_decorator
41
- from .user_decorators.user_flow_decorator import FlowMutator as FlowMutator
42
- from . import tuple_util as tuple_util
36
+ from .user_configs.config_decorators import CustomFlowDecorator as CustomFlowDecorator
37
+ from .user_configs.config_decorators import CustomStepDecorator as CustomStepDecorator
43
38
  from . import cards as cards
39
+ from . import tuple_util as tuple_util
44
40
  from . import metaflow_git as metaflow_git
45
41
  from . import events as events
46
42
  from . import runner as runner
@@ -48,8 +44,8 @@ from . import plugins as plugins
48
44
  from .mf_extensions.outerbounds.toplevel.global_aliases_for_metaflow_package import S3 as S3
49
45
  from . import includefile as includefile
50
46
  from .includefile import IncludeFile as IncludeFile
51
- from .plugins.pypi.parsers import conda_environment_yml_parser as conda_environment_yml_parser
52
47
  from .plugins.pypi.parsers import requirements_txt_parser as requirements_txt_parser
48
+ from .plugins.pypi.parsers import conda_environment_yml_parser as conda_environment_yml_parser
53
49
  from .plugins.pypi.parsers import pyproject_toml_parser as pyproject_toml_parser
54
50
  from . import client as client
55
51
  from .client.core import namespace as namespace
@@ -87,8 +83,6 @@ from . import ob_internal as ob_internal
87
83
 
88
84
  EXT_PKG: str
89
85
 
90
- USER_SKIP_STEP: dict
91
-
92
86
  @typing.overload
93
87
  def step(f: typing.Callable[[FlowSpecDerived], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
94
88
  """
@@ -181,23 +175,6 @@ def parallel(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None],
181
175
  """
182
176
  ...
183
177
 
184
- @typing.overload
185
- def fast_bakery_internal(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
186
- """
187
- Internal decorator to support Fast bakery
188
- """
189
- ...
190
-
191
- @typing.overload
192
- def fast_bakery_internal(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
193
- ...
194
-
195
- def fast_bakery_internal(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None):
196
- """
197
- Internal decorator to support Fast bakery
198
- """
199
- ...
200
-
201
178
  @typing.overload
202
179
  def timeout(*, seconds: int = 0, minutes: int = 0, hours: int = 0) -> typing.Callable[[typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]], typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]]:
203
180
  """
@@ -258,190 +235,319 @@ def timeout(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None],
258
235
  ...
259
236
 
260
237
  @typing.overload
261
- def model(*, load: typing.Union[typing.List[str], str, typing.List[typing.Tuple[str, typing.Optional[str]]]] = None, temp_dir_root: str = None) -> typing.Callable[[typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]], typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]]:
238
+ def resources(*, cpu: int = 1, gpu: typing.Optional[int] = None, disk: typing.Optional[int] = None, memory: int = 4096, shared_memory: typing.Optional[int] = None) -> typing.Callable[[typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]], typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]]:
262
239
  """
263
- Enables loading / saving of models within a step.
240
+ Specifies the resources needed when executing this step.
264
241
 
265
- > Examples
266
- - Saving Models
267
- ```python
268
- @model
269
- @step
270
- def train(self):
271
- # current.model.save returns a dictionary reference to the model saved
272
- self.my_model = current.model.save(
273
- path_to_my_model,
274
- label="my_model",
275
- metadata={
276
- "epochs": 10,
277
- "batch-size": 32,
278
- "learning-rate": 0.001,
279
- }
280
- )
281
- self.next(self.test)
242
+ Use `@resources` to specify the resource requirements
243
+ independently of the specific compute layer (`@batch`, `@kubernetes`).
282
244
 
283
- @model(load="my_model")
284
- @step
285
- def test(self):
286
- # `current.model.loaded` returns a dictionary of the loaded models
287
- # where the key is the name of the artifact and the value is the path to the model
288
- print(os.listdir(current.model.loaded["my_model"]))
289
- self.next(self.end)
245
+ You can choose the compute layer on the command line by executing e.g.
290
246
  ```
291
-
292
- - Loading models
293
- ```python
294
- @step
295
- def train(self):
296
- # current.model.load returns the path to the model loaded
297
- checkpoint_path = current.model.load(
298
- self.checkpoint_key,
299
- )
300
- model_path = current.model.load(
301
- self.model,
302
- )
303
- self.next(self.test)
247
+ python myflow.py run --with batch
248
+ ```
249
+ or
250
+ ```
251
+ python myflow.py run --with kubernetes
304
252
  ```
253
+ which executes the flow on the desired system using the
254
+ requirements specified in `@resources`.
305
255
 
306
256
 
307
257
  Parameters
308
258
  ----------
309
- load : Union[List[str],str,List[Tuple[str,Union[str,None]]]], default: None
310
- Artifact name/s referencing the models/checkpoints to load. Artifact names refer to the names of the instance variables set to `self`.
311
- These artifact names give to `load` be reference objects or reference `key` string's from objects created by `current.checkpoint` / `current.model` / `current.huggingface_hub`.
312
- If a list of tuples is provided, the first element is the artifact name and the second element is the path the artifact needs be unpacked on
313
- the local filesystem. If the second element is None, the artifact will be unpacked in the current working directory.
314
- If a string is provided, then the artifact corresponding to that name will be loaded in the current working directory.
315
-
316
- temp_dir_root : str, default: None
317
- The root directory under which `current.model.loaded` will store loaded models
259
+ cpu : int, default 1
260
+ Number of CPUs required for this step.
261
+ gpu : int, optional, default None
262
+ Number of GPUs required for this step.
263
+ disk : int, optional, default None
264
+ Disk size (in MB) required for this step. Only applies on Kubernetes.
265
+ memory : int, default 4096
266
+ Memory size (in MB) required for this step.
267
+ shared_memory : int, optional, default None
268
+ The value for the size (in MiB) of the /dev/shm volume for this step.
269
+ This parameter maps to the `--shm-size` option in Docker.
318
270
  """
319
271
  ...
320
272
 
321
273
  @typing.overload
322
- def model(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
274
+ def resources(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
323
275
  ...
324
276
 
325
277
  @typing.overload
326
- def model(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
278
+ def resources(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
327
279
  ...
328
280
 
329
- def model(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None, *, load: typing.Union[typing.List[str], str, typing.List[typing.Tuple[str, typing.Optional[str]]]] = None, temp_dir_root: str = None):
281
+ def resources(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None, *, cpu: int = 1, gpu: typing.Optional[int] = None, disk: typing.Optional[int] = None, memory: int = 4096, shared_memory: typing.Optional[int] = None):
330
282
  """
331
- Enables loading / saving of models within a step.
283
+ Specifies the resources needed when executing this step.
332
284
 
333
- > Examples
334
- - Saving Models
335
- ```python
336
- @model
337
- @step
338
- def train(self):
339
- # current.model.save returns a dictionary reference to the model saved
340
- self.my_model = current.model.save(
341
- path_to_my_model,
342
- label="my_model",
343
- metadata={
344
- "epochs": 10,
345
- "batch-size": 32,
346
- "learning-rate": 0.001,
347
- }
348
- )
349
- self.next(self.test)
285
+ Use `@resources` to specify the resource requirements
286
+ independently of the specific compute layer (`@batch`, `@kubernetes`).
350
287
 
351
- @model(load="my_model")
352
- @step
353
- def test(self):
354
- # `current.model.loaded` returns a dictionary of the loaded models
355
- # where the key is the name of the artifact and the value is the path to the model
356
- print(os.listdir(current.model.loaded["my_model"]))
357
- self.next(self.end)
288
+ You can choose the compute layer on the command line by executing e.g.
358
289
  ```
359
-
360
- - Loading models
361
- ```python
362
- @step
363
- def train(self):
364
- # current.model.load returns the path to the model loaded
365
- checkpoint_path = current.model.load(
366
- self.checkpoint_key,
367
- )
368
- model_path = current.model.load(
369
- self.model,
370
- )
371
- self.next(self.test)
290
+ python myflow.py run --with batch
291
+ ```
292
+ or
372
293
  ```
294
+ python myflow.py run --with kubernetes
295
+ ```
296
+ which executes the flow on the desired system using the
297
+ requirements specified in `@resources`.
373
298
 
374
299
 
375
300
  Parameters
376
301
  ----------
377
- load : Union[List[str],str,List[Tuple[str,Union[str,None]]]], default: None
378
- Artifact name/s referencing the models/checkpoints to load. Artifact names refer to the names of the instance variables set to `self`.
379
- These artifact names give to `load` be reference objects or reference `key` string's from objects created by `current.checkpoint` / `current.model` / `current.huggingface_hub`.
380
- If a list of tuples is provided, the first element is the artifact name and the second element is the path the artifact needs be unpacked on
381
- the local filesystem. If the second element is None, the artifact will be unpacked in the current working directory.
382
- If a string is provided, then the artifact corresponding to that name will be loaded in the current working directory.
383
-
384
- temp_dir_root : str, default: None
385
- The root directory under which `current.model.loaded` will store loaded models
302
+ cpu : int, default 1
303
+ Number of CPUs required for this step.
304
+ gpu : int, optional, default None
305
+ Number of GPUs required for this step.
306
+ disk : int, optional, default None
307
+ Disk size (in MB) required for this step. Only applies on Kubernetes.
308
+ memory : int, default 4096
309
+ Memory size (in MB) required for this step.
310
+ shared_memory : int, optional, default None
311
+ The value for the size (in MiB) of the /dev/shm volume for this step.
312
+ This parameter maps to the `--shm-size` option in Docker.
386
313
  """
387
314
  ...
388
315
 
389
- @typing.overload
390
- def checkpoint(*, load_policy: str = 'fresh', temp_dir_root: str = None) -> typing.Callable[[typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]], typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]]:
316
+ def huggingface_hub(*, temp_dir_root: typing.Optional[str] = None, load: typing.Union[typing.List[str], typing.List[typing.Tuple[typing.Dict, str]], typing.List[typing.Tuple[str, str]], typing.List[typing.Dict], None]) -> typing.Callable[[typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]], typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]]:
391
317
  """
392
- Enables checkpointing for a step.
318
+ Decorator that helps cache, version and store models/datasets from huggingface hub.
393
319
 
394
320
  > Examples
395
321
 
396
- - Saving Checkpoints
397
-
322
+ **Usage: creating references of models from huggingface that may be loaded in downstream steps**
398
323
  ```python
399
- @checkpoint
400
- @step
401
- def train(self):
402
- model = create_model(self.parameters, checkpoint_path = None)
403
- for i in range(self.epochs):
404
- # some training logic
405
- loss = model.train(self.dataset)
406
- if i % 10 == 0:
407
- model.save(
408
- current.checkpoint.directory,
409
- )
410
- # saves the contents of the `current.checkpoint.directory` as a checkpoint
411
- # and returns a reference dictionary to the checkpoint saved in the datastore
412
- self.latest_checkpoint = current.checkpoint.save(
413
- name="epoch_checkpoint",
414
- metadata={
415
- "epoch": i,
416
- "loss": loss,
417
- }
418
- )
324
+ @huggingface_hub
325
+ @step
326
+ def pull_model_from_huggingface(self):
327
+ # `current.huggingface_hub.snapshot_download` downloads the model from the Hugging Face Hub
328
+ # and saves it in the backend storage based on the model's `repo_id`. If there exists a model
329
+ # with the same `repo_id` in the backend storage, it will not download the model again. The return
330
+ # value of the function is a reference to the model in the backend storage.
331
+ # This reference can be used to load the model in the subsequent steps via `@model(load=["llama_model"])`
332
+
333
+ self.model_id = "mistralai/Mistral-7B-Instruct-v0.1"
334
+ self.llama_model = current.huggingface_hub.snapshot_download(
335
+ repo_id=self.model_id,
336
+ allow_patterns=["*.safetensors", "*.json", "tokenizer.*"],
337
+ )
338
+ self.next(self.train)
419
339
  ```
420
340
 
421
- - Using Loaded Checkpoints
341
+ **Usage: loading models directly from huggingface hub or from cache (from metaflow's datastore)**
342
+ ```python
343
+ @huggingface_hub(load=["mistralai/Mistral-7B-Instruct-v0.1"])
344
+ @step
345
+ def pull_model_from_huggingface(self):
346
+ path_to_model = current.huggingface_hub.loaded["mistralai/Mistral-7B-Instruct-v0.1"]
347
+ ```
422
348
 
423
349
  ```python
424
- @retry(times=3)
425
- @checkpoint
426
- @step
427
- def train(self):
428
- # Assume that the task has restarted and the previous attempt of the task
429
- # saved a checkpoint
430
- checkpoint_path = None
431
- if current.checkpoint.is_loaded: # Check if a checkpoint is loaded
432
- print("Loaded checkpoint from the previous attempt")
433
- checkpoint_path = current.checkpoint.directory
350
+ @huggingface_hub(load=[("mistralai/Mistral-7B-Instruct-v0.1", "/my-directory"), ("myorg/mistral-lora, "/my-lora-directory")])
351
+ @step
352
+ def finetune_model(self):
353
+ path_to_model = current.huggingface_hub.loaded["mistralai/Mistral-7B-Instruct-v0.1"]
354
+ # path_to_model will be /my-directory
355
+ ```
434
356
 
435
- model = create_model(self.parameters, checkpoint_path = checkpoint_path)
436
- for i in range(self.epochs):
437
- ...
357
+ ```python
358
+ # Takes all the arguments passed to `snapshot_download`
359
+ # except for `local_dir`
360
+ @huggingface_hub(load=[
361
+ {
362
+ "repo_id": "mistralai/Mistral-7B-Instruct-v0.1",
363
+ },
364
+ {
365
+ "repo_id": "myorg/mistral-lora",
366
+ "repo_type": "model",
367
+ },
368
+ ])
369
+ @step
370
+ def finetune_model(self):
371
+ path_to_model = current.huggingface_hub.loaded["mistralai/Mistral-7B-Instruct-v0.1"]
372
+ # path_to_model will be /my-directory
438
373
  ```
439
374
 
440
375
 
441
376
  Parameters
442
377
  ----------
443
- load_policy : str, default: "fresh"
444
- The policy for loading the checkpoint. The following policies are supported:
378
+ temp_dir_root : str, optional
379
+ The root directory that will hold the temporary directory where objects will be downloaded.
380
+
381
+ load: Union[List[str], List[Tuple[Dict, str]], List[Tuple[str, str]], List[Dict], None]
382
+ The list of repos (models/datasets) to load.
383
+
384
+ Loaded repos can be accessed via `current.huggingface_hub.loaded`. If load is set, then the following happens:
385
+
386
+ - If repo (model/dataset) is not found in the datastore:
387
+ - Downloads the repo from Hugging Face Hub to a temporary directory (or uses specified path) for local access
388
+ - Stores it in Metaflow's datastore (s3/gcs/azure etc.) with a unique name based on repo_type/repo_id
389
+ - All HF models loaded for a `@step` will be cached separately under flow/step/namespace.
390
+
391
+ - If repo is found in the datastore:
392
+ - Loads it directly from datastore to local path (can be temporary directory or specified path)
393
+ """
394
+ ...
395
+
396
+ @typing.overload
397
+ def card(*, type: str = 'default', id: typing.Optional[str] = None, options: typing.Dict[str, typing.Any] = {}, timeout: int = 45) -> typing.Callable[[typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]], typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]]:
398
+ """
399
+ Creates a human-readable report, a Metaflow Card, after this step completes.
400
+
401
+ Note that you may add multiple `@card` decorators in a step with different parameters.
402
+
403
+
404
+ Parameters
405
+ ----------
406
+ type : str, default 'default'
407
+ Card type.
408
+ id : str, optional, default None
409
+ If multiple cards are present, use this id to identify this card.
410
+ options : Dict[str, Any], default {}
411
+ Options passed to the card. The contents depend on the card type.
412
+ timeout : int, default 45
413
+ Interrupt reporting if it takes more than this many seconds.
414
+ """
415
+ ...
416
+
417
+ @typing.overload
418
+ def card(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
419
+ ...
420
+
421
+ @typing.overload
422
+ def card(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
423
+ ...
424
+
425
+ def card(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None, *, type: str = 'default', id: typing.Optional[str] = None, options: typing.Dict[str, typing.Any] = {}, timeout: int = 45):
426
+ """
427
+ Creates a human-readable report, a Metaflow Card, after this step completes.
428
+
429
+ Note that you may add multiple `@card` decorators in a step with different parameters.
430
+
431
+
432
+ Parameters
433
+ ----------
434
+ type : str, default 'default'
435
+ Card type.
436
+ id : str, optional, default None
437
+ If multiple cards are present, use this id to identify this card.
438
+ options : Dict[str, Any], default {}
439
+ Options passed to the card. The contents depend on the card type.
440
+ timeout : int, default 45
441
+ Interrupt reporting if it takes more than this many seconds.
442
+ """
443
+ ...
444
+
445
+ def vllm(*, model: str, backend: str, openai_api_server: bool, debug: bool, card_refresh_interval: int, max_retries: int, retry_alert_frequency: int, engine_args: dict) -> typing.Callable[[typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]], typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]]:
446
+ """
447
+ This decorator is used to run vllm APIs as Metaflow task sidecars.
448
+
449
+ User code call
450
+ --------------
451
+ @vllm(
452
+ model="...",
453
+ ...
454
+ )
455
+
456
+ Valid backend options
457
+ ---------------------
458
+ - 'local': Run as a separate process on the local task machine.
459
+
460
+ Valid model options
461
+ -------------------
462
+ Any HuggingFace model identifier, e.g. 'meta-llama/Llama-3.2-1B'
463
+
464
+ NOTE: vLLM's OpenAI-compatible server serves ONE model per server instance.
465
+ If you need multiple models, you must create multiple @vllm decorators.
466
+
467
+
468
+ Parameters
469
+ ----------
470
+ model: str
471
+ HuggingFace model identifier to be served by vLLM.
472
+ backend: str
473
+ Determines where and how to run the vLLM process.
474
+ openai_api_server: bool
475
+ Whether to use OpenAI-compatible API server mode (subprocess) instead of native engine.
476
+ Default is False (uses native engine).
477
+ Set to True for backward compatibility with existing code.
478
+ debug: bool
479
+ Whether to turn on verbose debugging logs.
480
+ card_refresh_interval: int
481
+ Interval in seconds for refreshing the vLLM status card.
482
+ Only used when openai_api_server=True.
483
+ max_retries: int
484
+ Maximum number of retries checking for vLLM server startup.
485
+ Only used when openai_api_server=True.
486
+ retry_alert_frequency: int
487
+ Frequency of alert logs for vLLM server startup retries.
488
+ Only used when openai_api_server=True.
489
+ engine_args : dict
490
+ Additional keyword arguments to pass to the vLLM engine.
491
+ For example, `tensor_parallel_size=2`.
492
+ """
493
+ ...
494
+
495
+ @typing.overload
496
+ def checkpoint(*, load_policy: str = 'fresh', temp_dir_root: str = None) -> typing.Callable[[typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]], typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]]:
497
+ """
498
+ Enables checkpointing for a step.
499
+
500
+ > Examples
501
+
502
+ - Saving Checkpoints
503
+
504
+ ```python
505
+ @checkpoint
506
+ @step
507
+ def train(self):
508
+ model = create_model(self.parameters, checkpoint_path = None)
509
+ for i in range(self.epochs):
510
+ # some training logic
511
+ loss = model.train(self.dataset)
512
+ if i % 10 == 0:
513
+ model.save(
514
+ current.checkpoint.directory,
515
+ )
516
+ # saves the contents of the `current.checkpoint.directory` as a checkpoint
517
+ # and returns a reference dictionary to the checkpoint saved in the datastore
518
+ self.latest_checkpoint = current.checkpoint.save(
519
+ name="epoch_checkpoint",
520
+ metadata={
521
+ "epoch": i,
522
+ "loss": loss,
523
+ }
524
+ )
525
+ ```
526
+
527
+ - Using Loaded Checkpoints
528
+
529
+ ```python
530
+ @retry(times=3)
531
+ @checkpoint
532
+ @step
533
+ def train(self):
534
+ # Assume that the task has restarted and the previous attempt of the task
535
+ # saved a checkpoint
536
+ checkpoint_path = None
537
+ if current.checkpoint.is_loaded: # Check if a checkpoint is loaded
538
+ print("Loaded checkpoint from the previous attempt")
539
+ checkpoint_path = current.checkpoint.directory
540
+
541
+ model = create_model(self.parameters, checkpoint_path = checkpoint_path)
542
+ for i in range(self.epochs):
543
+ ...
544
+ ```
545
+
546
+
547
+ Parameters
548
+ ----------
549
+ load_policy : str, default: "fresh"
550
+ The policy for loading the checkpoint. The following policies are supported:
445
551
  - "eager": Loads the the latest available checkpoint within the namespace.
446
552
  With this mode, the latest checkpoint written by any previous task (can be even a different run) of the step
447
553
  will be loaded at the start of the task.
@@ -533,68 +639,42 @@ def checkpoint(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None
533
639
  """
534
640
  ...
535
641
 
536
- def nvct(*, gpu: int, gpu_type: str) -> typing.Callable[[typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]], typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]]:
537
- """
538
- Specifies that this step should execute on DGX cloud.
539
-
540
-
541
- Parameters
542
- ----------
543
- gpu : int
544
- Number of GPUs to use.
545
- gpu_type : str
546
- Type of Nvidia GPU to use.
547
- """
548
- ...
549
-
550
642
  @typing.overload
551
- def pypi(*, packages: typing.Dict[str, str] = {}, python: typing.Optional[str] = None) -> typing.Callable[[typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]], typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]]:
643
+ def secrets(*, sources: typing.List[typing.Union[str, typing.Dict[str, typing.Any]]] = [], role: typing.Optional[str] = None) -> typing.Callable[[typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]], typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]]:
552
644
  """
553
- Specifies the PyPI packages for the step.
554
-
555
- Information in this decorator will augment any
556
- attributes set in the `@pyi_base` flow-level decorator. Hence,
557
- you can use `@pypi_base` to set packages required by all
558
- steps and use `@pypi` to specify step-specific overrides.
645
+ Specifies secrets to be retrieved and injected as environment variables prior to
646
+ the execution of a step.
559
647
 
560
648
 
561
649
  Parameters
562
650
  ----------
563
- packages : Dict[str, str], default: {}
564
- Packages to use for this step. The key is the name of the package
565
- and the value is the version to use.
566
- python : str, optional, default: None
567
- Version of Python to use, e.g. '3.7.4'. A default value of None implies
568
- that the version used will correspond to the version of the Python interpreter used to start the run.
651
+ sources : List[Union[str, Dict[str, Any]]], default: []
652
+ List of secret specs, defining how the secrets are to be retrieved
653
+ role : str, optional, default: None
654
+ Role to use for fetching secrets
569
655
  """
570
656
  ...
571
657
 
572
658
  @typing.overload
573
- def pypi(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
659
+ def secrets(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
574
660
  ...
575
661
 
576
662
  @typing.overload
577
- def pypi(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
663
+ def secrets(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
578
664
  ...
579
665
 
580
- def pypi(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None, *, packages: typing.Dict[str, str] = {}, python: typing.Optional[str] = None):
666
+ def secrets(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None, *, sources: typing.List[typing.Union[str, typing.Dict[str, typing.Any]]] = [], role: typing.Optional[str] = None):
581
667
  """
582
- Specifies the PyPI packages for the step.
583
-
584
- Information in this decorator will augment any
585
- attributes set in the `@pyi_base` flow-level decorator. Hence,
586
- you can use `@pypi_base` to set packages required by all
587
- steps and use `@pypi` to specify step-specific overrides.
668
+ Specifies secrets to be retrieved and injected as environment variables prior to
669
+ the execution of a step.
588
670
 
589
671
 
590
672
  Parameters
591
673
  ----------
592
- packages : Dict[str, str], default: {}
593
- Packages to use for this step. The key is the name of the package
594
- and the value is the version to use.
595
- python : str, optional, default: None
596
- Version of Python to use, e.g. '3.7.4'. A default value of None implies
597
- that the version used will correspond to the version of the Python interpreter used to start the run.
674
+ sources : List[Union[str, Dict[str, Any]]], default: []
675
+ List of secret specs, defining how the secrets are to be retrieved
676
+ role : str, optional, default: None
677
+ Role to use for fetching secrets
598
678
  """
599
679
  ...
600
680
 
@@ -688,139 +768,211 @@ def kubernetes(*, cpu: int = 1, memory: int = 4096, disk: int = 10240, image: ty
688
768
  ...
689
769
 
690
770
  @typing.overload
691
- def app_deploy(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
771
+ def conda(*, packages: typing.Dict[str, str] = {}, libraries: typing.Dict[str, str] = {}, python: typing.Optional[str] = None, disabled: bool = False) -> typing.Callable[[typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]], typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]]:
692
772
  """
693
- Decorator prototype for all step decorators. This function gets specialized
694
- and imported for all decorators types by _import_plugin_decorators().
773
+ Specifies the Conda environment for the step.
774
+
775
+ Information in this decorator will augment any
776
+ attributes set in the `@conda_base` flow-level decorator. Hence,
777
+ you can use `@conda_base` to set packages required by all
778
+ steps and use `@conda` to specify step-specific overrides.
779
+
780
+
781
+ Parameters
782
+ ----------
783
+ packages : Dict[str, str], default {}
784
+ Packages to use for this step. The key is the name of the package
785
+ and the value is the version to use.
786
+ libraries : Dict[str, str], default {}
787
+ Supported for backward compatibility. When used with packages, packages will take precedence.
788
+ python : str, optional, default None
789
+ Version of Python to use, e.g. '3.7.4'. A default value of None implies
790
+ that the version used will correspond to the version of the Python interpreter used to start the run.
791
+ disabled : bool, default False
792
+ If set to True, disables @conda.
695
793
  """
696
794
  ...
697
795
 
698
796
  @typing.overload
699
- def app_deploy(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
797
+ def conda(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
700
798
  ...
701
799
 
702
- def app_deploy(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None):
800
+ @typing.overload
801
+ def conda(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
802
+ ...
803
+
804
+ def conda(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None, *, packages: typing.Dict[str, str] = {}, libraries: typing.Dict[str, str] = {}, python: typing.Optional[str] = None, disabled: bool = False):
703
805
  """
704
- Decorator prototype for all step decorators. This function gets specialized
705
- and imported for all decorators types by _import_plugin_decorators().
806
+ Specifies the Conda environment for the step.
807
+
808
+ Information in this decorator will augment any
809
+ attributes set in the `@conda_base` flow-level decorator. Hence,
810
+ you can use `@conda_base` to set packages required by all
811
+ steps and use `@conda` to specify step-specific overrides.
812
+
813
+
814
+ Parameters
815
+ ----------
816
+ packages : Dict[str, str], default {}
817
+ Packages to use for this step. The key is the name of the package
818
+ and the value is the version to use.
819
+ libraries : Dict[str, str], default {}
820
+ Supported for backward compatibility. When used with packages, packages will take precedence.
821
+ python : str, optional, default None
822
+ Version of Python to use, e.g. '3.7.4'. A default value of None implies
823
+ that the version used will correspond to the version of the Python interpreter used to start the run.
824
+ disabled : bool, default False
825
+ If set to True, disables @conda.
706
826
  """
707
827
  ...
708
828
 
709
829
  @typing.overload
710
- def retry(*, times: int = 3, minutes_between_retries: int = 2) -> typing.Callable[[typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]], typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]]:
830
+ def model(*, load: typing.Union[typing.List[str], str, typing.List[typing.Tuple[str, typing.Optional[str]]]] = None, temp_dir_root: str = None) -> typing.Callable[[typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]], typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]]:
711
831
  """
712
- Specifies the number of times the task corresponding
713
- to a step needs to be retried.
832
+ Enables loading / saving of models within a step.
714
833
 
715
- This decorator is useful for handling transient errors, such as networking issues.
716
- If your task contains operations that can't be retried safely, e.g. database updates,
717
- it is advisable to annotate it with `@retry(times=0)`.
834
+ > Examples
835
+ - Saving Models
836
+ ```python
837
+ @model
838
+ @step
839
+ def train(self):
840
+ # current.model.save returns a dictionary reference to the model saved
841
+ self.my_model = current.model.save(
842
+ path_to_my_model,
843
+ label="my_model",
844
+ metadata={
845
+ "epochs": 10,
846
+ "batch-size": 32,
847
+ "learning-rate": 0.001,
848
+ }
849
+ )
850
+ self.next(self.test)
718
851
 
719
- This can be used in conjunction with the `@catch` decorator. The `@catch`
720
- decorator will execute a no-op task after all retries have been exhausted,
721
- ensuring that the flow execution can continue.
852
+ @model(load="my_model")
853
+ @step
854
+ def test(self):
855
+ # `current.model.loaded` returns a dictionary of the loaded models
856
+ # where the key is the name of the artifact and the value is the path to the model
857
+ print(os.listdir(current.model.loaded["my_model"]))
858
+ self.next(self.end)
859
+ ```
860
+
861
+ - Loading models
862
+ ```python
863
+ @step
864
+ def train(self):
865
+ # current.model.load returns the path to the model loaded
866
+ checkpoint_path = current.model.load(
867
+ self.checkpoint_key,
868
+ )
869
+ model_path = current.model.load(
870
+ self.model,
871
+ )
872
+ self.next(self.test)
873
+ ```
722
874
 
723
875
 
724
876
  Parameters
725
877
  ----------
726
- times : int, default 3
727
- Number of times to retry this task.
728
- minutes_between_retries : int, default 2
729
- Number of minutes between retries.
878
+ load : Union[List[str],str,List[Tuple[str,Union[str,None]]]], default: None
879
+ Artifact name/s referencing the models/checkpoints to load. Artifact names refer to the names of the instance variables set to `self`.
880
+ These artifact names give to `load` be reference objects or reference `key` string's from objects created by `current.checkpoint` / `current.model` / `current.huggingface_hub`.
881
+ If a list of tuples is provided, the first element is the artifact name and the second element is the path the artifact needs be unpacked on
882
+ the local filesystem. If the second element is None, the artifact will be unpacked in the current working directory.
883
+ If a string is provided, then the artifact corresponding to that name will be loaded in the current working directory.
884
+
885
+ temp_dir_root : str, default: None
886
+ The root directory under which `current.model.loaded` will store loaded models
730
887
  """
731
888
  ...
732
889
 
733
890
  @typing.overload
734
- def retry(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
891
+ def model(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
735
892
  ...
736
893
 
737
894
  @typing.overload
738
- def retry(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
895
+ def model(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
739
896
  ...
740
897
 
741
- def retry(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None, *, times: int = 3, minutes_between_retries: int = 2):
898
+ def model(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None, *, load: typing.Union[typing.List[str], str, typing.List[typing.Tuple[str, typing.Optional[str]]]] = None, temp_dir_root: str = None):
742
899
  """
743
- Specifies the number of times the task corresponding
744
- to a step needs to be retried.
900
+ Enables loading / saving of models within a step.
745
901
 
746
- This decorator is useful for handling transient errors, such as networking issues.
747
- If your task contains operations that can't be retried safely, e.g. database updates,
748
- it is advisable to annotate it with `@retry(times=0)`.
902
+ > Examples
903
+ - Saving Models
904
+ ```python
905
+ @model
906
+ @step
907
+ def train(self):
908
+ # current.model.save returns a dictionary reference to the model saved
909
+ self.my_model = current.model.save(
910
+ path_to_my_model,
911
+ label="my_model",
912
+ metadata={
913
+ "epochs": 10,
914
+ "batch-size": 32,
915
+ "learning-rate": 0.001,
916
+ }
917
+ )
918
+ self.next(self.test)
749
919
 
750
- This can be used in conjunction with the `@catch` decorator. The `@catch`
751
- decorator will execute a no-op task after all retries have been exhausted,
752
- ensuring that the flow execution can continue.
920
+ @model(load="my_model")
921
+ @step
922
+ def test(self):
923
+ # `current.model.loaded` returns a dictionary of the loaded models
924
+ # where the key is the name of the artifact and the value is the path to the model
925
+ print(os.listdir(current.model.loaded["my_model"]))
926
+ self.next(self.end)
927
+ ```
928
+
929
+ - Loading models
930
+ ```python
931
+ @step
932
+ def train(self):
933
+ # current.model.load returns the path to the model loaded
934
+ checkpoint_path = current.model.load(
935
+ self.checkpoint_key,
936
+ )
937
+ model_path = current.model.load(
938
+ self.model,
939
+ )
940
+ self.next(self.test)
941
+ ```
753
942
 
754
943
 
755
944
  Parameters
756
945
  ----------
757
- times : int, default 3
758
- Number of times to retry this task.
759
- minutes_between_retries : int, default 2
760
- Number of minutes between retries.
946
+ load : Union[List[str],str,List[Tuple[str,Union[str,None]]]], default: None
947
+ Artifact name/s referencing the models/checkpoints to load. Artifact names refer to the names of the instance variables set to `self`.
948
+ These artifact names give to `load` be reference objects or reference `key` string's from objects created by `current.checkpoint` / `current.model` / `current.huggingface_hub`.
949
+ If a list of tuples is provided, the first element is the artifact name and the second element is the path the artifact needs be unpacked on
950
+ the local filesystem. If the second element is None, the artifact will be unpacked in the current working directory.
951
+ If a string is provided, then the artifact corresponding to that name will be loaded in the current working directory.
952
+
953
+ temp_dir_root : str, default: None
954
+ The root directory under which `current.model.loaded` will store loaded models
761
955
  """
762
956
  ...
763
957
 
764
958
  @typing.overload
765
- def conda(*, packages: typing.Dict[str, str] = {}, libraries: typing.Dict[str, str] = {}, python: typing.Optional[str] = None, disabled: bool = False) -> typing.Callable[[typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]], typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]]:
959
+ def fast_bakery_internal(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
766
960
  """
767
- Specifies the Conda environment for the step.
768
-
769
- Information in this decorator will augment any
770
- attributes set in the `@conda_base` flow-level decorator. Hence,
771
- you can use `@conda_base` to set packages required by all
772
- steps and use `@conda` to specify step-specific overrides.
773
-
774
-
775
- Parameters
776
- ----------
777
- packages : Dict[str, str], default {}
778
- Packages to use for this step. The key is the name of the package
779
- and the value is the version to use.
780
- libraries : Dict[str, str], default {}
781
- Supported for backward compatibility. When used with packages, packages will take precedence.
782
- python : str, optional, default None
783
- Version of Python to use, e.g. '3.7.4'. A default value of None implies
784
- that the version used will correspond to the version of the Python interpreter used to start the run.
785
- disabled : bool, default False
786
- If set to True, disables @conda.
961
+ Internal decorator to support Fast bakery
787
962
  """
788
963
  ...
789
964
 
790
965
  @typing.overload
791
- def conda(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
792
- ...
793
-
794
- @typing.overload
795
- def conda(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
966
+ def fast_bakery_internal(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
796
967
  ...
797
968
 
798
- def conda(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None, *, packages: typing.Dict[str, str] = {}, libraries: typing.Dict[str, str] = {}, python: typing.Optional[str] = None, disabled: bool = False):
969
+ def fast_bakery_internal(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None):
799
970
  """
800
- Specifies the Conda environment for the step.
801
-
802
- Information in this decorator will augment any
803
- attributes set in the `@conda_base` flow-level decorator. Hence,
804
- you can use `@conda_base` to set packages required by all
805
- steps and use `@conda` to specify step-specific overrides.
806
-
807
-
808
- Parameters
809
- ----------
810
- packages : Dict[str, str], default {}
811
- Packages to use for this step. The key is the name of the package
812
- and the value is the version to use.
813
- libraries : Dict[str, str], default {}
814
- Supported for backward compatibility. When used with packages, packages will take precedence.
815
- python : str, optional, default None
816
- Version of Python to use, e.g. '3.7.4'. A default value of None implies
817
- that the version used will correspond to the version of the Python interpreter used to start the run.
818
- disabled : bool, default False
819
- If set to True, disables @conda.
971
+ Internal decorator to support Fast bakery
820
972
  """
821
973
  ...
822
974
 
823
- def nvidia(*, gpu: int, gpu_type: str, queue_timeout: int) -> typing.Callable[[typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]], typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]]:
975
+ def nvct(*, gpu: int, gpu_type: str) -> typing.Callable[[typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]], typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]]:
824
976
  """
825
977
  Specifies that this step should execute on DGX cloud.
826
978
 
@@ -831,137 +983,112 @@ def nvidia(*, gpu: int, gpu_type: str, queue_timeout: int) -> typing.Callable[[t
831
983
  Number of GPUs to use.
832
984
  gpu_type : str
833
985
  Type of Nvidia GPU to use.
834
- queue_timeout : int
835
- Time to keep the job in NVCF's queue.
836
986
  """
837
987
  ...
838
988
 
839
989
  @typing.overload
840
- def resources(*, cpu: int = 1, gpu: typing.Optional[int] = None, disk: typing.Optional[int] = None, memory: int = 4096, shared_memory: typing.Optional[int] = None) -> typing.Callable[[typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]], typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]]:
990
+ def pypi(*, packages: typing.Dict[str, str] = {}, python: typing.Optional[str] = None) -> typing.Callable[[typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]], typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]]:
841
991
  """
842
- Specifies the resources needed when executing this step.
843
-
844
- Use `@resources` to specify the resource requirements
845
- independently of the specific compute layer (`@batch`, `@kubernetes`).
992
+ Specifies the PyPI packages for the step.
846
993
 
847
- You can choose the compute layer on the command line by executing e.g.
848
- ```
849
- python myflow.py run --with batch
850
- ```
851
- or
852
- ```
853
- python myflow.py run --with kubernetes
854
- ```
855
- which executes the flow on the desired system using the
856
- requirements specified in `@resources`.
994
+ Information in this decorator will augment any
995
+ attributes set in the `@pyi_base` flow-level decorator. Hence,
996
+ you can use `@pypi_base` to set packages required by all
997
+ steps and use `@pypi` to specify step-specific overrides.
857
998
 
858
999
 
859
1000
  Parameters
860
1001
  ----------
861
- cpu : int, default 1
862
- Number of CPUs required for this step.
863
- gpu : int, optional, default None
864
- Number of GPUs required for this step.
865
- disk : int, optional, default None
866
- Disk size (in MB) required for this step. Only applies on Kubernetes.
867
- memory : int, default 4096
868
- Memory size (in MB) required for this step.
869
- shared_memory : int, optional, default None
870
- The value for the size (in MiB) of the /dev/shm volume for this step.
871
- This parameter maps to the `--shm-size` option in Docker.
1002
+ packages : Dict[str, str], default: {}
1003
+ Packages to use for this step. The key is the name of the package
1004
+ and the value is the version to use.
1005
+ python : str, optional, default: None
1006
+ Version of Python to use, e.g. '3.7.4'. A default value of None implies
1007
+ that the version used will correspond to the version of the Python interpreter used to start the run.
872
1008
  """
873
1009
  ...
874
1010
 
875
1011
  @typing.overload
876
- def resources(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
1012
+ def pypi(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
877
1013
  ...
878
1014
 
879
1015
  @typing.overload
880
- def resources(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
1016
+ def pypi(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
881
1017
  ...
882
1018
 
883
- def resources(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None, *, cpu: int = 1, gpu: typing.Optional[int] = None, disk: typing.Optional[int] = None, memory: int = 4096, shared_memory: typing.Optional[int] = None):
1019
+ def pypi(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None, *, packages: typing.Dict[str, str] = {}, python: typing.Optional[str] = None):
884
1020
  """
885
- Specifies the resources needed when executing this step.
886
-
887
- Use `@resources` to specify the resource requirements
888
- independently of the specific compute layer (`@batch`, `@kubernetes`).
1021
+ Specifies the PyPI packages for the step.
889
1022
 
890
- You can choose the compute layer on the command line by executing e.g.
891
- ```
892
- python myflow.py run --with batch
893
- ```
894
- or
895
- ```
896
- python myflow.py run --with kubernetes
897
- ```
898
- which executes the flow on the desired system using the
899
- requirements specified in `@resources`.
1023
+ Information in this decorator will augment any
1024
+ attributes set in the `@pyi_base` flow-level decorator. Hence,
1025
+ you can use `@pypi_base` to set packages required by all
1026
+ steps and use `@pypi` to specify step-specific overrides.
900
1027
 
901
1028
 
902
1029
  Parameters
903
1030
  ----------
904
- cpu : int, default 1
905
- Number of CPUs required for this step.
906
- gpu : int, optional, default None
907
- Number of GPUs required for this step.
908
- disk : int, optional, default None
909
- Disk size (in MB) required for this step. Only applies on Kubernetes.
910
- memory : int, default 4096
911
- Memory size (in MB) required for this step.
912
- shared_memory : int, optional, default None
913
- The value for the size (in MiB) of the /dev/shm volume for this step.
914
- This parameter maps to the `--shm-size` option in Docker.
1031
+ packages : Dict[str, str], default: {}
1032
+ Packages to use for this step. The key is the name of the package
1033
+ and the value is the version to use.
1034
+ python : str, optional, default: None
1035
+ Version of Python to use, e.g. '3.7.4'. A default value of None implies
1036
+ that the version used will correspond to the version of the Python interpreter used to start the run.
915
1037
  """
916
1038
  ...
917
1039
 
918
- def vllm(*, model: str, backend: str, openai_api_server: bool, debug: bool, card_refresh_interval: int, max_retries: int, retry_alert_frequency: int, engine_args: dict) -> typing.Callable[[typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]], typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]]:
1040
+ @typing.overload
1041
+ def retry(*, times: int = 3, minutes_between_retries: int = 2) -> typing.Callable[[typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]], typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]]:
919
1042
  """
920
- This decorator is used to run vllm APIs as Metaflow task sidecars.
1043
+ Specifies the number of times the task corresponding
1044
+ to a step needs to be retried.
921
1045
 
922
- User code call
923
- --------------
924
- @vllm(
925
- model="...",
926
- ...
927
- )
1046
+ This decorator is useful for handling transient errors, such as networking issues.
1047
+ If your task contains operations that can't be retried safely, e.g. database updates,
1048
+ it is advisable to annotate it with `@retry(times=0)`.
928
1049
 
929
- Valid backend options
930
- ---------------------
931
- - 'local': Run as a separate process on the local task machine.
1050
+ This can be used in conjunction with the `@catch` decorator. The `@catch`
1051
+ decorator will execute a no-op task after all retries have been exhausted,
1052
+ ensuring that the flow execution can continue.
932
1053
 
933
- Valid model options
934
- -------------------
935
- Any HuggingFace model identifier, e.g. 'meta-llama/Llama-3.2-1B'
936
1054
 
937
- NOTE: vLLM's OpenAI-compatible server serves ONE model per server instance.
938
- If you need multiple models, you must create multiple @vllm decorators.
1055
+ Parameters
1056
+ ----------
1057
+ times : int, default 3
1058
+ Number of times to retry this task.
1059
+ minutes_between_retries : int, default 2
1060
+ Number of minutes between retries.
1061
+ """
1062
+ ...
1063
+
1064
+ @typing.overload
1065
+ def retry(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
1066
+ ...
1067
+
1068
+ @typing.overload
1069
+ def retry(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
1070
+ ...
1071
+
1072
+ def retry(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None, *, times: int = 3, minutes_between_retries: int = 2):
1073
+ """
1074
+ Specifies the number of times the task corresponding
1075
+ to a step needs to be retried.
1076
+
1077
+ This decorator is useful for handling transient errors, such as networking issues.
1078
+ If your task contains operations that can't be retried safely, e.g. database updates,
1079
+ it is advisable to annotate it with `@retry(times=0)`.
1080
+
1081
+ This can be used in conjunction with the `@catch` decorator. The `@catch`
1082
+ decorator will execute a no-op task after all retries have been exhausted,
1083
+ ensuring that the flow execution can continue.
939
1084
 
940
1085
 
941
1086
  Parameters
942
1087
  ----------
943
- model: str
944
- HuggingFace model identifier to be served by vLLM.
945
- backend: str
946
- Determines where and how to run the vLLM process.
947
- openai_api_server: bool
948
- Whether to use OpenAI-compatible API server mode (subprocess) instead of native engine.
949
- Default is False (uses native engine).
950
- Set to True for backward compatibility with existing code.
951
- debug: bool
952
- Whether to turn on verbose debugging logs.
953
- card_refresh_interval: int
954
- Interval in seconds for refreshing the vLLM status card.
955
- Only used when openai_api_server=True.
956
- max_retries: int
957
- Maximum number of retries checking for vLLM server startup.
958
- Only used when openai_api_server=True.
959
- retry_alert_frequency: int
960
- Frequency of alert logs for vLLM server startup retries.
961
- Only used when openai_api_server=True.
962
- engine_args : dict
963
- Additional keyword arguments to pass to the vLLM engine.
964
- For example, `tensor_parallel_size=2`.
1088
+ times : int, default 3
1089
+ Number of times to retry this task.
1090
+ minutes_between_retries : int, default 2
1091
+ Number of minutes between retries.
965
1092
  """
966
1093
  ...
967
1094
 
@@ -998,166 +1125,86 @@ def environment(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], Non
998
1125
  """
999
1126
  ...
1000
1127
 
1001
- def huggingface_hub(*, temp_dir_root: typing.Optional[str] = None, load: typing.Union[typing.List[str], typing.List[typing.Tuple[typing.Dict, str]], typing.List[typing.Tuple[str, str]], typing.List[typing.Dict], None]) -> typing.Callable[[typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]], typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]]:
1128
+ def nvidia(*, gpu: int, gpu_type: str, queue_timeout: int) -> typing.Callable[[typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]], typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]]:
1002
1129
  """
1003
- Decorator that helps cache, version and store models/datasets from huggingface hub.
1004
-
1005
- > Examples
1006
-
1007
- **Usage: creating references of models from huggingface that may be loaded in downstream steps**
1008
- ```python
1009
- @huggingface_hub
1010
- @step
1011
- def pull_model_from_huggingface(self):
1012
- # `current.huggingface_hub.snapshot_download` downloads the model from the Hugging Face Hub
1013
- # and saves it in the backend storage based on the model's `repo_id`. If there exists a model
1014
- # with the same `repo_id` in the backend storage, it will not download the model again. The return
1015
- # value of the function is a reference to the model in the backend storage.
1016
- # This reference can be used to load the model in the subsequent steps via `@model(load=["llama_model"])`
1017
-
1018
- self.model_id = "mistralai/Mistral-7B-Instruct-v0.1"
1019
- self.llama_model = current.huggingface_hub.snapshot_download(
1020
- repo_id=self.model_id,
1021
- allow_patterns=["*.safetensors", "*.json", "tokenizer.*"],
1022
- )
1023
- self.next(self.train)
1024
- ```
1025
-
1026
- **Usage: loading models directly from huggingface hub or from cache (from metaflow's datastore)**
1027
- ```python
1028
- @huggingface_hub(load=["mistralai/Mistral-7B-Instruct-v0.1"])
1029
- @step
1030
- def pull_model_from_huggingface(self):
1031
- path_to_model = current.huggingface_hub.loaded["mistralai/Mistral-7B-Instruct-v0.1"]
1032
- ```
1033
-
1034
- ```python
1035
- @huggingface_hub(load=[("mistralai/Mistral-7B-Instruct-v0.1", "/my-directory"), ("myorg/mistral-lora, "/my-lora-directory")])
1036
- @step
1037
- def finetune_model(self):
1038
- path_to_model = current.huggingface_hub.loaded["mistralai/Mistral-7B-Instruct-v0.1"]
1039
- # path_to_model will be /my-directory
1040
- ```
1041
-
1042
- ```python
1043
- # Takes all the arguments passed to `snapshot_download`
1044
- # except for `local_dir`
1045
- @huggingface_hub(load=[
1046
- {
1047
- "repo_id": "mistralai/Mistral-7B-Instruct-v0.1",
1048
- },
1049
- {
1050
- "repo_id": "myorg/mistral-lora",
1051
- "repo_type": "model",
1052
- },
1053
- ])
1054
- @step
1055
- def finetune_model(self):
1056
- path_to_model = current.huggingface_hub.loaded["mistralai/Mistral-7B-Instruct-v0.1"]
1057
- # path_to_model will be /my-directory
1058
- ```
1130
+ Specifies that this step should execute on DGX cloud.
1059
1131
 
1060
1132
 
1061
1133
  Parameters
1062
1134
  ----------
1063
- temp_dir_root : str, optional
1064
- The root directory that will hold the temporary directory where objects will be downloaded.
1065
-
1066
- load: Union[List[str], List[Tuple[Dict, str]], List[Tuple[str, str]], List[Dict], None]
1067
- The list of repos (models/datasets) to load.
1068
-
1069
- Loaded repos can be accessed via `current.huggingface_hub.loaded`. If load is set, then the following happens:
1070
-
1071
- - If repo (model/dataset) is not found in the datastore:
1072
- - Downloads the repo from Hugging Face Hub to a temporary directory (or uses specified path) for local access
1073
- - Stores it in Metaflow's datastore (s3/gcs/azure etc.) with a unique name based on repo_type/repo_id
1074
- - All HF models loaded for a `@step` will be cached separately under flow/step/namespace.
1075
-
1076
- - If repo is found in the datastore:
1077
- - Loads it directly from datastore to local path (can be temporary directory or specified path)
1135
+ gpu : int
1136
+ Number of GPUs to use.
1137
+ gpu_type : str
1138
+ Type of Nvidia GPU to use.
1139
+ queue_timeout : int
1140
+ Time to keep the job in NVCF's queue.
1078
1141
  """
1079
1142
  ...
1080
1143
 
1081
- @typing.overload
1082
- def card(*, type: str = 'default', id: typing.Optional[str] = None, options: typing.Dict[str, typing.Any] = {}, timeout: int = 45) -> typing.Callable[[typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]], typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]]:
1144
+ def ollama(*, models: list, backend: str, force_pull: bool, cache_update_policy: str, force_cache_update: bool, debug: bool, circuit_breaker_config: dict, timeout_config: dict) -> typing.Callable[[typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]], typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]]:
1083
1145
  """
1084
- Creates a human-readable report, a Metaflow Card, after this step completes.
1085
-
1086
- Note that you may add multiple `@card` decorators in a step with different parameters.
1146
+ This decorator is used to run Ollama APIs as Metaflow task sidecars.
1087
1147
 
1148
+ User code call
1149
+ --------------
1150
+ @ollama(
1151
+ models=[...],
1152
+ ...
1153
+ )
1088
1154
 
1089
- Parameters
1090
- ----------
1091
- type : str, default 'default'
1092
- Card type.
1093
- id : str, optional, default None
1094
- If multiple cards are present, use this id to identify this card.
1095
- options : Dict[str, Any], default {}
1096
- Options passed to the card. The contents depend on the card type.
1097
- timeout : int, default 45
1098
- Interrupt reporting if it takes more than this many seconds.
1099
- """
1100
- ...
1101
-
1102
- @typing.overload
1103
- def card(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
1104
- ...
1105
-
1106
- @typing.overload
1107
- def card(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
1108
- ...
1109
-
1110
- def card(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None, *, type: str = 'default', id: typing.Optional[str] = None, options: typing.Dict[str, typing.Any] = {}, timeout: int = 45):
1111
- """
1112
- Creates a human-readable report, a Metaflow Card, after this step completes.
1155
+ Valid backend options
1156
+ ---------------------
1157
+ - 'local': Run as a separate process on the local task machine.
1158
+ - (TODO) 'managed': Outerbounds hosts and selects compute provider.
1159
+ - (TODO) 'remote': Spin up separate instance to serve Ollama models.
1113
1160
 
1114
- Note that you may add multiple `@card` decorators in a step with different parameters.
1161
+ Valid model options
1162
+ -------------------
1163
+ Any model here https://ollama.com/search, e.g. 'llama3.2', 'llama3.3'
1115
1164
 
1116
1165
 
1117
1166
  Parameters
1118
1167
  ----------
1119
- type : str, default 'default'
1120
- Card type.
1121
- id : str, optional, default None
1122
- If multiple cards are present, use this id to identify this card.
1123
- options : Dict[str, Any], default {}
1124
- Options passed to the card. The contents depend on the card type.
1125
- timeout : int, default 45
1126
- Interrupt reporting if it takes more than this many seconds.
1168
+ models: list[str]
1169
+ List of Ollama containers running models in sidecars.
1170
+ backend: str
1171
+ Determines where and how to run the Ollama process.
1172
+ force_pull: bool
1173
+ Whether to run `ollama pull` no matter what, or first check the remote cache in Metaflow datastore for this model key.
1174
+ cache_update_policy: str
1175
+ Cache update policy: "auto", "force", or "never".
1176
+ force_cache_update: bool
1177
+ Simple override for "force" cache update policy.
1178
+ debug: bool
1179
+ Whether to turn on verbose debugging logs.
1180
+ circuit_breaker_config: dict
1181
+ Configuration for circuit breaker protection. Keys: failure_threshold, recovery_timeout, reset_timeout.
1182
+ timeout_config: dict
1183
+ Configuration for various operation timeouts. Keys: pull, stop, health_check, install, server_startup.
1127
1184
  """
1128
1185
  ...
1129
1186
 
1130
1187
  @typing.overload
1131
- def catch(*, var: typing.Optional[str] = None, print_exception: bool = True) -> typing.Callable[[typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]], typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]]:
1188
+ def app_deploy(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
1132
1189
  """
1133
- Specifies that the step will success under all circumstances.
1134
-
1135
- The decorator will create an optional artifact, specified by `var`, which
1136
- contains the exception raised. You can use it to detect the presence
1137
- of errors, indicating that all happy-path artifacts produced by the step
1138
- are missing.
1139
-
1140
-
1141
- Parameters
1142
- ----------
1143
- var : str, optional, default None
1144
- Name of the artifact in which to store the caught exception.
1145
- If not specified, the exception is not stored.
1146
- print_exception : bool, default True
1147
- Determines whether or not the exception is printed to
1148
- stdout when caught.
1190
+ Decorator prototype for all step decorators. This function gets specialized
1191
+ and imported for all decorators types by _import_plugin_decorators().
1149
1192
  """
1150
1193
  ...
1151
1194
 
1152
1195
  @typing.overload
1153
- def catch(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
1196
+ def app_deploy(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
1154
1197
  ...
1155
1198
 
1156
- @typing.overload
1157
- def catch(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
1199
+ def app_deploy(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None):
1200
+ """
1201
+ Decorator prototype for all step decorators. This function gets specialized
1202
+ and imported for all decorators types by _import_plugin_decorators().
1203
+ """
1158
1204
  ...
1159
1205
 
1160
- def catch(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None, *, var: typing.Optional[str] = None, print_exception: bool = True):
1206
+ @typing.overload
1207
+ def catch(*, var: typing.Optional[str] = None, print_exception: bool = True) -> typing.Callable[[typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]], typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]]:
1161
1208
  """
1162
1209
  Specifies that the step will success under all circumstances.
1163
1210
 
@@ -1169,94 +1216,41 @@ def catch(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], ty
1169
1216
 
1170
1217
  Parameters
1171
1218
  ----------
1172
- var : str, optional, default None
1173
- Name of the artifact in which to store the caught exception.
1174
- If not specified, the exception is not stored.
1175
- print_exception : bool, default True
1176
- Determines whether or not the exception is printed to
1177
- stdout when caught.
1178
- """
1179
- ...
1180
-
1181
- @typing.overload
1182
- def secrets(*, sources: typing.List[typing.Union[str, typing.Dict[str, typing.Any]]] = [], role: typing.Optional[str] = None) -> typing.Callable[[typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]], typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]]:
1183
- """
1184
- Specifies secrets to be retrieved and injected as environment variables prior to
1185
- the execution of a step.
1186
-
1187
-
1188
- Parameters
1189
- ----------
1190
- sources : List[Union[str, Dict[str, Any]]], default: []
1191
- List of secret specs, defining how the secrets are to be retrieved
1192
- role : str, optional, default: None
1193
- Role to use for fetching secrets
1194
- """
1195
- ...
1196
-
1197
- @typing.overload
1198
- def secrets(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
1199
- ...
1200
-
1201
- @typing.overload
1202
- def secrets(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
1203
- ...
1204
-
1205
- def secrets(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None, *, sources: typing.List[typing.Union[str, typing.Dict[str, typing.Any]]] = [], role: typing.Optional[str] = None):
1206
- """
1207
- Specifies secrets to be retrieved and injected as environment variables prior to
1208
- the execution of a step.
1209
-
1210
-
1211
- Parameters
1212
- ----------
1213
- sources : List[Union[str, Dict[str, Any]]], default: []
1214
- List of secret specs, defining how the secrets are to be retrieved
1215
- role : str, optional, default: None
1216
- Role to use for fetching secrets
1219
+ var : str, optional, default None
1220
+ Name of the artifact in which to store the caught exception.
1221
+ If not specified, the exception is not stored.
1222
+ print_exception : bool, default True
1223
+ Determines whether or not the exception is printed to
1224
+ stdout when caught.
1217
1225
  """
1218
1226
  ...
1219
1227
 
1220
- def ollama(*, models: list, backend: str, force_pull: bool, cache_update_policy: str, force_cache_update: bool, debug: bool, circuit_breaker_config: dict, timeout_config: dict) -> typing.Callable[[typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]], typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]]:
1228
+ @typing.overload
1229
+ def catch(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
1230
+ ...
1231
+
1232
+ @typing.overload
1233
+ def catch(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
1234
+ ...
1235
+
1236
+ def catch(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None, *, var: typing.Optional[str] = None, print_exception: bool = True):
1221
1237
  """
1222
- This decorator is used to run Ollama APIs as Metaflow task sidecars.
1223
-
1224
- User code call
1225
- --------------
1226
- @ollama(
1227
- models=[...],
1228
- ...
1229
- )
1230
-
1231
- Valid backend options
1232
- ---------------------
1233
- - 'local': Run as a separate process on the local task machine.
1234
- - (TODO) 'managed': Outerbounds hosts and selects compute provider.
1235
- - (TODO) 'remote': Spin up separate instance to serve Ollama models.
1238
+ Specifies that the step will success under all circumstances.
1236
1239
 
1237
- Valid model options
1238
- -------------------
1239
- Any model here https://ollama.com/search, e.g. 'llama3.2', 'llama3.3'
1240
+ The decorator will create an optional artifact, specified by `var`, which
1241
+ contains the exception raised. You can use it to detect the presence
1242
+ of errors, indicating that all happy-path artifacts produced by the step
1243
+ are missing.
1240
1244
 
1241
1245
 
1242
1246
  Parameters
1243
1247
  ----------
1244
- models: list[str]
1245
- List of Ollama containers running models in sidecars.
1246
- backend: str
1247
- Determines where and how to run the Ollama process.
1248
- force_pull: bool
1249
- Whether to run `ollama pull` no matter what, or first check the remote cache in Metaflow datastore for this model key.
1250
- cache_update_policy: str
1251
- Cache update policy: "auto", "force", or "never".
1252
- force_cache_update: bool
1253
- Simple override for "force" cache update policy.
1254
- debug: bool
1255
- Whether to turn on verbose debugging logs.
1256
- circuit_breaker_config: dict
1257
- Configuration for circuit breaker protection. Keys: failure_threshold, recovery_timeout, reset_timeout.
1258
- timeout_config: dict
1259
- Configuration for various operation timeouts. Keys: pull, stop, health_check, install, server_startup.
1248
+ var : str, optional, default None
1249
+ Name of the artifact in which to store the caught exception.
1250
+ If not specified, the exception is not stored.
1251
+ print_exception : bool, default True
1252
+ Determines whether or not the exception is printed to
1253
+ stdout when caught.
1260
1254
  """
1261
1255
  ...
1262
1256
 
@@ -1526,38 +1520,44 @@ def with_artifact_store(f: typing.Optional[typing.Type[FlowSpecDerived]] = None)
1526
1520
  """
1527
1521
  ...
1528
1522
 
1529
- def project(*, name: str, branch: typing.Optional[str] = None, production: bool = False) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
1523
+ @typing.overload
1524
+ def pypi_base(*, packages: typing.Dict[str, str] = {}, python: typing.Optional[str] = None) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
1530
1525
  """
1531
- Specifies what flows belong to the same project.
1532
-
1533
- A project-specific namespace is created for all flows that
1534
- use the same `@project(name)`.
1526
+ Specifies the PyPI packages for all steps of the flow.
1535
1527
 
1528
+ Use `@pypi_base` to set common packages required by all
1529
+ steps and use `@pypi` to specify step-specific overrides.
1536
1530
 
1537
1531
  Parameters
1538
1532
  ----------
1539
- name : str
1540
- Project name. Make sure that the name is unique amongst all
1541
- projects that use the same production scheduler. The name may
1542
- contain only lowercase alphanumeric characters and underscores.
1533
+ packages : Dict[str, str], default: {}
1534
+ Packages to use for this flow. The key is the name of the package
1535
+ and the value is the version to use.
1536
+ python : str, optional, default: None
1537
+ Version of Python to use, e.g. '3.7.4'. A default value of None implies
1538
+ that the version used will correspond to the version of the Python interpreter used to start the run.
1539
+ """
1540
+ ...
1541
+
1542
+ @typing.overload
1543
+ def pypi_base(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
1544
+ ...
1545
+
1546
+ def pypi_base(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *, packages: typing.Dict[str, str] = {}, python: typing.Optional[str] = None):
1547
+ """
1548
+ Specifies the PyPI packages for all steps of the flow.
1543
1549
 
1544
- branch : Optional[str], default None
1545
- The branch to use. If not specified, the branch is set to
1546
- `user.<username>` unless `production` is set to `True`. This can
1547
- also be set on the command line using `--branch` as a top-level option.
1548
- It is an error to specify `branch` in the decorator and on the command line.
1550
+ Use `@pypi_base` to set common packages required by all
1551
+ steps and use `@pypi` to specify step-specific overrides.
1549
1552
 
1550
- production : bool, default False
1551
- Whether or not the branch is the production branch. This can also be set on the
1552
- command line using `--production` as a top-level option. It is an error to specify
1553
- `production` in the decorator and on the command line.
1554
- The project branch name will be:
1555
- - if `branch` is specified:
1556
- - if `production` is True: `prod.<branch>`
1557
- - if `production` is False: `test.<branch>`
1558
- - if `branch` is not specified:
1559
- - if `production` is True: `prod`
1560
- - if `production` is False: `user.<username>`
1553
+ Parameters
1554
+ ----------
1555
+ packages : Dict[str, str], default: {}
1556
+ Packages to use for this flow. The key is the name of the package
1557
+ and the value is the version to use.
1558
+ python : str, optional, default: None
1559
+ Version of Python to use, e.g. '3.7.4'. A default value of None implies
1560
+ that the version used will correspond to the version of the Python interpreter used to start the run.
1561
1561
  """
1562
1562
  ...
1563
1563
 
@@ -1604,6 +1604,49 @@ def airflow_external_task_sensor(*, timeout: int, poke_interval: int, mode: str,
1604
1604
  """
1605
1605
  ...
1606
1606
 
1607
+ def airflow_s3_key_sensor(*, timeout: int, poke_interval: int, mode: str, exponential_backoff: bool, pool: str, soft_fail: bool, name: str, description: str, bucket_key: typing.Union[str, typing.List[str]], bucket_name: str, wildcard_match: bool, aws_conn_id: str, verify: bool) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
1608
+ """
1609
+ The `@airflow_s3_key_sensor` decorator attaches a Airflow [S3KeySensor](https://airflow.apache.org/docs/apache-airflow-providers-amazon/stable/_api/airflow/providers/amazon/aws/sensors/s3/index.html#airflow.providers.amazon.aws.sensors.s3.S3KeySensor)
1610
+ before the start step of the flow. This decorator only works when a flow is scheduled on Airflow
1611
+ and is compiled using `airflow create`. More than one `@airflow_s3_key_sensor` can be
1612
+ added as a flow decorators. Adding more than one decorator will ensure that `start` step
1613
+ starts only after all sensors finish.
1614
+
1615
+
1616
+ Parameters
1617
+ ----------
1618
+ timeout : int
1619
+ Time, in seconds before the task times out and fails. (Default: 3600)
1620
+ poke_interval : int
1621
+ Time in seconds that the job should wait in between each try. (Default: 60)
1622
+ mode : str
1623
+ How the sensor operates. Options are: { poke | reschedule }. (Default: "poke")
1624
+ exponential_backoff : bool
1625
+ allow progressive longer waits between pokes by using exponential backoff algorithm. (Default: True)
1626
+ pool : str
1627
+ the slot pool this task should run in,
1628
+ slot pools are a way to limit concurrency for certain tasks. (Default:None)
1629
+ soft_fail : bool
1630
+ Set to true to mark the task as SKIPPED on failure. (Default: False)
1631
+ name : str
1632
+ Name of the sensor on Airflow
1633
+ description : str
1634
+ Description of sensor in the Airflow UI
1635
+ bucket_key : Union[str, List[str]]
1636
+ The key(s) being waited on. Supports full s3:// style url or relative path from root level.
1637
+ When it's specified as a full s3:// url, please leave `bucket_name` as None
1638
+ bucket_name : str
1639
+ Name of the S3 bucket. Only needed when bucket_key is not provided as a full s3:// url.
1640
+ When specified, all the keys passed to bucket_key refers to this bucket. (Default:None)
1641
+ wildcard_match : bool
1642
+ whether the bucket_key should be interpreted as a Unix wildcard pattern. (Default: False)
1643
+ aws_conn_id : str
1644
+ a reference to the s3 connection on Airflow. (Default: None)
1645
+ verify : bool
1646
+ Whether or not to verify SSL certificates for S3 connection. (Default: None)
1647
+ """
1648
+ ...
1649
+
1607
1650
  @typing.overload
1608
1651
  def conda_base(*, packages: typing.Dict[str, str] = {}, libraries: typing.Dict[str, str] = {}, python: typing.Optional[str] = None, disabled: bool = False) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
1609
1652
  """
@@ -1748,87 +1791,38 @@ def trigger(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *, event: t
1748
1791
  """
1749
1792
  ...
1750
1793
 
1751
- def airflow_s3_key_sensor(*, timeout: int, poke_interval: int, mode: str, exponential_backoff: bool, pool: str, soft_fail: bool, name: str, description: str, bucket_key: typing.Union[str, typing.List[str]], bucket_name: str, wildcard_match: bool, aws_conn_id: str, verify: bool) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
1794
+ def project(*, name: str, branch: typing.Optional[str] = None, production: bool = False) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
1752
1795
  """
1753
- The `@airflow_s3_key_sensor` decorator attaches a Airflow [S3KeySensor](https://airflow.apache.org/docs/apache-airflow-providers-amazon/stable/_api/airflow/providers/amazon/aws/sensors/s3/index.html#airflow.providers.amazon.aws.sensors.s3.S3KeySensor)
1754
- before the start step of the flow. This decorator only works when a flow is scheduled on Airflow
1755
- and is compiled using `airflow create`. More than one `@airflow_s3_key_sensor` can be
1756
- added as a flow decorators. Adding more than one decorator will ensure that `start` step
1757
- starts only after all sensors finish.
1758
-
1796
+ Specifies what flows belong to the same project.
1759
1797
 
1760
- Parameters
1761
- ----------
1762
- timeout : int
1763
- Time, in seconds before the task times out and fails. (Default: 3600)
1764
- poke_interval : int
1765
- Time in seconds that the job should wait in between each try. (Default: 60)
1766
- mode : str
1767
- How the sensor operates. Options are: { poke | reschedule }. (Default: "poke")
1768
- exponential_backoff : bool
1769
- allow progressive longer waits between pokes by using exponential backoff algorithm. (Default: True)
1770
- pool : str
1771
- the slot pool this task should run in,
1772
- slot pools are a way to limit concurrency for certain tasks. (Default:None)
1773
- soft_fail : bool
1774
- Set to true to mark the task as SKIPPED on failure. (Default: False)
1775
- name : str
1776
- Name of the sensor on Airflow
1777
- description : str
1778
- Description of sensor in the Airflow UI
1779
- bucket_key : Union[str, List[str]]
1780
- The key(s) being waited on. Supports full s3:// style url or relative path from root level.
1781
- When it's specified as a full s3:// url, please leave `bucket_name` as None
1782
- bucket_name : str
1783
- Name of the S3 bucket. Only needed when bucket_key is not provided as a full s3:// url.
1784
- When specified, all the keys passed to bucket_key refers to this bucket. (Default:None)
1785
- wildcard_match : bool
1786
- whether the bucket_key should be interpreted as a Unix wildcard pattern. (Default: False)
1787
- aws_conn_id : str
1788
- a reference to the s3 connection on Airflow. (Default: None)
1789
- verify : bool
1790
- Whether or not to verify SSL certificates for S3 connection. (Default: None)
1791
- """
1792
- ...
1793
-
1794
- @typing.overload
1795
- def pypi_base(*, packages: typing.Dict[str, str] = {}, python: typing.Optional[str] = None) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
1796
- """
1797
- Specifies the PyPI packages for all steps of the flow.
1798
+ A project-specific namespace is created for all flows that
1799
+ use the same `@project(name)`.
1798
1800
 
1799
- Use `@pypi_base` to set common packages required by all
1800
- steps and use `@pypi` to specify step-specific overrides.
1801
1801
 
1802
1802
  Parameters
1803
1803
  ----------
1804
- packages : Dict[str, str], default: {}
1805
- Packages to use for this flow. The key is the name of the package
1806
- and the value is the version to use.
1807
- python : str, optional, default: None
1808
- Version of Python to use, e.g. '3.7.4'. A default value of None implies
1809
- that the version used will correspond to the version of the Python interpreter used to start the run.
1810
- """
1811
- ...
1812
-
1813
- @typing.overload
1814
- def pypi_base(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
1815
- ...
1816
-
1817
- def pypi_base(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *, packages: typing.Dict[str, str] = {}, python: typing.Optional[str] = None):
1818
- """
1819
- Specifies the PyPI packages for all steps of the flow.
1804
+ name : str
1805
+ Project name. Make sure that the name is unique amongst all
1806
+ projects that use the same production scheduler. The name may
1807
+ contain only lowercase alphanumeric characters and underscores.
1820
1808
 
1821
- Use `@pypi_base` to set common packages required by all
1822
- steps and use `@pypi` to specify step-specific overrides.
1809
+ branch : Optional[str], default None
1810
+ The branch to use. If not specified, the branch is set to
1811
+ `user.<username>` unless `production` is set to `True`. This can
1812
+ also be set on the command line using `--branch` as a top-level option.
1813
+ It is an error to specify `branch` in the decorator and on the command line.
1823
1814
 
1824
- Parameters
1825
- ----------
1826
- packages : Dict[str, str], default: {}
1827
- Packages to use for this flow. The key is the name of the package
1828
- and the value is the version to use.
1829
- python : str, optional, default: None
1830
- Version of Python to use, e.g. '3.7.4'. A default value of None implies
1831
- that the version used will correspond to the version of the Python interpreter used to start the run.
1815
+ production : bool, default False
1816
+ Whether or not the branch is the production branch. This can also be set on the
1817
+ command line using `--production` as a top-level option. It is an error to specify
1818
+ `production` in the decorator and on the command line.
1819
+ The project branch name will be:
1820
+ - if `branch` is specified:
1821
+ - if `production` is True: `prod.<branch>`
1822
+ - if `production` is False: `test.<branch>`
1823
+ - if `branch` is not specified:
1824
+ - if `production` is True: `prod`
1825
+ - if `production` is False: `user.<username>`
1832
1826
  """
1833
1827
  ...
1834
1828