tempo package

class tempo.Model(name: str, protocol: tempo.serve.protocol.Protocol = KFServingV2Protocol(), local_folder: str = None, uri: str = None, platform: tempo.serve.metadata.ModelFramework = None, inputs: Optional[Union[Type, List, Dict[str, Type]]] = None, outputs: Optional[Union[Type, List, Dict[str, Type]]] = None, model_func: Callable[[...], Any] = None, conda_env: str = None, runtime_options: tempo.serve.metadata.RuntimeOptions = RuntimeOptions(runtime='tempo.seldon.SeldonDockerRuntime', docker_options=DockerOptions(runtime='tempo.seldon.SeldonDockerRuntime'), k8s_options=KubernetesOptions(runtime='tempo.seldon.SeldonKubernetesRuntime', replicas=1, minReplicas=None, maxReplicas=None, authSecretName=None, serviceAccountName=None, namespace='default'), ingress_options=IngressOptions(ingress='tempo.ingress.istio.IstioIngress', ssl=False, verify_ssl=True), insights_options=InsightsOptions(worker_endpoint='', batch_size=1, parallelism=1, retries=3, window_time=0, mode_type=<InsightRequestModes.NONE: 'NONE'>, in_asyncio=False)), description: str = '')

Bases: tempo.serve.base.BaseModel

__init__(name: str, protocol: tempo.serve.protocol.Protocol = KFServingV2Protocol(), local_folder: str = None, uri: str = None, platform: tempo.serve.metadata.ModelFramework = None, inputs: Optional[Union[Type, List, Dict[str, Type]]] = None, outputs: Optional[Union[Type, List, Dict[str, Type]]] = None, model_func: Callable[[...], Any] = None, conda_env: str = None, runtime_options: tempo.serve.metadata.RuntimeOptions = RuntimeOptions(runtime='tempo.seldon.SeldonDockerRuntime', docker_options=DockerOptions(runtime='tempo.seldon.SeldonDockerRuntime'), k8s_options=KubernetesOptions(runtime='tempo.seldon.SeldonKubernetesRuntime', replicas=1, minReplicas=None, maxReplicas=None, authSecretName=None, serviceAccountName=None, namespace='default'), ingress_options=IngressOptions(ingress='tempo.ingress.istio.IstioIngress', ssl=False, verify_ssl=True), insights_options=InsightsOptions(worker_endpoint='', batch_size=1, parallelism=1, retries=3, window_time=0, mode_type=<InsightRequestModes.NONE: 'NONE'>, in_asyncio=False)), description: str = '')
Parameters
  • name – Name of the pipeline. Needs to be Kubernetes compliant.

  • protocoltempo.serve.protocol.Protocol. Defaults to KFserving V2.

  • local_folder – Location of local artifacts.

  • uri – Location of remote artifacts.

  • platform – The tempo.serve.metadata.ModelFramework

  • inputs – The input types.

  • outputs – The output types.

  • conda_env – The conda environment name to use. If not specified will look for conda.yaml in local_folder or generate from current running environment.

  • runtime_options – The runtime options. Can be left empty and set when creating a runtime.

  • description – The description of the model

class tempo.ModelFramework(value)

Bases: enum.Enum

An enumeration.

Alibi = 'alibi'
Custom = 'custom'
MLFlow = 'mlflow'
ONNX = 'ONNX'
PyTorch = 'pytorch'
SKLearn = 'sklearn'
TempoPipeline = 'tempo'
TensorRT = 'tensorrt'
Tensorflow = 'tensorflow'
XGBoost = 'xgboost'
class tempo.Pipeline(name: str, pipeline_func: Callable[[Any], Any] = None, protocol: Optional[tempo.serve.protocol.Protocol] = None, models: tempo.serve.pipeline.PipelineModels = None, local_folder: str = None, uri: str = None, inputs: Optional[Union[Type, List, Dict[str, Type]]] = None, outputs: Optional[Union[Type, List, Dict[str, Type]]] = None, conda_env: str = None, runtime_options: tempo.serve.metadata.RuntimeOptions = RuntimeOptions(runtime='tempo.seldon.SeldonDockerRuntime', docker_options=DockerOptions(runtime='tempo.seldon.SeldonDockerRuntime'), k8s_options=KubernetesOptions(runtime='tempo.seldon.SeldonKubernetesRuntime', replicas=1, minReplicas=None, maxReplicas=None, authSecretName=None, serviceAccountName=None, namespace='default'), ingress_options=IngressOptions(ingress='tempo.ingress.istio.IstioIngress', ssl=False, verify_ssl=True), insights_options=InsightsOptions(worker_endpoint='', batch_size=1, parallelism=1, retries=3, window_time=0, mode_type=<InsightRequestModes.NONE: 'NONE'>, in_asyncio=False)), description: str = '')

Bases: tempo.serve.base.BaseModel

