caikit.runtime.client.remote_model_finder ========================================= .. py:module:: caikit.runtime.client.remote_model_finder .. autoapi-nested-parse:: The RemoteModelFinder locates models that are loaded in a remote runtime. Configuration for RemoteModelFinder lives under the config as follows: model_management: finders: : type: REMOTE config: connection: ConnectionInfo model_key: Optional[str]=MODEL_MESH_MODEL_ID_KEY protocol: Optional[str]="grpc" min_poll_time: Optional[int]=30 discover_models: Optional[bool]=True supported_models: Optional[Dict[str, str]]={} : Attributes ---------- .. autoapisummary:: caikit.runtime.client.remote_model_finder.log caikit.runtime.client.remote_model_finder.error Classes ------- .. autoapisummary:: caikit.runtime.client.remote_model_finder.ModuleConnectionInfo caikit.runtime.client.remote_model_finder.RemoteModelFinder Module Contents --------------- .. py:data:: log .. py:data:: error .. py:class:: ModuleConnectionInfo .. py:attribute:: conn :type: caikit.interfaces.common.data_model.remote.ConnectionInfo .. py:attribute:: module_id :type: str .. py:class:: RemoteModelFinder(config: aconfig.Config, instance_name: str) Bases: :py:obj:`caikit.core.model_management.model_finder_base.ModelFinderBase` A class can be constructed by a factory if its constructor takes exactly one argument that is an aconfig.Config object and it has a name to identify itself with the factory. .. py:attribute:: __doc__ :value: Multiline-String .. raw:: html
Show Value .. code-block:: python """ The RemoteModelFinder locates models that are loaded in a remote runtime. Configuration for RemoteModelFinder lives under the config as follows: model_management: finders: : type: REMOTE config: connection: ConnectionInfo model_key: Optional[str]=MODEL_MESH_MODEL_ID_KEY protocol: Optional[str]="grpc" min_poll_time: Optional[int]=30 discover_models: Optional[bool]=True supported_models: Optional[Dict[str, str]]={} : """ .. raw:: html
.. py:attribute:: name :value: 'REMOTE' This is the name of this constructible type that will be used by the factory to identify this class .. py:attribute:: _instance_name .. py:attribute:: _connections :type: Dict[str, caikit.interfaces.common.data_model.remote.ConnectionInfo] .. py:attribute:: _connection_template :type: Optional[caikit.interfaces.common.data_model.remote.ConnectionInfo] :value: None .. py:attribute:: _model_key .. py:attribute:: _protocol .. py:attribute:: _supported_models :type: Dict[str, ModuleConnectionInfo] .. py:attribute:: _discover_models .. py:attribute:: _min_poll_time .. py:method:: find_model(model_path: str, **__) -> Optional[caikit.runtime.client.remote_config.RemoteModuleConfig] Check if the remote runtime supports the model_path .. py:method:: _discover(model_name: Optional[str] = None) -> Dict[str, ModuleConnectionInfo] Helper method to discover models from a remote runtime. This is a separate function to help with subclassing Returns: model_map: Dict[str, str] The map of models to modules .. py:method:: _safe_discover(model_name: Optional[str] = None) -> Dict[str, ModuleConnectionInfo] Helper function that lazily discovers models in a thread safe manor. This function also ensures we don't overload the remote server with discovery requests Returns: Dict[str, str]: Result of discover_models .. py:method:: _discover_grpc_models(model_name: Optional[str]) -> Dict[str, ModuleConnectionInfo] Helper function to get all the supported models and modules from a remote GRPC runtime Returns: support_models: Dict[str, str Mapping of remote model names to module ids .. py:method:: _discover_http_models(model_name: Optional[str]) -> Dict[str, caikit.interfaces.common.data_model.remote.ConnectionInfo] Helper function to get all the supported models and modules from a remote HTTP runtime Returns: supported_models:Dict[str, str] Mapping of remote model names to module_ids .. py:method:: _render_conn_template(model_name: str) -> Optional[caikit.interfaces.common.data_model.remote.ConnectionInfo] Common utility to get the connection for a given model .. py:method:: _get_conn_candidates(model_name: Optional[str]) -> List[caikit.interfaces.common.data_model.remote.ConnectionInfo] Common utility to get all connections to try