@daocloud-proto/hydra 0.16.0-dev-7 → 0.16.0-dev-9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,337 @@
1
+ /* eslint-disable */
2
+ // @ts-nocheck
3
+ /*
4
+ * This file is a generated Typescript file for GRPC Gateway, DO NOT MODIFY
5
+ */
6
+
7
+ import * as HydraCommonCommon from "../../../common/common.pb"
8
+ import * as fm from "../../../fetch.pb"
9
+ import * as GoogleProtobufEmpty from "../../../google/protobuf/empty.pb"
10
+ import * as GoogleProtobufTimestamp from "../../../google/protobuf/timestamp.pb"
11
+
12
+ type Absent<T, K extends keyof T> = { [k in Exclude<keyof T, K>]?: undefined };
13
+ type OneOf<T> =
14
+ | { [k in keyof T]?: undefined }
15
+ | (
16
+ keyof T extends infer K ?
17
+ (K extends string & keyof T ? { [k in K]: T[K] } & Absent<T, K>
18
+ : never)
19
+ : never);
20
+
21
+ export enum AutoRoutePhase {
22
+ AUTO_ROUTE_PHASE_UNSPECIFIED = "AUTO_ROUTE_PHASE_UNSPECIFIED",
23
+ AUTO_ROUTE_PHASE_DISABLED = "AUTO_ROUTE_PHASE_DISABLED",
24
+ AUTO_ROUTE_PHASE_NOT_READY = "AUTO_ROUTE_PHASE_NOT_READY",
25
+ AUTO_ROUTE_PHASE_READY = "AUTO_ROUTE_PHASE_READY",
26
+ AUTO_ROUTE_PHASE_ERROR = "AUTO_ROUTE_PHASE_ERROR",
27
+ }
28
+
29
+ export enum Strategy {
30
+ STRATEGY_UNSPECIFIED = "STRATEGY_UNSPECIFIED",
31
+ STRATEGY_VSR = "STRATEGY_VSR",
32
+ STRATEGY_WASM = "STRATEGY_WASM",
33
+ }
34
+
35
+ export enum RouterModelSource {
36
+ ROUTER_MODEL_SOURCE_UNSPECIFIED = "ROUTER_MODEL_SOURCE_UNSPECIFIED",
37
+ ROUTER_MODEL_SOURCE_DATASET = "ROUTER_MODEL_SOURCE_DATASET",
38
+ ROUTER_MODEL_SOURCE_USER_PVC = "ROUTER_MODEL_SOURCE_USER_PVC",
39
+ }
40
+
41
+ export enum ClassifyCategory {
42
+ CLASSIFY_CATEGORY_UNSPECIFIED = "CLASSIFY_CATEGORY_UNSPECIFIED",
43
+ CLASSIFY_CATEGORY_MATH = "CLASSIFY_CATEGORY_MATH",
44
+ CLASSIFY_CATEGORY_PHYSICS = "CLASSIFY_CATEGORY_PHYSICS",
45
+ CLASSIFY_CATEGORY_CHEMISTRY = "CLASSIFY_CATEGORY_CHEMISTRY",
46
+ CLASSIFY_CATEGORY_BIOLOGY = "CLASSIFY_CATEGORY_BIOLOGY",
47
+ CLASSIFY_CATEGORY_COMPUTER_SCIENCE = "CLASSIFY_CATEGORY_COMPUTER_SCIENCE",
48
+ CLASSIFY_CATEGORY_HISTORY = "CLASSIFY_CATEGORY_HISTORY",
49
+ CLASSIFY_CATEGORY_ECONOMICS = "CLASSIFY_CATEGORY_ECONOMICS",
50
+ CLASSIFY_CATEGORY_BUSINESS = "CLASSIFY_CATEGORY_BUSINESS",
51
+ CLASSIFY_CATEGORY_LAW = "CLASSIFY_CATEGORY_LAW",
52
+ CLASSIFY_CATEGORY_HEALTH = "CLASSIFY_CATEGORY_HEALTH",
53
+ CLASSIFY_CATEGORY_PSYCHOLOGY = "CLASSIFY_CATEGORY_PSYCHOLOGY",
54
+ CLASSIFY_CATEGORY_PHILOSOPHY = "CLASSIFY_CATEGORY_PHILOSOPHY",
55
+ CLASSIFY_CATEGORY_OTHER = "CLASSIFY_CATEGORY_OTHER",
56
+ CLASSIFY_CATEGORY_UNKNOWN = "CLASSIFY_CATEGORY_UNKNOWN",
57
+ }
58
+
59
+ export enum SignalKind {
60
+ SIGNAL_KIND_UNSPECIFIED = "SIGNAL_KIND_UNSPECIFIED",
61
+ SIGNAL_KIND_CONTEXT = "SIGNAL_KIND_CONTEXT",
62
+ SIGNAL_KIND_EMBEDDING = "SIGNAL_KIND_EMBEDDING",
63
+ SIGNAL_KIND_COMPLEXITY = "SIGNAL_KIND_COMPLEXITY",
64
+ SIGNAL_KIND_DOMAIN = "SIGNAL_KIND_DOMAIN",
65
+ }
66
+
67
+ export enum ComplexityLevel {
68
+ COMPLEXITY_LEVEL_UNSPECIFIED = "COMPLEXITY_LEVEL_UNSPECIFIED",
69
+ COMPLEXITY_LEVEL_EASY = "COMPLEXITY_LEVEL_EASY",
70
+ COMPLEXITY_LEVEL_MEDIUM = "COMPLEXITY_LEVEL_MEDIUM",
71
+ COMPLEXITY_LEVEL_HARD = "COMPLEXITY_LEVEL_HARD",
72
+ }
73
+
74
+ export enum SignalCombinationOperator {
75
+ SIGNAL_COMBINATION_OPERATOR_UNSPECIFIED = "SIGNAL_COMBINATION_OPERATOR_UNSPECIFIED",
76
+ SIGNAL_COMBINATION_OPERATOR_AND = "SIGNAL_COMBINATION_OPERATOR_AND",
77
+ SIGNAL_COMBINATION_OPERATOR_OR = "SIGNAL_COMBINATION_OPERATOR_OR",
78
+ SIGNAL_COMBINATION_OPERATOR_NOT = "SIGNAL_COMBINATION_OPERATOR_NOT",
79
+ }
80
+
81
+ export enum AggregationMethod {
82
+ AGGREGATION_METHOD_UNSPECIFIED = "AGGREGATION_METHOD_UNSPECIFIED",
83
+ AGGREGATION_METHOD_MEAN = "AGGREGATION_METHOD_MEAN",
84
+ AGGREGATION_METHOD_MAX = "AGGREGATION_METHOD_MAX",
85
+ AGGREGATION_METHOD_ANY = "AGGREGATION_METHOD_ANY",
86
+ }
87
+
88
+ export type AutoRoute = {
89
+ cluster?: string
90
+ spec?: AutoRouteSpec
91
+ createdAt?: GoogleProtobufTimestamp.Timestamp
92
+ updatedAt?: GoogleProtobufTimestamp.Timestamp
93
+ status?: AutoRouteStatus
94
+ }
95
+
96
+ export type AutoRouteStatus = {
97
+ phase?: AutoRoutePhase
98
+ message?: string
99
+ vsrPhase?: string
100
+ readyReplicas?: number
101
+ entrypoints?: EntrypointStatus
102
+ modelAssets?: ModelAssetStatus[]
103
+ strategy?: Strategy
104
+ }
105
+
106
+ export type EntrypointStatus = {
107
+ ingressReady?: boolean
108
+ envoyfilterReady?: boolean
109
+ gatewayReady?: boolean
110
+ }
111
+
112
+ export type ModelAssetStatus = {
113
+ signalClass?: string
114
+ source?: RouterModelSource
115
+ name?: string
116
+ phase?: string
117
+ modelPath?: string
118
+ }
119
+
120
+
121
+ type BaseAutoRouteSpec = {
122
+ strategy?: Strategy
123
+ vsr?: VSRConfig
124
+ wasm?: WASMConfig
125
+ }
126
+
127
+ export type AutoRouteSpec = BaseAutoRouteSpec
128
+ & OneOf<{ enabled: boolean }>
129
+
130
+ export type VSRConfig = {
131
+ context?: ContextSignals
132
+ embeddings?: EmbeddingSignals
133
+ complexity?: ComplexitySignals
134
+ classify?: ClassifySignals
135
+ decisions?: RouteDecision[]
136
+ fallback?: RouteTarget
137
+ }
138
+
139
+ export type WASMConfig = {
140
+ rules?: WASMRule[]
141
+ fallback?: RouteTarget
142
+ }
143
+
144
+ export type WASMRule = {
145
+ name?: string
146
+ enabled?: boolean
147
+ description?: string
148
+ expression?: string
149
+ target?: RouteTarget
150
+ }
151
+
152
+ export type ContextSignals = {
153
+ enabled?: boolean
154
+ rules?: ContextSignal[]
155
+ }
156
+
157
+ export type EmbeddingSignals = {
158
+ enabled?: boolean
159
+ model?: RouterModelDownload
160
+ rules?: EmbeddingSignal[]
161
+ }
162
+
163
+ export type ComplexitySignals = {
164
+ enabled?: boolean
165
+ rules?: ComplexitySignal[]
166
+ }
167
+
168
+ export type ClassifySignals = {
169
+ enabled?: boolean
170
+ model?: RouterModelDownload
171
+ rules?: ClassifySignal[]
172
+ }
173
+
174
+ export type RouterModelDownload = {
175
+ source?: RouterModelSource
176
+ modelName?: string
177
+ pvcName?: string
178
+ }
179
+
180
+ export type ContextSignal = {
181
+ name?: string
182
+ minTokens?: number
183
+ maxTokens?: number
184
+ description?: string
185
+ }
186
+
187
+ export type EmbeddingSignal = {
188
+ name?: string
189
+ threshold?: number
190
+ candidates?: string[]
191
+ description?: string
192
+ aggregationMethod?: AggregationMethod
193
+ }
194
+
195
+ export type ComplexitySignal = {
196
+ name?: string
197
+ hardCandidates?: string[]
198
+ easyCandidates?: string[]
199
+ threshold?: number
200
+ description?: string
201
+ }
202
+
203
+ export type ClassifySignal = {
204
+ name?: string
205
+ categories?: ClassifyCategory[]
206
+ description?: string
207
+ }
208
+
209
+ export type RouteDecision = {
210
+ name?: string
211
+ priority?: number
212
+ operator?: SignalCombinationOperator
213
+ signalRefs?: RouteSignalRef[]
214
+ target?: RouteTarget
215
+ description?: string
216
+ }
217
+
218
+ export type RouteTarget = {
219
+ maasModelId?: string
220
+ customModelName?: string
221
+ }
222
+
223
+ export type RouteSignalRef = {
224
+ name?: string
225
+ kind?: SignalKind
226
+ complexityLevel?: ComplexityLevel
227
+ }
228
+
229
+ export type CreateAutoRouteRequest = {
230
+ cluster?: string
231
+ spec?: AutoRouteSpec
232
+ }
233
+
234
+ export type GetAutoRouteRequest = {
235
+ cluster?: string
236
+ strategy?: Strategy
237
+ }
238
+
239
+ export type ListAutoRoutesRequest = {
240
+ page?: HydraCommonCommon.Pagination
241
+ strategy?: Strategy
242
+ }
243
+
244
+ export type ListAutoRoutesResponse = {
245
+ items?: AutoRoute[]
246
+ page?: HydraCommonCommon.Pagination
247
+ }
248
+
249
+ export type UpdateAutoRouteRequest = {
250
+ cluster?: string
251
+ spec?: AutoRouteSpec
252
+ }
253
+
254
+ export type UpdateAutoRouteStatusRequest = {
255
+ cluster?: string
256
+ enabled?: boolean
257
+ strategy?: Strategy
258
+ }
259
+
260
+ export type DeleteAutoRouteRequest = {
261
+ cluster?: string
262
+ strategy?: Strategy
263
+ }
264
+
265
+ export type RouterModelConfig = {
266
+ category?: string
267
+ modelType?: string
268
+ repoId?: string
269
+ modelPath?: string
270
+ }
271
+
272
+ export type ListRouterModelsRequest = {
273
+ page?: HydraCommonCommon.Pagination
274
+ }
275
+
276
+ export type ListRouterModelsResponse = {
277
+ items?: RouterModelConfig[]
278
+ page?: HydraCommonCommon.Pagination
279
+ }
280
+
281
+ export type ModelServing = {
282
+ name?: string
283
+ accessModelName?: string
284
+ }
285
+
286
+ export type ListModelServingsRequest = {
287
+ cluster?: string
288
+ page?: HydraCommonCommon.Pagination
289
+ }
290
+
291
+ export type ListModelServingsResponse = {
292
+ items?: ModelServing[]
293
+ page?: HydraCommonCommon.Pagination
294
+ }
295
+
296
+ export type CheckUserPVCModelRequest = {
297
+ cluster?: string
298
+ pvcName?: string
299
+ modelName?: string
300
+ }
301
+
302
+ export type CheckUserPVCModelResponse = {
303
+ found?: boolean
304
+ configFound?: boolean
305
+ expectedPath?: string
306
+ message?: string
307
+ }
308
+
309
+ export class AutoRouteManagement {
310
+ static CreateAutoRoute(req: CreateAutoRouteRequest, initReq?: fm.InitReq): Promise<AutoRoute> {
311
+ return fm.fetchReq<CreateAutoRouteRequest, AutoRoute>(`/apis/admin.hydra.io/v1alpha1/auto-routes`, {...initReq, method: "POST", body: JSON.stringify(req, fm.replacer)})
312
+ }
313
+ static GetAutoRoute(req: GetAutoRouteRequest, initReq?: fm.InitReq): Promise<AutoRoute> {
314
+ return fm.fetchReq<GetAutoRouteRequest, AutoRoute>(`/apis/admin.hydra.io/v1alpha1/auto-routes/${req["cluster"]}?${fm.renderURLSearchParams(req, ["cluster"])}`, {...initReq, method: "GET"})
315
+ }
316
+ static ListAutoRoutes(req: ListAutoRoutesRequest, initReq?: fm.InitReq): Promise<ListAutoRoutesResponse> {
317
+ return fm.fetchReq<ListAutoRoutesRequest, ListAutoRoutesResponse>(`/apis/admin.hydra.io/v1alpha1/auto-routes?${fm.renderURLSearchParams(req, [])}`, {...initReq, method: "GET"})
318
+ }
319
+ static UpdateAutoRoute(req: UpdateAutoRouteRequest, initReq?: fm.InitReq): Promise<AutoRoute> {
320
+ return fm.fetchReq<UpdateAutoRouteRequest, AutoRoute>(`/apis/admin.hydra.io/v1alpha1/auto-routes/${req["cluster"]}`, {...initReq, method: "PUT", body: JSON.stringify(req, fm.replacer)})
321
+ }
322
+ static UpdateAutoRouteStatus(req: UpdateAutoRouteStatusRequest, initReq?: fm.InitReq): Promise<AutoRoute> {
323
+ return fm.fetchReq<UpdateAutoRouteStatusRequest, AutoRoute>(`/apis/admin.hydra.io/v1alpha1/auto-routes/${req["cluster"]}/status`, {...initReq, method: "PUT", body: JSON.stringify(req, fm.replacer)})
324
+ }
325
+ static DeleteAutoRoute(req: DeleteAutoRouteRequest, initReq?: fm.InitReq): Promise<GoogleProtobufEmpty.Empty> {
326
+ return fm.fetchReq<DeleteAutoRouteRequest, GoogleProtobufEmpty.Empty>(`/apis/admin.hydra.io/v1alpha1/auto-routes/${req["cluster"]}`, {...initReq, method: "DELETE"})
327
+ }
328
+ static ListRouterModels(req: ListRouterModelsRequest, initReq?: fm.InitReq): Promise<ListRouterModelsResponse> {
329
+ return fm.fetchReq<ListRouterModelsRequest, ListRouterModelsResponse>(`/apis/admin.hydra.io/v1alpha1/auto-route-models?${fm.renderURLSearchParams(req, [])}`, {...initReq, method: "GET"})
330
+ }
331
+ static ListModelServings(req: ListModelServingsRequest, initReq?: fm.InitReq): Promise<ListModelServingsResponse> {
332
+ return fm.fetchReq<ListModelServingsRequest, ListModelServingsResponse>(`/apis/admin.hydra.io/v1alpha1/auto-routes/${req["cluster"]}/model-servings?${fm.renderURLSearchParams(req, ["cluster"])}`, {...initReq, method: "GET"})
333
+ }
334
+ static CheckUserPVCModel(req: CheckUserPVCModelRequest, initReq?: fm.InitReq): Promise<CheckUserPVCModelResponse> {
335
+ return fm.fetchReq<CheckUserPVCModelRequest, CheckUserPVCModelResponse>(`/apis/admin.hydra.io/v1alpha1/auto-routes/${req["cluster"]}/check-pvc-model`, {...initReq, method: "POST", body: JSON.stringify(req, fm.replacer)})
336
+ }
337
+ }
@@ -103,6 +103,26 @@ export type ListModelGPUInfoResponse = {
103
103
  items?: ModelGPUInfo[]
104
104
  }
