@@ -13,7 +13,7 @@ async def main():
1313"""
1414
1515import shlex
16- from typing import Dict , List , Optional , Union
16+ from typing import Any , Optional , Union
1717
1818import httpx
1919
@@ -28,17 +28,19 @@ async def main():
2828from pylet .aio ._instance import Instance
2929from pylet .errors import NotFoundError , NotInitializedError
3030
31- # Re-export Instance for type hints
31+ # Re-export for public API
3232__all__ = [
33+ "Instance" ,
34+ "NotFoundError" ,
35+ "NotInitializedError" ,
36+ "WorkerInfo" ,
37+ "get" ,
3338 "init" ,
34- "shutdown " ,
39+ "instances " ,
3540 "is_initialized" ,
41+ "shutdown" ,
3642 "submit" ,
37- "get" ,
38- "instances" ,
3943 "workers" ,
40- "Instance" ,
41- "WorkerInfo" ,
4244]
4345
4446
@@ -91,18 +93,17 @@ def is_initialized() -> bool:
9193
9294
9395async def submit (
94- command : Union [str , List [str ]],
96+ command : Union [str , list [str ]],
9597 * ,
9698 name : Optional [str ] = None ,
9799 gpu : int = 0 ,
98100 cpu : int = 1 ,
99101 memory : int = 512 ,
100- # SLLM support parameters
101102 target_worker : Optional [str ] = None ,
102- gpu_indices : Optional [List [int ]] = None ,
103+ gpu_indices : Optional [list [int ]] = None ,
103104 exclusive : bool = True ,
104- labels : Optional [Dict [str , str ]] = None ,
105- env : Optional [Dict [str , str ]] = None ,
105+ labels : Optional [dict [str , str ]] = None ,
106+ env : Optional [dict [str , str ]] = None ,
106107 # Venv support
107108 venv : Optional [str ] = None ,
108109) -> Instance :
@@ -137,7 +138,7 @@ async def submit(
137138 command = shlex .join (command )
138139
139140 # Build submission request
140- submission = {
141+ submission : dict [ str , Any ] = {
141142 "command" : command ,
142143 "resource_requirements" : {
143144 "cpu_cores" : cpu ,
@@ -213,7 +214,7 @@ async def get(
213214async def instances (
214215 * ,
215216 status : Optional [str ] = None ,
216- ) -> List [Instance ]:
217+ ) -> list [Instance ]:
217218 """
218219 List all instances.
219220
@@ -239,7 +240,7 @@ async def instances(
239240 return [Instance (data ) for data in response .json ()]
240241
241242
242- async def workers () -> List [WorkerInfo ]:
243+ async def workers () -> list [WorkerInfo ]:
243244 """
244245 List all registered workers.
245246
0 commit comments