Inference store APIs

Operations for managing and accessing inference mapping, inference trackings, and performance metrics. This data is maintained in the VIANOPS inference store database.

vianops_client.api.inferencestore.inference_mapping

class InferenceMappingV1Api(config: Config | None = None)

Bases: ConfiguredBaseApiClass

create_inference_mapping(data: V1InferenceMappingModel, output_type: str = 'object') V1InferenceMappingModel

Create an inference mapping.

Parameters:

data (V1InferenceMappingModel) – The information needed to create inference mapping.

Returns:

Response from the created inference mapping.

Return type:

V1InferenceMappingModel

find_tag(all_tags, tag_name)
get_all_params(model, target_column_name, identifier_col, all_columns, continuous_columns, categorical_columns, offset_col)
get_inference_mapping(filter_query: dict | None = None, output_type: str = 'object') V1InferenceMappingModelList

Get a list of inference mappings based on filter query.

Parameters:

filter_query (dict) – Dictionary containing information for the query.

Returns:

A list of inference mappings.

Return type:

V1InferenceMappingModelList

inference_mapping_generator(model=None, model_stage='primary', model_version='1', deployment=None, target_column_name=None, identifier_col=None, all_columns=None, continuous_columns=None, categorical_columns=None, offset_col='', connection_name='Internal clickhouse DB', str_categorical_cols=[], preview=False, training_table=None, hotspots=[])
inference_mapping_url = '/v1/inference-mapping'
inference_tracking_gt_url = '/v1/inference-tracking/ground-truth'
validate_request(target_column_name, identifier_col, all_columns, continuous_columns, categorical_columns, offset_col)

vianops_client.api.inferencestore.inference_tracking

class InferenceTrackingV1Api(config: Config | None = None)

Bases: ConfiguredBaseApiClass

create(data: V1InferenceTrackingModel, format: str = 'raw', file_type: str = 'csv', cache_key: str | None = None, output_type: str = 'object') V1InferenceTrackingModel

Create inference tracking

Parameters:
  • data (V1InferenceTrackingModel) – The inference tracking data to be created.

  • format (str) – The format of the inference tracking data. Default: raw.

  • file_type (str) – The file type of the inference tracking data. Default csv.

  • cache_key (str) – The cache key for inference tracking data

Returns:

Response from adding inderence tracking

Return type:

V1InferenceTrackingModel

inference_tracking_ground_truth(data: V1AddGroundTruthModel, output_type: str = 'object') VianaiSuccessResponse | VianaiErrorResponse

Add ground truth data for inference tracking.

Parameters:

data (V1AddGroundTruthModel) – The ground truth data to be added.

Returns:

Response from adding ground truth

Return type:

Union[VianaiSuccessResponse, VianaiErrorResponse]

inference_tracking_gt_url = '/v1/inference-tracking/ground-truth'
inference_tracking_url = '/v1/inference-tracking'
search(deployment: str | None = None, model_name: str | None = None, model_version: str | None = None, starttime: float | None = None, endtime: float | None = None, startDateTime: float | None = None, endDateTime: float | None = None, verbose: bool = False, csv: bool = False, ground_truth_starttime: float | None = None, output_type: str = 'object') V1InferenceTrackingModel

Retrieve inference trackings with given params

Parameters:
  • deployment (str) – Deployment name

  • model_name (str) – Model name

  • model_version (str) – Model version

  • starttime (float) – Start time (in seconds)

  • endtime (float) – End time (in seconds)

  • startDateTime (float) – Start date and time

  • endDateTime (float) – Snd date and time

  • verbose (bool) – If True, include more details in the search results

  • csv (bool) – If True, the format is of csv type

  • ground_truth_starttime (float) – start time of ground truth data

Returns:

The search results based on the given params

Return type:

V1InferenceTrackingModelList

vianops_client.api.inferencestore.performance_metrics

class PerformanceMetricsV1Api(config: Config | None = None)

Bases: ConfiguredBaseApiClass

create(data: V1ModelPerformanceModelList, output_type: str = 'object') V1ModelPerformanceModelList

Add model performance data

Parameters:

data (V1ModelPerformanceModelList) – The list of model performance metrics to add.

Returns:

Instance containing information about the added model performance metrics.

Return type:

V1ModelPerformanceModelList

delete_by_deployment(deployment: str)

Delete model performance metric

Parameters:

deployment (str) – The name of the deployment for which to delete model performance metric.

get_by_fields(deployment: str | None = None, model_name: str | None = None, model_version: str | None = None, model_stage: str | None = None, predict_date: float | None = None, startDateTime: float | None = None, endDateTime: float | None = None, segment_id: int | None = None, model_uuid: str | None = None, training: bool | None = None, output_type: str = 'object') V1ModelPerformanceModelList

Retrieve model performance data based on given params

Parameters:
  • deployment (str) – Deployment name

  • model_name (str) – Model name

  • model_version (str) – Model version

  • model_stage (str) – Model stage

  • predict_date (float) – Prediction date

  • startDateTime (float) – Start date and time (timestamp)

  • endDateTime (float) – End date and time (timestamp)

  • segment_id (int) – Segment id

  • model_uuid (str) – Model uuid

  • training (bool) – whether the model performance data is training data (?)

Returns:

Instance containing information about the model performance data retrived from the search.

Return type:

V1ModelPerformanceModelList

performance_metrics_url = '/v1/model-performance'
search(data: V1ModelPerformanceSearch, output_type: str = 'object') V1ModelPerformanceModelList

Search for model performance data

Parameters:

data (V1ModelPerformanceSearch) – Instance containing containing data regarding the search parameters.

Returns:

Instance containing information about the model performance data retrived from the search.

Return type:

V1ModelPerformanceModelList

update(data: V1ModelPerformanceModel, output_type: str = 'object') V1ModelPerformanceModel

Update an existing model performance metric

Parameters:

data (V1ModelPerformanceModel) – Instance containing the updated model performance metric.

Returns:

Instance containing information about the updated model performance metric.

Return type:

V1ModelPerformanceModel