105
105
 
106
+ export type AdminListPersistentVolumeClaimsRequest = {
107
+ cluster?: string
108
+ page?: HydraCommonCommon.Pagination
109
+ }
110
+
111
+ export type PersistentVolumeClaim = {
112
+ name?: string
113
+ namespace?: string
114
+ storageClassName?: string
115
+ phase?: string
116
+ capacity?: string
117
+ accessModes?: string[]
118
+ createdAt?: string
119
+ }
120
+
121
+ export type AdminListPersistentVolumeClaimsResponse = {
122
+ items?: PersistentVolumeClaim[]
123
+ page?: HydraCommonCommon.Pagination
124
+ }
125
+
106
126
  export class CoreService {
107
127
  static AdminListCluster(req: ListClusterRequest, initReq?: fm.InitReq): Promise<ListClusterResponse> {
108
128
  return fm.fetchReq<ListClusterRequest, ListClusterResponse>(`/apis/admin.hydra.io/v1alpha1/clusters?${fm.renderURLSearchParams(req, [])}`, {...initReq, method: "GET"})
@@ -125,4 +145,7 @@ export class CoreService {
125
145
  static ListModelGPUInfo(req: ListModelGPUInfoRequest, initReq?: fm.InitReq): Promise<ListModelGPUInfoResponse> {
126
146
  return fm.fetchReq<ListModelGPUInfoRequest, ListModelGPUInfoResponse>(`/apis/admin.hydra.io/v1alpha1/model-gpu-info?${fm.renderURLSearchParams(req, [])}`, {...initReq, method: "GET"})
127
147
  }
148
+ static AdminListPersistentVolumeClaims(req: AdminListPersistentVolumeClaimsRequest, initReq?: fm.InitReq): Promise<AdminListPersistentVolumeClaimsResponse> {
149
+ return fm.fetchReq<AdminListPersistentVolumeClaimsRequest, AdminListPersistentVolumeClaimsResponse>(`/apis/admin.hydra.io/v1alpha1/clusters/${req["cluster"]}/persistentvolumeclaims?${fm.renderURLSearchParams(req, ["cluster"])}`, {...initReq, method: "GET"})
150
+ }
128
151
  }
@@ -5,6 +5,15 @@
5
5
  */
6
6
 
7
7
  import * as fm from "../../../fetch.pb"
8
+ import * as GoogleProtobufTimestamp from "../../../google/protobuf/timestamp.pb"
9
+
10
+ export enum GPUCostDepreciationStatus {
11
+ DEPRECIATION_STATUS_UNSPECIFIED = "DEPRECIATION_STATUS_UNSPECIFIED",
12
+ PENDING = "PENDING",
13
+ ACTIVE = "ACTIVE",
14
+ EXPIRED = "EXPIRED",
15
+ }
16
+
8
17
  export type CostMockConfig = {
9
18
  gpus?: GPUCost[]
10
19
  upstreamTokenPrices?: UpstreamTokenPrice[]
@@ -19,6 +28,12 @@ export type GPUCost = {
19
28
  memory?: string
20
29
  price?: number
21
30
  count?: number
31
+ purchasePrice?: number
32
+ depreciationStartTime?: GoogleProtobufTimestamp.Timestamp
33
+ usefulLifeMonths?: number
34
+ residualValue?: number
35
+ depreciationStatus?: GPUCostDepreciationStatus
36
+ hourlyDepreciation?: number
22
37
  }
23
38
 
24
39
  export type UpstreamTokenPrice = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@daocloud-proto/hydra",
3
- "version": "v0.16.0-dev-7",
3
+ "version": "v0.16.0-dev-9",
4
4
  "description": "",
5
5
  "author": "",
6
6
  "license": "ISC"