@@ -82,6 +82,16 @@ export type CreateIndexNode = TemplateNode & {
82
82
} ;
83
83
} ;
84
84
85
+ export type RegisterPretrainedModelNode = TemplateNode & {
86
+ user_inputs : {
87
+ name : string ;
88
+ description : string ;
89
+ model_format : string ;
90
+ version : string ;
91
+ deploy : boolean ;
92
+ } ;
93
+ } ;
94
+
85
95
export type TemplateEdge = {
86
96
source : string ;
87
97
dest : string ;
@@ -130,9 +140,83 @@ export enum USE_CASE {
130
140
/**
131
141
********** ML PLUGIN TYPES/INTERFACES **********
132
142
*/
143
+
144
+ // Based off of https://github.com/opensearch-project/ml-commons/blob/main/common/src/main/java/org/opensearch/ml/common/model/MLModelState.java
145
+ export enum MODEL_STATE {
146
+ REGISTERED = 'Registered' ,
147
+ REGISTERING = 'Registering' ,
148
+ DEPLOYING = 'Deploying' ,
149
+ DEPLOYED = 'Deployed' ,
150
+ PARTIALLY_DEPLOYED = 'Partially deployed' ,
151
+ UNDEPLOYED = 'Undeployed' ,
152
+ DEPLOY_FAILED = 'Deploy failed' ,
153
+ }
154
+
155
+ // Based off of https://github.com/opensearch-project/ml-commons/blob/main/common/src/main/java/org/opensearch/ml/common/FunctionName.java
156
+ export enum MODEL_ALGORITHM {
157
+ LINEAR_REGRESSION = 'Linear regression' ,
158
+ KMEANS = 'K-means' ,
159
+ AD_LIBSVM = 'AD LIBSVM' ,
160
+ SAMPLE_ALGO = 'Sample algorithm' ,
161
+ LOCAL_SAMPLE_CALCULATOR = 'Local sample calculator' ,
162
+ FIT_RCF = 'Fit RCF' ,
163
+ BATCH_RCF = 'Batch RCF' ,
164
+ ANOMALY_LOCALIZATION = 'Anomaly localization' ,
165
+ RCF_SUMMARIZE = 'RCF summarize' ,
166
+ LOGISTIC_REGRESSION = 'Logistic regression' ,
167
+ TEXT_EMBEDDING = 'Text embedding' ,
168
+ METRICS_CORRELATION = 'Metrics correlation' ,
169
+ REMOTE = 'Remote' ,
170
+ SPARSE_ENCODING = 'Sparse encoding' ,
171
+ SPARSE_TOKENIZE = 'Sparse tokenize' ,
172
+ TEXT_SIMILARITY = 'Text similarity' ,
173
+ QUESTION_ANSWERING = 'Question answering' ,
174
+ AGENT = 'Agent' ,
175
+ }
176
+
177
+ export enum MODEL_CATEGORY {
178
+ DEPLOYED = 'Deployed' ,
179
+ PRETRAINED = 'Pretrained' ,
180
+ }
181
+
182
+ export enum PRETRAINED_MODEL_FORMAT {
183
+ TORCH_SCRIPT = 'TORCH_SCRIPT' ,
184
+ }
185
+
186
+ export type PretrainedModel = {
187
+ name : string ;
188
+ shortenedName : string ;
189
+ description : string ;
190
+ format : PRETRAINED_MODEL_FORMAT ;
191
+ algorithm : MODEL_ALGORITHM ;
192
+ version : string ;
193
+ } ;
194
+
195
+ export type PretrainedSentenceTransformer = PretrainedModel & {
196
+ vectorDimensions : number ;
197
+ } ;
198
+
199
+ export type ModelConfig = {
200
+ modelType ?: string ;
201
+ embeddingDimension ?: number ;
202
+ } ;
203
+
133
204
export type Model = {
134
205
id : string ;
135
- algorithm : string ;
206
+ name : string ;
207
+ algorithm : MODEL_ALGORITHM ;
208
+ state : MODEL_STATE ;
209
+ modelConfig ?: ModelConfig ;
210
+ } ;
211
+
212
+ export type ModelDict = {
213
+ [ modelId : string ] : Model ;
214
+ } ;
215
+
216
+ export type ModelFormValue = {
217
+ id : string ;
218
+ category ?: MODEL_CATEGORY ;
219
+ algorithm ?: MODEL_ALGORITHM ;
136
220
} ;
137
221
138
222
/**
@@ -171,7 +255,3 @@ export enum WORKFLOW_RESOURCE_TYPE {
171
255
export type WorkflowDict = {
172
256
[ workflowId : string ] : Workflow ;
173
257
} ;
174
-
175
- export type ModelDict = {
176
- [ modelId : string ] : Model ;
177
- } ;
0 commit comments