@gaiot/apis
Version:
aiot apis
157 lines (156 loc) • 3.6 kB
TypeScript
import { IOperator } from '../cvforce-datahub/model';
export type IModelServiceState = "Starting" | "Running" | "Aborting" | "Aborted" | "RunError";
export interface IModelService {
id: string;
name: string;
modelId: string;
taskId: string;
state: IModelServiceState;
description: string;
type: "service" | "verify";
creator: string;
createdAt: string;
updatedAt: string;
deletedAt: string;
startTime: string;
activeTime: string;
endTime: string;
modelName: string;
modelVersion: string;
stateMessage: string;
serviceUrl: string;
documentUrl: string;
source: string;
shelfStatus: boolean;
isLightModel: boolean;
algServiceUrl: string;
serviceType: string;
subModelType: string;
deployOptions: IServiceDeployOptions;
apikey?: string;
alg_options?: {
modelName: string;
apiKey?: string;
};
operator: IOperator;
signList: ISign[];
}
export interface IServiceParams {
name?: string;
description?: string;
modelId?: string;
taskId?: string;
type: "service" | "verify";
documentUrl?: string;
isLightModel?: boolean;
algServiceUrl?: string;
serviceId?: string;
subModelType?: string;
deployOptions?: IServiceDeployOptions;
signList?: ISign[];
}
export interface IServiceQueryParams {
name?: string;
state?: string;
taskId?: string;
type?: string;
source?: string;
shelfStatus?: number;
isLightModel?: number;
serviceType?: string;
creator?: string;
signList?: string[];
signName?: string;
}
export interface IStatistic {
id: string;
name: string;
isLightModel: boolean;
shelfStatus: boolean;
internal: ICountNal;
external: ICountNal;
subModelType: string;
}
export interface ICountNal {
successCount: number;
failCount: number;
}
export interface IStatisticQueryParams {
startTime?: string;
endTime?: string;
name?: string;
isLightModel?: number;
serviceType?: string;
shelfStatus?: number;
}
export interface IServiceStastic {
time: string;
successCount: number;
failCount: number;
}
export interface IServiceStasticParams {
startTime?: string;
endTime?: string;
serviceType?: string;
}
export interface IServiceDeployOptions {
minReplicas?: number;
maxReplicas?: number;
containerConcurrency?: number;
targetUtilizationPercentage?: number;
scaleDownDelay?: string;
modelContextLength: number;
confidence?: IConfidenceData[];
cpu?: number;
memory?: number;
resourceAllocation?: IResourceAllocation;
image?: string;
port?: number;
suffix?: string;
volumes?: {
pvc?: IPvc[];
configmap?: IConfigmap[];
};
modelStore?: number;
pattern?: number;
concurrencyHard?: number;
}
export interface IConfidenceData {
label: string;
threshold: number;
}
export interface IResourceAllocation {
type: string;
gpu: IGpu[];
adds?: object;
}
export interface IGpu {
gpuType: string;
gpuMem: number;
gpuCount: number;
}
export interface IPvc {
name: string;
pvc: string;
volumeMount: IVolumeMount[];
}
export interface IConfigmap {
name: string;
defaultMode: number;
optional: boolean;
configmap: string;
volumeMount: IVolumeMount[];
}
export interface IVolumeMount {
path: string;
subPath: string;
readOnly: boolean;
}
export interface ISign {
id?: string;
name: string;
}
export declare enum ImodelStoreEnum {
minio = 0,
pvc = 1
}