deploy(runtime: tempo.serve.base.Runtime)
deploy_models(runtime: tempo.serve.base.Runtime)
save(save_env=True)
set_remote(val: bool)
set_runtime_options_override(runtime_options: tempo.serve.metadata.RuntimeOptions)
to_k8s_yaml(runtime: tempo.serve.base.Runtime) → str

Get k8s yaml

undeploy(runtime: tempo.serve.base.Runtime)

Undeploy all models and pipeline.

undeploy_models(runtime: tempo.serve.base.Runtime)
wait_ready(runtime: tempo.serve.base.Runtime, timeout_secs: int = None) → bool
class tempo.PipelineModels

Bases: types.SimpleNamespace

ModelExportKlass

alias of tempo.serve.model.Model

items()
keys()
remote_copy()
values()
tempo.deploy(model: Any, options: tempo.serve.metadata.RuntimeOptions = None)tempo.serve.deploy.RemoteModel
tempo.model(name: str, local_folder: str = None, uri: str = None, platform: tempo.serve.metadata.ModelFramework = <ModelFramework.Custom: 'custom'>, inputs: Optional[Union[Type, List, Dict[str, Type]]] = None, outputs: Optional[Union[Type, List, Dict[str, Type]]] = None, conda_env: str = None, protocol: tempo.serve.protocol.Protocol = KFServingV2Protocol(), runtime_options: tempo.serve.metadata.RuntimeOptions = RuntimeOptions(runtime='tempo.seldon.SeldonDockerRuntime', docker_options=DockerOptions(runtime='tempo.seldon.SeldonDockerRuntime'), k8s_options=KubernetesOptions(runtime='tempo.seldon.SeldonKubernetesRuntime', replicas=1, minReplicas=None, maxReplicas=None, authSecretName=None, serviceAccountName=None, namespace='default'), ingress_options=IngressOptions(ingress='tempo.ingress.istio.IstioIngress', ssl=False, verify_ssl=True), insights_options=InsightsOptions(worker_endpoint='', batch_size=1, parallelism=1, retries=3, window_time=0, mode_type=<InsightRequestModes.NONE: 'NONE'>, in_asyncio=False)), description: str = '')
Parameters
  • name – Name of the model. Needs to be Kubernetes compliant.

  • protocoltempo.serve.protocol.Protocol. Defaults to KFserving V2.

  • local_folder – Location of local artifacts.

  • uri – Location of remote artifacts.

  • inputs – The input types.

  • outputs – The output types.

  • conda_env – The conda environment name to use. If not specified will look for conda.yaml in local_folder or generate from current running environment.

  • runtime_options – The runtime options. Can be left empty and set when creating a runtime.

  • platform – The tempo.serve.metadata.ModelFramework

  • description – Description of the model

Returns

A decorated function or class as a Tempo Model.

tempo.pipeline(name: str, protocol: tempo.serve.protocol.Protocol = KFServingV2Protocol(), local_folder: str = None, uri: str = None, models: tempo.serve.pipeline.PipelineModels = None, inputs: Optional[Union[Type, List, Dict[str, Type]]] = None, outputs: Optional[Union[Type, List, Dict[str, Type]]] = None, conda_env: str = None, runtime_options: tempo.serve.metadata.RuntimeOptions = RuntimeOptions(runtime='tempo.seldon.SeldonDockerRuntime', docker_options=DockerOptions(runtime='tempo.seldon.SeldonDockerRuntime'), k8s_options=KubernetesOptions(runtime='tempo.seldon.SeldonKubernetesRuntime', replicas=1, minReplicas=None, maxReplicas=None, authSecretName=None, serviceAccountName=None, namespace='default'), ingress_options=IngressOptions(ingress='tempo.ingress.istio.IstioIngress', ssl=False, verify_ssl=True), insights_options=InsightsOptions(worker_endpoint='', batch_size=1, parallelism=1, retries=3, window_time=0, mode_type=<InsightRequestModes.NONE: 'NONE'>, in_asyncio=False)), description: str = '')

A decorator for a class or function to make it a Tempo Pipeline.

Parameters
  • name – Name of the pipeline. Needs to be Kubernetes compliant.

  • protocoltempo.serve.protocol.Protocol. Defaults to KFserving V2.

  • local_folder – Location of local artifacts.

  • uri – Location of remote artifacts.

  • models – A list of models defined as PipelineModels.

  • inputs – The input types.

  • outputs – The output types.

  • conda_env – The conda environment name to use. If not specified will look for conda.yaml in local_folder or generate from current running environment.

  • runtime_options – The runtime options. Can be left empty and set when creating a runtime.

  • description – Description of the pipeline

Returns

A decorated class or function.

tempo.predictmethod(f)
tempo.save(tempo_artifact: Any, save_env=True)
tempo.upload(tempo_artifact: Any)

Upload local to remote using rclone

Subpackages

Submodules