š DataChain Open-Source Release. Star us on !
Deploy a model to a target environment. Can use an existing deployment declaration or create a new one on-the-fly.
def deploy(
deploy_meta_or_path: Union[MlemDeployment, str],
model: Union[MlemModel, str],
env: Union[MlemEnv, str] = None,
project: Optional[str] = None,
rev: Optional[str] = None,
fs: Optional[AbstractFileSystem] = None,
env_kwargs: Dict[str, Any] = None,
**deploy_kwargs,
) -> MlemDeployment
This API is the underlying mechanism for the mlem deployment run command and provides a programmatic way to create deployments for a target environment.
deploy_meta_or_path
(required) - MlemDeployment object or path to it.model
(required) - The model to deploy.env
(required) - The environment to deploy to.project
(optional) - Path to mlem project where to load obj from.rev
(optional) - Revision if object is stored in git repo.fs
(optional) - Filesystem to use to load the object.env_kwargs
(optional) - Additional kwargs to pass to the environment.deploy_kwargs
(optional) - Additional kwargs to pass to the deployment.MlemDeployment
: The deployment object.
MlemObjectNotFound
- Thrown if we can't find MLEM objectValueError
- Please provide model and env args for new deployment