tetra-rp 0.11.0__py3-none-any.whl → 0.13.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of tetra-rp might be problematic. Click here for more details.

Files changed (38) hide show
  1. tetra_rp/__init__.py +2 -0
  2. tetra_rp/cli/__init__.py +0 -0
  3. tetra_rp/cli/commands/__init__.py +1 -0
  4. tetra_rp/cli/commands/deploy.py +336 -0
  5. tetra_rp/cli/commands/init.py +86 -0
  6. tetra_rp/cli/commands/resource.py +191 -0
  7. tetra_rp/cli/commands/run.py +122 -0
  8. tetra_rp/cli/main.py +81 -0
  9. tetra_rp/cli/templates/advanced/main.py +58 -0
  10. tetra_rp/cli/templates/advanced/utils.py +24 -0
  11. tetra_rp/cli/templates/basic/main.py +32 -0
  12. tetra_rp/cli/templates/gpu-compute/main.py +64 -0
  13. tetra_rp/cli/templates/web-api/api.py +67 -0
  14. tetra_rp/cli/templates/web-api/main.py +42 -0
  15. tetra_rp/cli/utils/__init__.py +1 -0
  16. tetra_rp/cli/utils/deployment.py +172 -0
  17. tetra_rp/cli/utils/skeleton.py +101 -0
  18. tetra_rp/client.py +0 -6
  19. tetra_rp/config.py +29 -0
  20. tetra_rp/core/resources/__init__.py +3 -2
  21. tetra_rp/core/resources/cpu.py +115 -12
  22. tetra_rp/core/resources/gpu.py +29 -14
  23. tetra_rp/core/resources/live_serverless.py +40 -14
  24. tetra_rp/core/resources/resource_manager.py +63 -22
  25. tetra_rp/core/resources/serverless.py +27 -46
  26. tetra_rp/core/resources/serverless_cpu.py +154 -0
  27. tetra_rp/core/utils/file_lock.py +260 -0
  28. tetra_rp/core/utils/singleton.py +15 -1
  29. tetra_rp/execute_class.py +0 -3
  30. tetra_rp/protos/remote_execution.py +0 -4
  31. tetra_rp/stubs/live_serverless.py +11 -9
  32. tetra_rp/stubs/registry.py +25 -14
  33. {tetra_rp-0.11.0.dist-info → tetra_rp-0.13.0.dist-info}/METADATA +5 -1
  34. tetra_rp-0.13.0.dist-info/RECORD +56 -0
  35. tetra_rp-0.13.0.dist-info/entry_points.txt +2 -0
  36. tetra_rp-0.11.0.dist-info/RECORD +0 -36
  37. {tetra_rp-0.11.0.dist-info → tetra_rp-0.13.0.dist-info}/WHEEL +0 -0
  38. {tetra_rp-0.11.0.dist-info → tetra_rp-0.13.0.dist-info}/top_level.txt +0 -0
@@ -2,6 +2,7 @@ import logging
2
2
  from functools import singledispatch
3
3
 
4
4
  from ..core.resources import (
5
+ CpuLiveServerless,
5
6
  CpuServerlessEndpoint,
6
7
  LiveServerless,
7
8
  ServerlessEndpoint,
@@ -20,8 +21,8 @@ def stub_resource(resource, **extra):
20
21
  return fallback
21
22
 
22
23
 
23
- @stub_resource.register(LiveServerless)
24
- def _(resource, **extra):
24
+ def _create_live_serverless_stub(resource, **extra):
25
+ """Create a live serverless stub for both LiveServerless and CpuLiveServerless."""
25
26
  stub = LiveServerlessStub(resource)
26
27
 
27
28
  # Function execution
@@ -30,7 +31,6 @@ def _(resource, **extra):
30
31
  dependencies,
31
32
  system_dependencies,
32
33
  accelerate_downloads,
33
- hf_models_to_cache,
34
34
  *args,
35
35
  **kwargs,
36
36
  ) -> dict:
@@ -42,7 +42,6 @@ def _(resource, **extra):
42
42
  dependencies,
43
43
  system_dependencies,
44
44
  accelerate_downloads,
45
- hf_models_to_cache,
46
45
  *args,
47
46
  **kwargs,
48
47
  )
@@ -60,15 +59,26 @@ def _(resource, **extra):
60
59
  return stubbed_resource
61
60
 
62
61
 
