relevant model server

properties for the user."""@abstractmethod

def perform_stop_model(

self,

service: BaseService,

timeout: int = DEFAULT_DEPLOYMENT_START_STOP_TIMEOUT,

force: bool = False,

) -> BaseService:

"""Abstract method to stop a model server."""

@abstractmethod

def perform_start_model(

self,

service: BaseService,

timeout: int = DEFAULT_DEPLOYMENT_START_STOP_TIMEOUT,

) -> BaseService:

"""Abstract method to start a model server."""

@abstractmethod

def perform_delete_model(

self,

service: BaseService,

timeout: int = DEFAULT_DEPLOYMENT_START_STOP_TIMEOUT,

force: bool = False,

) -> None:

"""Abstract method to delete a model server."""

class BaseModelDeployerFlavor(Flavor):

"""Base class for model deployer flavors."""

@property

@abstractmethod

def name(self):

"""Returns the name of the flavor."""

@property

def type(self) -> StackComponentType:

"""Returns the flavor type.

Returns:

The flavor type.

"""

return StackComponentType.MODEL_DEPLOYER

@property

def config_class(self) -> Type[BaseModelDeployerConfig]:

"""Returns `BaseModelDeployerConfig` config class.

Returns:

The config class.

"""

return BaseModelDeployerConfig

@property

@abstractmethod

def implementation_class(self) -> Type[BaseModelDeployer]:

"""The class that implements the model deployer."""

This is a slimmed-down version of the base implementation which aims to highlight the abstraction layer. In order to see the full implementation and get the complete docstrings, please check the SDK docs .

Building your own model deployers

If you want to create your own custom flavor for a model deployer, you can follow the following steps:

Create a class that inherits from the BaseModelDeployer class and implements the abstract methods.

If you need to provide any configuration, create a class that inherits from the BaseModelDeployerConfig class and add your configuration parameters.