caikit.runtime.names
! NOTE ! This file should not import any extra dependencies. It is intended for use by client libraries that do not necessarily use a specific runtime server type.
Attributes
Classes
Common class for describing service types |
|
Create a collection of name/value pairs. |
Functions
|
Get the string name for the AI domain |
|
This helper will get the name of service package |
|
This helper will get the name of the service |
|
Helper function to convert from the name of a module to the name of the |
|
Helper function to get the name of a task's RPC |
Helper function to get the name of a task's start job RPC |
|
Helper function to get the name of a task's job status RPC |
|
Helper function to get the name of a task's job cancel RPC |
|
Helper function to get the name of a task's job resul RPC |
|
|
Helper function to get the request name of a Train Service |
|
Helper function to get the inner request parameter name of a Train Service |
Helper function to get the name of an RPC's request data type |
|
|
Function to get the http route for a given rpc name |
Function to get the http route for a prediction job given a rpc name |
|
Function to get the http route for a prediction job result given a rpc name |
|
|
Function to get GRPC name for a given service type and rpc name |
Module Contents
- caikit.runtime.names.LOCAL_MODEL_TYPE = 'standalone-model'
- caikit.runtime.names.DEFAULT_LOADER_NAME = 'default'
- caikit.runtime.names.DEFAULT_SIZER_NAME = 'default'
- class caikit.runtime.names.ServiceType(*args, **kwds)[source]
Bases:
enum.EnumCommon class for describing service types
- INFERENCE = 1
- TRAINING = 2
- TRAINING_MANAGEMENT = 3
- INFO = 4
- MODEL_MANAGEMENT = 5
- JOB_INFERENCE = 6
- caikit.runtime.names.get_ai_domain() str[source]
Get the string name for the AI domain
- Returns:
domain(str): The domain for this service
- caikit.runtime.names.get_service_package_name(service_type: ServiceType | None = None) str[source]
This helper will get the name of service package
- Args:
- service_type Optional[ServiceType]: The Service Type’s package name to fetch defaults
to runtime
- Returns:
str: The name of the service package
- caikit.runtime.names.get_service_name(service_type: ServiceType) str[source]
This helper will get the name of the service
- Args:
service_type ServiceType: The Service Type whose name to fetch
- Returns:
str: The name of the service
- caikit.runtime.names.get_train_rpc_name(module_class: Type[caikit.core.modules.ModuleBase]) str[source]
Helper function to convert from the name of a module to the name of the request RPC function
- caikit.runtime.names.get_task_predict_rpc_name(task_or_module_class: Type[caikit.core.modules.ModuleBase | caikit.core.task.TaskBase], input_streaming: bool = False, output_streaming: bool = False) str[source]
Helper function to get the name of a task’s RPC
- caikit.runtime.names.get_task_predict_job_rpc_name(task_or_module_class: Type[caikit.core.modules.ModuleBase | caikit.core.task.TaskBase]) str[source]
Helper function to get the name of a task’s start job RPC
- caikit.runtime.names.get_task_predict_job_status_rpc_name(task_or_module_class: Type[caikit.core.modules.ModuleBase | caikit.core.task.TaskBase]) str[source]
Helper function to get the name of a task’s job status RPC
- caikit.runtime.names.get_task_predict_job_cancel_rpc_name(task_or_module_class: Type[caikit.core.modules.ModuleBase | caikit.core.task.TaskBase]) str[source]
Helper function to get the name of a task’s job cancel RPC
- caikit.runtime.names.get_task_predict_job_result_rpc_name(task_or_module_class: Type[caikit.core.modules.ModuleBase | caikit.core.task.TaskBase]) str[source]
Helper function to get the name of a task’s job resul RPC
- caikit.runtime.names.get_train_request_name(module_class: Type[caikit.core.modules.ModuleBase]) str[source]
Helper function to get the request name of a Train Service
- caikit.runtime.names.get_train_parameter_name(module_class: Type[caikit.core.modules.ModuleBase]) str[source]
Helper function to get the inner request parameter name of a Train Service
- caikit.runtime.names.get_task_predict_request_name(task_or_module_class: Type[caikit.core.modules.ModuleBase | caikit.core.task.TaskBase], input_streaming: bool = False, output_streaming: bool = False) str[source]
Helper function to get the name of an RPC’s request data type
- caikit.runtime.names.TRAINING_MANAGEMENT_SERVICE_NAME = 'TrainingManagement'
- caikit.runtime.names.TRAINING_MANAGEMENT_SERVICE_PACKAGE = 'caikit.runtime.training'
- caikit.runtime.names.TRAINING_MANAGEMENT_SERVICE_SPEC
- caikit.runtime.names.INFO_SERVICE_NAME = 'InfoService'
- caikit.runtime.names.INFO_SERVICE_PACKAGE = 'caikit.runtime.info'
- caikit.runtime.names.INFO_SERVICE_SPEC
- caikit.runtime.names.MODEL_MANAGEMENT_SERVICE_NAME = 'ModelManagement'
- caikit.runtime.names.MODEL_MANAGEMENT_SERVICE_PACKAGE = 'caikit.runtime.models'
- caikit.runtime.names.MODEL_MANAGEMENT_SERVICE_SPEC
- caikit.runtime.names.MODEL_MESH_MODEL_ID_KEY = 'mm-model-id'
- caikit.runtime.names.HEALTH_ENDPOINT = '/health'
- caikit.runtime.names.INFO_ENDPOINT = '/info'
- caikit.runtime.names.RUNTIME_INFO_ENDPOINT = '/info/version'
- caikit.runtime.names.MODELS_INFO_ENDPOINT = '/info/models'
- caikit.runtime.names.MANAGEMENT_ENDPOINT = '/management'
- caikit.runtime.names.MODEL_MANAGEMENT_ENDPOINT = '/management/models'
- caikit.runtime.names.TRAINING_MANAGEMENT_ENDPOINT = '/management/trainings'
- caikit.runtime.names.REQUIRED_INPUTS_KEY = 'inputs'
- caikit.runtime.names.OPTIONAL_INPUTS_KEY = 'parameters'
- caikit.runtime.names.MODEL_ID = 'model_id'
- caikit.runtime.names.EXTRA_OPENAPI_KEY = 'extra_openapi'
- caikit.runtime.names.ACK_HEADER_STRING = 'acknowledgement'
- class caikit.runtime.names.StreamEventTypes(*args, **kwds)[source]
Bases:
enum.EnumCreate a collection of name/value pairs.
Example enumeration:
>>> class Color(Enum): ... RED = 1 ... BLUE = 2 ... GREEN = 3
Access them by:
attribute access:
>>> Color.RED <Color.RED: 1>
value lookup:
>>> Color(1) <Color.RED: 1>
name lookup:
>>> Color['RED'] <Color.RED: 1>
Enumerations can be iterated over, and know how many members they have:
>>> len(Color) 3
>>> list(Color) [<Color.RED: 1>, <Color.BLUE: 2>, <Color.GREEN: 3>]
Methods can be added to enumerations, and members can have their own attributes – see the documentation for details.
- MESSAGE = 'message'
- ERROR = 'error'
- caikit.runtime.names.get_http_route_name(rpc_name: str) str[source]
Function to get the http route for a given rpc name
- Args:
rpc_name (str): The name of the Caikit RPC
- Raises:
NotImplementedError: If the RPC is not a Train or Predict RPC
- Returns:
str: The name of the http route for RPC
- caikit.runtime.names.get_http_prediction_job_route_name(rpc_name: str) str[source]
Function to get the http route for a prediction job given a rpc name
- Args:
rpc_name (str): The name of the Caikit RPC
- Raises:
NotImplementedError: If the RPC is not a Train or Predict RPC
- Returns:
str: The name of the http route for RPC
- caikit.runtime.names.get_http_prediction_job_result_route_name(rpc_name: str) str[source]
Function to get the http route for a prediction job result given a rpc name
- Args:
rpc_name (str): The name of the Caikit RPC
- Raises:
NotImplementedError: If the RPC is not a Train or Predict RPC
- Returns:
str: The name of the http route for RPC
- caikit.runtime.names.get_grpc_route_name(service_type: ServiceType, rpc_name: str) str[source]
Function to get GRPC name for a given service type and rpc name
- Args:
rpc_name (str): The name of the Caikit RPC
- Returns:
str: The name of the GRPC route for RPC
- caikit.runtime.names.STATUS_CODE_TO_HTTP
- caikit.runtime.names.HTTP_TO_STATUS_CODE
- caikit.runtime.names.CAIKIT_STATUS_CODE_TO_GRPC