62
+ @stub_resource.register(LiveServerless)
63
+ def _(resource, **extra):
64
+ return _create_live_serverless_stub(resource, **extra)
65
+
66
+
67
+ @stub_resource.register(CpuLiveServerless)
68
+ def _(resource, **extra):
69
+ return _create_live_serverless_stub(resource, **extra)
70
+
71
+
63
72
  @stub_resource.register(ServerlessEndpoint)
64
73
  def _(resource, **extra):
65
74
  async def stubbed_resource(
66
- func, dependencies, system_dependencies, *args, **kwargs
75
+ func,
76
+ dependencies,
77
+ system_dependencies,
78
+ accelerate_downloads,
79
+ *args,
80
+ **kwargs,
67
81
  ) -> dict:
68
- if args == (None,):
69
- # cleanup: when the function is called with no args
70
- args = []
71
-
72
82
  if dependencies or system_dependencies:
73
83
  log.warning(
74
84
  "Dependencies are not supported for ServerlessEndpoint. "
@@ -86,12 +96,13 @@ def _(resource, **extra):
86
96
  @stub_resource.register(CpuServerlessEndpoint)
87
97
  def _(resource, **extra):
88
98
  async def stubbed_resource(
89
- func, dependencies, system_dependencies, *args, **kwargs
99
+ func,
100
+ dependencies,
101
+ system_dependencies,
102
+ accelerate_downloads,
103
+ *args,
104
+ **kwargs,
90
105
  ) -> dict:
91
- if args == (None,):
92
- # cleanup: when the function is called with no args
93
- args = []
94
-
95
106
  if dependencies or system_dependencies:
96
107
  log.warning(
97
108
  "Dependencies are not supported for CpuServerlessEndpoint. "
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: tetra_rp
3
- Version: 0.11.0
3
+ Version: 0.13.0
4
4
  Summary: A Python library for distributed inference and serving of machine learning models
5
5
  Author-email: Marut Pandya <pandyamarut@gmail.com>, Patrick Rachford <prachford@icloud.com>, Dean Quinanola <dean.quinanola@runpod.io>
6
6
  License: MIT
@@ -14,6 +14,9 @@ Requires-Dist: cloudpickle>=3.1.1
14
14
  Requires-Dist: runpod
15
15
  Requires-Dist: python-dotenv>=1.0.0
16
16
  Requires-Dist: pydantic>=2.0.0
17
+ Requires-Dist: rich>=14.0.0
18
+ Requires-Dist: typer>=0.12.0
19
+ Requires-Dist: questionary>=2.0.0
17
20
 
18
21
  # Tetra: Serverless computing for AI workloads
19
22
 
@@ -359,6 +362,7 @@ if __name__ == "__main__":
359
362
  ```python
360
363
  import asyncio
361
364
  from tetra_rp import remote, LiveServerless, GpuGroup, PodTemplate
365
+ import base64
362
366
 
363
367
  # Advanced GPU configuration with consolidated template overrides
364
368
  sd_config = LiveServerless(
@@ -0,0 +1,56 @@
1
+ tetra_rp/__init__.py,sha256=_D3Wbtv9tBh_WGS4Si5uQbsefL63GqqjoGTN3R8P6fA,769
2
+ tetra_rp/client.py,sha256=cJRDCzMcU7OMwvlFSV5thjOBMysRWnzHFGko-ebYHBI,3073
3
+ tetra_rp/config.py,sha256=9FYzouOam0PVoBIITpwHu1N5dGd1ueLHjWMaZYmdquI,760
4
+ tetra_rp/execute_class.py,sha256=pm-wupP_rGwlmS_3B5O2g8a5qINlVSWuGUc1E7pveUw,12075
5
+ tetra_rp/logger.py,sha256=gk5-PWp3k_GQ5DxndsRkBCX0jarp_3lgZ1oiTFuThQg,1125
6
+ tetra_rp/cli/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
7
+ tetra_rp/cli/main.py,sha256=89rSSHWG9fxXFmCR0QzRIQUd9N_nvlEy3ImzQdGs8jw,2090
8
+ tetra_rp/cli/commands/__init__.py,sha256=gQ6tnU0Rvm0-ESWFUBU-KDl5dpNOpUTG509hXOQQjwY,27
9
+ tetra_rp/cli/commands/deploy.py,sha256=dznG7NI04ihfccn5YIjBbIxMRM19h-B60jTTWazGppc,10609
10
+ tetra_rp/cli/commands/init.py,sha256=smRqSrxSzW_Rh-HBOLDdxOw-SDVC6uNOWTJAjF078c4,3020
11
+ tetra_rp/cli/commands/resource.py,sha256=XMsSAYaCtw42tUz7vJsK53lZRrKX51fMMfQv8sdExlc,5679
12
+ tetra_rp/cli/commands/run.py,sha256=XHbsTqzgz48qA_I1rc9MiZAh2H2OKRMNr6JPOGVaoXI,3781
13
+ tetra_rp/cli/templates/advanced/main.py,sha256=gfPETln1Re0R7Ysd8WlMon1myFmCtpJk6k6a1AGnK0Q,1221
14
+ tetra_rp/cli/templates/advanced/utils.py,sha256=8BfZW2_qXS7bYyiO62KhEib_TqUfIxer2jqXoIctK1c,647
15
+ tetra_rp/cli/templates/basic/main.py,sha256=fItaje-ahvQKsvVcA_HNVCy0grw9fLb1kd07eU5jvAQ,677
16
+ tetra_rp/cli/templates/gpu-compute/main.py,sha256=x-8W2ciT_bnLACcdKrMPwX4HqkLCeX-RKC1E6IzXnAI,1602
17
+ tetra_rp/cli/templates/web-api/api.py,sha256=7ucd6Mg9Y3aVNuG21Jh_ToiBWe0R3NaYIN-dExaRN_U,2009
18
+ tetra_rp/cli/templates/web-api/main.py,sha256=lRu0CVbPuCfvVQrp5IQf4KlR1dpC70fd7J008GXmtvs,846
19
+ tetra_rp/cli/utils/__init__.py,sha256=Ytcdqe_Kzy37LSnsBj1Drkrx0Uo7TWExjQZ2mwW_nMg,27
20
+ tetra_rp/cli/utils/deployment.py,sha256=2hskoGEnZYTJMR2on37X4kaQEtBDCKoWK_7RQr1VEY0,5123
21
+ tetra_rp/cli/utils/skeleton.py,sha256=zOo1sudIPA8sJa3tToV-XpkJMdsMtYzYAqSv-QH9nq4,3184
22
+ tetra_rp/core/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
23
+ tetra_rp/core/api/__init__.py,sha256=oldrEKMwxYoBPLvPfVlaFS3wfUtTTxCN6-HzlpTh6vE,124
24
+ tetra_rp/core/api/runpod.py,sha256=3TTx1fkXMLZ2R5JCrQYPEn8dhdUsBt8i5OEwAfaKQ_k,10451
25
+ tetra_rp/core/resources/__init__.py,sha256=ZvSfceYV4S1Xo3YA03B-sR5VRud8BKfx5Pe44xFfruo,911
26
+ tetra_rp/core/resources/base.py,sha256=UJeDiFN45aO1n5SBcxn56ohLhj-AWHoj0KO7mF4yJ_o,1440
27
+ tetra_rp/core/resources/cloud.py,sha256=XJOWPfzYlDVJGHxgffcfpEaOKrWhGdi7AzTlaGuYj0o,70
28
+ tetra_rp/core/resources/constants.py,sha256=F1gPqFaXcCmfrbUSO9PQtUBv984TxFc3pySgVy-kXk8,158
29
+ tetra_rp/core/resources/cpu.py,sha256=szhkjaJ9OnjzLvaD7Yc2hRCR-C9eyB6tswo1Qe6VuZ0,3962
30
+ tetra_rp/core/resources/environment.py,sha256=FC9kJCa8YLSar75AKUKqJYnNLrUdjZj8ZTOrspBrS00,1267
31
+ tetra_rp/core/resources/gpu.py,sha256=mMOPLhBugFBAMAl3ezhjAxKuvYya5_9A_h7kvaCoAfk,1885
32
+ tetra_rp/core/resources/live_serverless.py,sha256=FLmaQdn5UMczEfkP3qykIfRVfZeyYdvyNHX9Nd13_54,1868
33
+ tetra_rp/core/resources/network_volume.py,sha256=h_1xhrbBm9jJWROOGl5qy9u4_kCKSyV4idzt0567-J8,5193
34
+ tetra_rp/core/resources/resource_manager.py,sha256=K-SgCk2BMNEAnkB87YynxUH-suZcdcOPLMonL7EogIw,4988
35
+ tetra_rp/core/resources/serverless.py,sha256=1T21RkMjGnM1I87AsGQ6qazp7A9cE7LwH_c6yJ5shPQ,13427
36
+ tetra_rp/core/resources/serverless_cpu.py,sha256=OiG1C_5_j7pYPHdGp3lQQanIl2ak81u8-jlZo2OXflA,5567
37
+ tetra_rp/core/resources/template.py,sha256=qQ8Wd7Rzr1_YeAbW1V7_k7AVHzgWR_RPjcaRfKsetAk,3141
38
+ tetra_rp/core/resources/utils.py,sha256=mgXfgz_NuHN_IC7TzMNdH9II-LMjxcDCG7syDTcPiGs,1721
39
+ tetra_rp/core/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
40
+ tetra_rp/core/utils/backoff.py,sha256=1pfa0smFNpib8nztcIgBbtrVvQeECKh-aNOfL2TztgU,1324
41
+ tetra_rp/core/utils/constants.py,sha256=Dm4XiO5zTzfdqOSeYVfAjaf2LyHnIEVmbOi_s_k1J_E,375
42
+ tetra_rp/core/utils/file_lock.py,sha256=bxtAexD2rbqMhdr94VbmKdNp0gfKRgxDXx1n7LX4Eso,8269
43
+ tetra_rp/core/utils/json.py,sha256=q0r7aEdfh8kKVeHGeh9fBDfuhHYNopSreislAMB6HhM,1163
44
+ tetra_rp/core/utils/lru_cache.py,sha256=drwKg-DfLbeBRGTzuxKqNKMQq0EuZV15LMTZIOyZuVk,2618
45
+ tetra_rp/core/utils/singleton.py,sha256=lSXgEQGX9nzhrc05GMpThn9SHKG45iajBbSEtwCcNyI,632
46
+ tetra_rp/protos/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
47
+ tetra_rp/protos/remote_execution.py,sha256=InVGKgkShi-muoNjGz-l7-cBwOZzaTnBdFr6LhVE9JE,5482
48
+ tetra_rp/stubs/__init__.py,sha256=ozKsHs8q0T7o2qhQEquub9hqomh1Htys53mMraaRu2E,72
49
+ tetra_rp/stubs/live_serverless.py,sha256=gIjhizgX5MDifxXo5JBONS3fmGipwRAgv9_sydc_cxU,4451
50
+ tetra_rp/stubs/registry.py,sha256=OdqAHFJIhPBAaR-S_spJNgRwpO96xEqhfAENhomqmI4,3235
51
+ tetra_rp/stubs/serverless.py,sha256=BM_a5Ml5VADBYu2WRNmo9qnicP8NnXDGl5ywifulbD0,947
52
+ tetra_rp-0.13.0.dist-info/METADATA,sha256=9IiJ4LYhMcTUkf2Qgp2U_rh8y8XdAK0WDGe8tWSFXpE,28182
53
+ tetra_rp-0.13.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
54
+ tetra_rp-0.13.0.dist-info/entry_points.txt,sha256=FJi3ytBLKCcyz4tXJhOM3XNKzTxpnl3AauiPH2lHvWY,48
55
+ tetra_rp-0.13.0.dist-info/top_level.txt,sha256=bBay7JTDwJXsTYvVjrwno9hnF-j0q272lk65f2AcPjU,9
56
+ tetra_rp-0.13.0.dist-info/RECORD,,
@@ -0,0 +1,2 @@
1
+ [console_scripts]
2
+ flash = tetra_rp.cli.main:app
@@ -1,36 +0,0 @@
1
- tetra_rp/__init__.py,sha256=1ZWWK0rHCpkvxN4hYSFv1xJ6pwJxDJHqsKTBdr0Lxa4,721
2
- tetra_rp/client.py,sha256=urSVh0j9didd9U8lboPv3TtFYURp2XO6ReOICr9Xrls,3414
3
- tetra_rp/execute_class.py,sha256=jYNFalqqjKvvCz1zzodRvOkrLQd2FYnLYa4EElEYp8w,12243
4
- tetra_rp/logger.py,sha256=gk5-PWp3k_GQ5DxndsRkBCX0jarp_3lgZ1oiTFuThQg,1125
5
- tetra_rp/core/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
6
- tetra_rp/core/api/__init__.py,sha256=oldrEKMwxYoBPLvPfVlaFS3wfUtTTxCN6-HzlpTh6vE,124
7
- tetra_rp/core/api/runpod.py,sha256=3TTx1fkXMLZ2R5JCrQYPEn8dhdUsBt8i5OEwAfaKQ_k,10451
8
- tetra_rp/core/resources/__init__.py,sha256=b9Odwyc9BzINinDajKWX-WV-fR6mPrg6bF4evMTZpWU,844
9
- tetra_rp/core/resources/base.py,sha256=UJeDiFN45aO1n5SBcxn56ohLhj-AWHoj0KO7mF4yJ_o,1440
10
- tetra_rp/core/resources/cloud.py,sha256=XJOWPfzYlDVJGHxgffcfpEaOKrWhGdi7AzTlaGuYj0o,70
11
- tetra_rp/core/resources/constants.py,sha256=F1gPqFaXcCmfrbUSO9PQtUBv984TxFc3pySgVy-kXk8,158
12
- tetra_rp/core/resources/cpu.py,sha256=YIE-tKolSU3JJzpPB7ey-PbRdqKWsJZ_Ad4h2OYaaiA,1231
13
- tetra_rp/core/resources/environment.py,sha256=FC9kJCa8YLSar75AKUKqJYnNLrUdjZj8ZTOrspBrS00,1267
14
- tetra_rp/core/resources/gpu.py,sha256=2jIIMr8PNnlIAP8ZTKO8Imx-rdxXp2rbdSHJeVfjawk,1858
15
- tetra_rp/core/resources/live_serverless.py,sha256=A3JRdCYwHR2KN_OlmTLcv-m_ObxNhBhc5CnUzXOpOtc,1177
16
- tetra_rp/core/resources/network_volume.py,sha256=h_1xhrbBm9jJWROOGl5qy9u4_kCKSyV4idzt0567-J8,5193
17
- tetra_rp/core/resources/resource_manager.py,sha256=kUVZDblfUzaG78S8FwOzu4rN6QSegUgQNK3fJ_X7l0w,2834
18
- tetra_rp/core/resources/serverless.py,sha256=OxJb5ojx6GidA6nFvVav52PkzRFDC1CetdMYSyfZG2s,14102
19
- tetra_rp/core/resources/template.py,sha256=qQ8Wd7Rzr1_YeAbW1V7_k7AVHzgWR_RPjcaRfKsetAk,3141
20
- tetra_rp/core/resources/utils.py,sha256=mgXfgz_NuHN_IC7TzMNdH9II-LMjxcDCG7syDTcPiGs,1721
21
- tetra_rp/core/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
22
- tetra_rp/core/utils/backoff.py,sha256=1pfa0smFNpib8nztcIgBbtrVvQeECKh-aNOfL2TztgU,1324
23
- tetra_rp/core/utils/constants.py,sha256=Dm4XiO5zTzfdqOSeYVfAjaf2LyHnIEVmbOi_s_k1J_E,375
24
- tetra_rp/core/utils/json.py,sha256=q0r7aEdfh8kKVeHGeh9fBDfuhHYNopSreislAMB6HhM,1163
25
- tetra_rp/core/utils/lru_cache.py,sha256=drwKg-DfLbeBRGTzuxKqNKMQq0EuZV15LMTZIOyZuVk,2618
26
- tetra_rp/core/utils/singleton.py,sha256=JRli0HhBfq4P9mBUOg1TZUUwMvIenRqWdymX3qFMm2k,210
27
- tetra_rp/protos/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
28
- tetra_rp/protos/remote_execution.py,sha256=flKJG0U4ked84cXyF4Gfs_7fBgLsEVOzBv8ZWB9UlP0,5648
29
- tetra_rp/stubs/__init__.py,sha256=ozKsHs8q0T7o2qhQEquub9hqomh1Htys53mMraaRu2E,72
30
- tetra_rp/stubs/live_serverless.py,sha256=IjocUFkbtvbfXIXWjvxnc0Qk-rMCbwpnuERv6TpmAq0,4424
31
- tetra_rp/stubs/registry.py,sha256=HcEoedZS-okQ2P9E4LoqK3cE2U9ozvHvf4R6ppHNGog,3045
32
- tetra_rp/stubs/serverless.py,sha256=BM_a5Ml5VADBYu2WRNmo9qnicP8NnXDGl5ywifulbD0,947
33
- tetra_rp-0.11.0.dist-info/METADATA,sha256=J2uAyIH81jei8H_QSkBaff-uivccdtsugDtxSqT_L80,28077
34
- tetra_rp-0.11.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
35
- tetra_rp-0.11.0.dist-info/top_level.txt,sha256=bBay7JTDwJXsTYvVjrwno9hnF-j0q272lk65f2AcPjU,9
36
- tetra_rp-0.11.0.dist-info/RECORD,,