caikit.core.module_backends =========================== .. py:module:: caikit.core.module_backends Submodules ---------- .. toctree:: :maxdepth: 1 /autoapi/caikit/core/module_backends/backend_types/index /autoapi/caikit/core/module_backends/base/index /autoapi/caikit/core/module_backends/local_backend/index Classes ------- .. autoapisummary:: caikit.core.module_backends.BackendBase caikit.core.module_backends.LocalBackend Package Contents ---------------- .. py:class:: BackendBase(config: Optional[aconfig.Config] = None) Bases: :py:obj:`abc.ABC` Interface for creating configuration setup for backends .. py:attribute:: config .. py:attribute:: _started :value: False .. py:attribute:: _start_lock .. py:property:: backend_type :classmethod: :abstractmethod: Property storing type of the backend .. py:property:: is_started .. py:method:: register_config(config) :abstractmethod: Function to allow dynamic merging of configs. This can be useful, if there are explicit configurations particular implementations (modules) need to register before the starting the backend. .. py:method:: start() :abstractmethod: Function to start a distributed backend. This function should set self._started variable to True .. py:method:: stop() :abstractmethod: Function to stop a distributed backend. This function should set self._started variable to False .. py:method:: start_lock() .. py:method:: handle_runtime_context(model_id: str, runtime_context: caikit.core.data_model.runtime_context.RuntimeServerContextType) Update backend state for the given model based on a runtime request. Some backends may need to handle runtime context information for the target model in order to correctly configure the backend before finding and loading the model. By default, this is a No-Op. Args: model_id (str): The unique ID of the model that is referenced by the runtime context runtime_context (RuntimeServerContextType): The context for the given runtime request .. py:class:: LocalBackend(config: Optional[aconfig.Config] = None) Bases: :py:obj:`caikit.core.module_backends.base.BackendBase` Interface for creating configuration setup for backends .. py:attribute:: backend_type :value: 'LOCAL' Property storing type of the backend .. py:method:: register_config(config) -> None Function to merge configs with existing configurations .. py:method:: start() Start local backend. This is a no-op function .. py:method:: stop() Stop local backend. This is a no-op