1
1
# mlem.api.deploy()
2
2
3
- Deploy a model to target environment. Can use existing deployment declaration or
4
- create a new one on-the-fly.
3
+ Deploy a model to a target environment. Can use an existing deployment
4
+ declaration or create a new one on-the-fly.
5
5
6
6
``` py
7
7
def deploy (
8
- deploy_meta_or_path : Union[MlemDeploy , str ],
9
- model : Union[MlemModel, str ] = None ,
8
+ deploy_meta_or_path : Union[MlemDeployment , str ],
9
+ model : Union[MlemModel, str ],
10
10
env : Union[MlemEnv, str ] = None ,
11
11
project : Optional[str ] = None ,
12
+ rev : Optional[str ] = None ,
12
13
fs : Optional[AbstractFileSystem] = None ,
13
- external : bool = None ,
14
- index : bool = None ,
14
+ env_kwargs : Dict[str , Any] = None ,
15
15
** deploy_kwargs ,
16
- ) -> MlemDeploy
16
+ ) -> MlemDeployment
17
17
```
18
18
19
- [// ]: # '### Usage:'
20
- [// ]: #
21
- [// ]: # '```py'
22
- [// ]: # 'from mlem.api import deploy'
23
- [// ]: #
24
- [// ]: # '#TODO '
25
- [// ]: # '```'
26
-
27
19
# # Description
28
20
29
21
This API is the underlying mechanism for the
@@ -32,17 +24,18 @@ provides a programmatic way to create deployments for a target environment.
32
24
33
25
# # Parameters
34
26
35
- - ** `deploy_meta_or_path` ** (required) - Path to deployment meta (will be
36
- created if it does not exist)
37
- - `model` (optional) - Path to model
38
- - `env` (optional) - Path to target environment
39
- - `project` (optional) - Path to MLEM project
40
- - `fs` (optional) - filesystem to load deploy meta from . If not provided, will
41
- be inferred from `deploy_meta_or_path`
42
- - `external` (optional) - Save result not in mlem dir , but directly in project
43
- - `index` (optional) - Whether to index output in .mlem directory
44
- - `deploy_kwargs` (optional) - Configuration for new deployment meta if it does
45
- not exist
27
+ - ** `deploy_meta_or_path` ** (required) - MlemDeployment object or path to it.
28
+ - ** `model` ** (required) - The model to deploy.
29
+ - ** `env` ** (required) - The environment to deploy to.
30
+ - `project` (optional) - Path to mlem project where to load obj from .
31
+ - `rev` (optional) - Revision if object is stored in git repo.
32
+ - `fs` (optional) - Filesystem to use to load the object .
33
+ - `env_kwargs` (optional) - Additional kwargs to pass to the environment.
34
+ - `deploy_kwargs` (optional) - Additional kwargs to pass to the deployment.
35
+
36
+ # # Returns
37
+
38
+ `MlemDeployment` : The deployment object .
46
39
47
40
# # Exceptions
48
41
0 commit comments