tempo.serve.base module

class tempo.serve.base.BaseModel(name: str, user_func: Optional[Callable[[...], Any]] = None, load_func: Optional[Callable[[], None]] = None, local_folder: Optional[str] = None, uri: Optional[str] = None, platform: Optional[tempo.serve.metadata.ModelFramework] = None, inputs: Optional[Union[Type, List, Dict[str, Type]]] = None, outputs: Optional[Union[Type, List, Dict[str, Type]]] = None, conda_env: Optional[str] = None, protocol: Optional[tempo.serve.protocol.Protocol] = None, runtime_options: Union[tempo.serve.metadata.KubernetesRuntimeOptions, tempo.serve.metadata.DockerOptions, tempo.serve.metadata.EnterpriseRuntimeOptions] = DockerOptions(runtime='tempo.seldon.SeldonDockerRuntime', state_options=StateOptions(state_type=<StateTypes.LOCAL: 'LOCAL'>, key_prefix='', host='', port=''), insights_options=InsightsOptions(worker_endpoint='', batch_size=1, parallelism=1, retries=3, window_time=0, mode_type=<InsightRequestModes.NONE: 'NONE'>, in_asyncio=False), ingress_options=IngressOptions(ingress='tempo.ingress.istio.IstioIngress', ssl=False, verify_ssl=True)), model_spec: Optional[tempo.serve.base.ModelSpec] = None, description: str = '')

Bases: object

__getstate__() → dict

__getstate__ gets called by pickle before serialising an object to get its internal representation. We override __getstate__ to make sure that the model’s internal context is not pickled with the object.

deploy(runtime: tempo.serve.base.Runtime)
get_endpoint(runtime: tempo.serve.base.Runtime)
get_insights_mode()tempo.serve.metadata.InsightRequestModes
get_tempo()tempo.serve.base.BaseModel
classmethod load(folder: str)BaseModel
loadmethod(load_func: Callable[], None]) → Callable[], None]
predict(*args, **kwargs)
remote_with_client(model_spec: tempo.serve.base.ModelSpec, client_details: tempo.serve.metadata.ClientDetails, *args, **kwargs)
remote_with_spec(model_spec: tempo.serve.base.ModelSpec, *args, **kwargs)
request(req: Dict) → Dict
save(save_env=True) → None
serialize() → str
set_remote(val: bool)
set_runtime_options_override(runtime_options: Union[tempo.serve.metadata.KubernetesRuntimeOptions, tempo.serve.metadata.DockerOptions, tempo.serve.metadata.EnterpriseRuntimeOptions])
to_k8s_yaml(runtime: tempo.serve.base.Runtime) → str

Get k8s yaml

undeploy(runtime: tempo.serve.base.Runtime)
wait_ready(runtime: tempo.serve.base.Runtime, timeout_secs=None)
class tempo.serve.base.ClientModel(model_spec: tempo.serve.base.ModelSpec, client_details: Optional[tempo.serve.metadata.ClientDetails] = None)

Bases: tempo.serve.base.BaseModel

deploy(runtime: tempo.serve.base.Runtime)
predict(*args, **kwargs)
undeploy(runtime: tempo.serve.base.Runtime)
class tempo.serve.base.Deployer(runtime_options: Optional[Union[tempo.serve.metadata.KubernetesRuntimeOptions, tempo.serve.metadata.DockerOptions, tempo.serve.metadata.EnterpriseRuntimeOptions]])

Bases: object

deploy(model: Any)
endpoint(model: Any)
manifest(model: Any)
undeploy(model: Any)
wait_ready(model: Any, timeout_secs=None)
class tempo.serve.base.ModelSpec(*, model_details: tempo.serve.metadata.ModelDetails, protocol: tempo.serve.protocol.Protocol, runtime_options: Union[tempo.serve.metadata.KubernetesRuntimeOptions, tempo.serve.metadata.DockerOptions, tempo.serve.metadata.EnterpriseRuntimeOptions])

Bases: pydantic.main.BaseModel

class Config

Bases: object

arbitrary_types_allowed = True
json_encoders = {<class 'tempo.serve.protocol.Protocol'>: <function ModelSpec.Config.<lambda>>, <class 'type'>: <function ModelSpec.Config.<lambda>>}
classmethod ensure_type(v)
model_details: tempo.serve.metadata.ModelDetails
protocol: tempo.serve.protocol.Protocol
runtime_options: Union[tempo.serve.metadata.KubernetesRuntimeOptions, tempo.serve.metadata.DockerOptions, tempo.serve.metadata.EnterpriseRuntimeOptions]
class tempo.serve.base.Runtime(runtime_options: Optional[Union[tempo.serve.metadata.KubernetesRuntimeOptions, tempo.serve.metadata.DockerOptions, tempo.serve.metadata.EnterpriseRuntimeOptions]])

Bases: abc.ABC, tempo.serve.base.Deployer

abstract deploy_spec(model_spec: tempo.serve.base.ModelSpec)
abstract get_endpoint_spec(model_spec: tempo.serve.base.ModelSpec) → str
get_headers(model_spec: tempo.serve.base.ModelSpec) → Dict[str, str]
abstract list_models() → Sequence[tempo.serve.base.ClientModel]
abstract to_k8s_yaml_spec(model_spec: tempo.serve.base.ModelSpec) → str
abstract undeploy_spec(model_spec: tempo.serve.base.ModelSpec)
abstract wait_ready_spec(model_spec: tempo.serve.base.ModelSpec, timeout_secs=None) → bool