def eject_model(self, model_name: str, device: str) -> dict:
        """
        Ejects a specified model from the given device on the remote inference service.

        Args:
            model_name (str): The name of the model to eject.
            device (str): The device from which to eject the model.

        Returns:
            dict: A dictionary containing the result of the ejection.

        Raises:
            ModelError: If an error occurs while ejecting the model.
            Exception: For any other exceptions.
        """
        params = {
            "model_name": model_name,
            "model_device": device
        }
        try:
            response = self.client.delete("/models", params=params)
            response.raise_for_status()
            return response.json()
        except httpx.HTTPStatusError as http_err:
            if http_err.response.status_code == 400:
                error_detail = http_err.response.json().get('detail', 'Bad Request')
                raise ModelError(
                    f"Failed to eject model '{model_name}' from device '{device}': {error_detail}") from http_err
            else:
                # Re-raise the original HTTPStatusError for other status codes
                raise

        Ejects a specified model from the given device on the remote inference service.

        Args:
            model_name (str): The name of the model to eject.
            device (str): The device from which to eject the model.

        Returns:
            dict: A dictionary containing the result of the ejection.

        Raises:
            ModelError: If an error occurs while ejecting the model.
            Exception: For any other exceptions.
        
src/marqo/inference/native_inference/remote/client/model_manager_client.py