@daocloud-proto/hydra 0.16.0-rc1-dev-7 → 0.17.0-rc1
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.
- package/admin-api/auto-route/v1alpha1/auto_route.pb.ts +338 -0
- package/admin-api/core/v1alpha1/core.pb.ts +23 -0
- package/admin-api/cost-mock-config/v1alpha1/cost_mock_config.pb.ts +15 -0
- package/admin-api/guardrails/v1alpha1/guardrails.pb.ts +36 -0
- package/admin-api/maas/v1alpha1/maas.pb.ts +36 -0
- package/admin-api/model/v1alpha1/model.pb.ts +17 -0
- package/admin-api/model/v1alpha1/provider.pb.ts +37 -0
- package/common/errorcode.ts +3 -0
- package/management-api/apikey/v1alpha1/apikey.pb.ts +26 -0
- package/management-api/core/v1alpha1/management.pb.ts +2 -0
- package/management-api/core/v1alpha1/permissions.pb.ts +1 -0
- package/management-api/dashboard/v1alpha1/dashboard.pb.ts +2 -1
- package/management-api/model/v1alpha1/model.pb.ts +63 -1
- package/management-api/model_serving/v1alpha1/model_serving.pb.ts +14 -2
- package/package.json +1 -1
|
@@ -0,0 +1,338 @@
|
|
|
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_ENGINEERING = "CLASSIFY_CATEGORY_ENGINEERING",
|
|
56
|
+
CLASSIFY_CATEGORY_OTHER = "CLASSIFY_CATEGORY_OTHER",
|
|
57
|
+
CLASSIFY_CATEGORY_UNKNOWN = "CLASSIFY_CATEGORY_UNKNOWN",
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
export enum SignalKind {
|
|
61
|
+
SIGNAL_KIND_UNSPECIFIED = "SIGNAL_KIND_UNSPECIFIED",
|
|
62
|
+
SIGNAL_KIND_CONTEXT = "SIGNAL_KIND_CONTEXT",
|
|
63
|
+
SIGNAL_KIND_EMBEDDING = "SIGNAL_KIND_EMBEDDING",
|
|
64
|
+
SIGNAL_KIND_COMPLEXITY = "SIGNAL_KIND_COMPLEXITY",
|
|
65
|
+
SIGNAL_KIND_DOMAIN = "SIGNAL_KIND_DOMAIN",
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
export enum ComplexityLevel {
|
|
69
|
+
COMPLEXITY_LEVEL_UNSPECIFIED = "COMPLEXITY_LEVEL_UNSPECIFIED",
|
|
70
|
+
COMPLEXITY_LEVEL_EASY = "COMPLEXITY_LEVEL_EASY",
|
|
71
|
+
COMPLEXITY_LEVEL_MEDIUM = "COMPLEXITY_LEVEL_MEDIUM",
|
|
72
|
+
COMPLEXITY_LEVEL_HARD = "COMPLEXITY_LEVEL_HARD",
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
export enum SignalCombinationOperator {
|
|
76
|
+
SIGNAL_COMBINATION_OPERATOR_UNSPECIFIED = "SIGNAL_COMBINATION_OPERATOR_UNSPECIFIED",
|
|
77
|
+
SIGNAL_COMBINATION_OPERATOR_AND = "SIGNAL_COMBINATION_OPERATOR_AND",
|
|
78
|
+
SIGNAL_COMBINATION_OPERATOR_OR = "SIGNAL_COMBINATION_OPERATOR_OR",
|
|
79
|
+
SIGNAL_COMBINATION_OPERATOR_NOT = "SIGNAL_COMBINATION_OPERATOR_NOT",
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
export enum AggregationMethod {
|
|
83
|
+
AGGREGATION_METHOD_UNSPECIFIED = "AGGREGATION_METHOD_UNSPECIFIED",
|
|
84
|
+
AGGREGATION_METHOD_MEAN = "AGGREGATION_METHOD_MEAN",
|
|
85
|
+
AGGREGATION_METHOD_MAX = "AGGREGATION_METHOD_MAX",
|
|
86
|
+
AGGREGATION_METHOD_ANY = "AGGREGATION_METHOD_ANY",
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
export type AutoRoute = {
|
|
90
|
+
cluster?: string
|
|
91
|
+
spec?: AutoRouteSpec
|
|
92
|
+
createdAt?: GoogleProtobufTimestamp.Timestamp
|
|
93
|
+
updatedAt?: GoogleProtobufTimestamp.Timestamp
|
|
94
|
+
status?: AutoRouteStatus
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
export type AutoRouteStatus = {
|
|
98
|
+
phase?: AutoRoutePhase
|
|
99
|
+
message?: string
|
|
100
|
+
vsrPhase?: string
|
|
101
|
+
readyReplicas?: number
|
|
102
|
+
entrypoints?: EntrypointStatus
|
|
103
|
+
modelAssets?: ModelAssetStatus[]
|
|
104
|
+
strategy?: Strategy
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
export type EntrypointStatus = {
|
|
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
|
+
model?: RouterModelDownload
|
|
166
|
+
rules?: ComplexitySignal[]
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
export type ClassifySignals = {
|
|
170
|
+
enabled?: boolean
|
|
171
|
+
model?: RouterModelDownload
|
|
172
|
+
rules?: ClassifySignal[]
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
export type RouterModelDownload = {
|
|
176
|
+
source?: RouterModelSource
|
|
177
|
+
modelName?: string
|
|
178
|
+
pvcName?: string
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
export type ContextSignal = {
|
|
182
|
+
name?: string
|
|
183
|
+
minTokens?: number
|
|
184
|
+
maxTokens?: number
|
|
185
|
+
description?: string
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
export type EmbeddingSignal = {
|
|
189
|
+
name?: string
|
|
190
|
+
threshold?: number
|
|
191
|
+
candidates?: string[]
|
|
192
|
+
description?: string
|
|
193
|
+
aggregationMethod?: AggregationMethod
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
export type ComplexitySignal = {
|
|
197
|
+
name?: string
|
|
198
|
+
hardCandidates?: string[]
|
|
199
|
+
easyCandidates?: string[]
|
|
200
|
+
threshold?: number
|
|
201
|
+
description?: string
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
export type ClassifySignal = {
|
|
205
|
+
name?: string
|
|
206
|
+
categories?: ClassifyCategory[]
|
|
207
|
+
description?: string
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
export type RouteDecision = {
|
|
211
|
+
name?: string
|
|
212
|
+
priority?: number
|
|
213
|
+
operator?: SignalCombinationOperator
|
|
214
|
+
signalRefs?: RouteSignalRef[]
|
|
215
|
+
target?: RouteTarget
|
|
216
|
+
description?: string
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
export type RouteTarget = {
|
|
220
|
+
maasModelId?: string
|
|
221
|
+
customModelName?: string
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
export type RouteSignalRef = {
|
|
225
|
+
name?: string
|
|
226
|
+
kind?: SignalKind
|
|
227
|
+
complexityLevel?: ComplexityLevel
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
export type CreateAutoRouteRequest = {
|
|
231
|
+
cluster?: string
|
|
232
|
+
spec?: AutoRouteSpec
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
export type GetAutoRouteRequest = {
|
|
236
|
+
cluster?: string
|
|
237
|
+
strategy?: Strategy
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
export type ListAutoRoutesRequest = {
|
|
241
|
+
page?: HydraCommonCommon.Pagination
|
|
242
|
+
strategy?: Strategy
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
export type ListAutoRoutesResponse = {
|
|
246
|
+
items?: AutoRoute[]
|
|
247
|
+
page?: HydraCommonCommon.Pagination
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
export type UpdateAutoRouteRequest = {
|
|
251
|
+
cluster?: string
|
|
252
|
+
spec?: AutoRouteSpec
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
export type UpdateAutoRouteStatusRequest = {
|
|
256
|
+
cluster?: string
|
|
257
|
+
enabled?: boolean
|
|
258
|
+
strategy?: Strategy
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
export type DeleteAutoRouteRequest = {
|
|
262
|
+
cluster?: string
|
|
263
|
+
strategy?: Strategy
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
export type RouterModelConfig = {
|
|
267
|
+
category?: string
|
|
268
|
+
modelType?: string
|
|
269
|
+
repoId?: string
|
|
270
|
+
modelPath?: string
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
export type ListRouterModelsRequest = {
|
|
274
|
+
page?: HydraCommonCommon.Pagination
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
export type ListRouterModelsResponse = {
|
|
278
|
+
items?: RouterModelConfig[]
|
|
279
|
+
page?: HydraCommonCommon.Pagination
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
export type ModelServing = {
|
|
283
|
+
name?: string
|
|
284
|
+
accessModelName?: string
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
export type ListModelServingsRequest = {
|
|
288
|
+
cluster?: string
|
|
289
|
+
page?: HydraCommonCommon.Pagination
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
export type ListModelServingsResponse = {
|
|
293
|
+
items?: ModelServing[]
|
|
294
|
+
page?: HydraCommonCommon.Pagination
|
|
295
|
+
}
|
|
296
|
+
|
|
297
|
+
export type CheckUserPVCModelRequest = {
|
|
298
|
+
cluster?: string
|
|
299
|
+
pvcName?: string
|
|
300
|
+
modelName?: string
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
export type CheckUserPVCModelResponse = {
|
|
304
|
+
found?: boolean
|
|
305
|
+
configFound?: boolean
|
|
306
|
+
expectedPath?: string
|
|
307
|
+
message?: string
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
export class AutoRouteManagement {
|
|
311
|
+
static CreateAutoRoute(req: CreateAutoRouteRequest, initReq?: fm.InitReq): Promise<AutoRoute> {
|
|
312
|
+
return fm.fetchReq<CreateAutoRouteRequest, AutoRoute>(`/apis/admin.hydra.io/v1alpha1/auto-routes`, {...initReq, method: "POST", body: JSON.stringify(req, fm.replacer)})
|
|
313
|
+
}
|
|
314
|
+
static GetAutoRoute(req: GetAutoRouteRequest, initReq?: fm.InitReq): Promise<AutoRoute> {
|
|
315
|
+
return fm.fetchReq<GetAutoRouteRequest, AutoRoute>(`/apis/admin.hydra.io/v1alpha1/auto-routes/${req["cluster"]}?${fm.renderURLSearchParams(req, ["cluster"])}`, {...initReq, method: "GET"})
|
|
316
|
+
}
|
|
317
|
+
static ListAutoRoutes(req: ListAutoRoutesRequest, initReq?: fm.InitReq): Promise<ListAutoRoutesResponse> {
|
|
318
|
+
return fm.fetchReq<ListAutoRoutesRequest, ListAutoRoutesResponse>(`/apis/admin.hydra.io/v1alpha1/auto-routes?${fm.renderURLSearchParams(req, [])}`, {...initReq, method: "GET"})
|
|
319
|
+
}
|
|
320
|
+
static UpdateAutoRoute(req: UpdateAutoRouteRequest, initReq?: fm.InitReq): Promise<AutoRoute> {
|
|
321
|
+
return fm.fetchReq<UpdateAutoRouteRequest, AutoRoute>(`/apis/admin.hydra.io/v1alpha1/auto-routes/${req["cluster"]}`, {...initReq, method: "PUT", body: JSON.stringify(req, fm.replacer)})
|
|
322
|
+
}
|
|
323
|
+
static UpdateAutoRouteStatus(req: UpdateAutoRouteStatusRequest, initReq?: fm.InitReq): Promise<AutoRoute> {
|
|
324
|
+
return fm.fetchReq<UpdateAutoRouteStatusRequest, AutoRoute>(`/apis/admin.hydra.io/v1alpha1/auto-routes/${req["cluster"]}/status`, {...initReq, method: "PUT", body: JSON.stringify(req, fm.replacer)})
|
|
325
|
+
}
|
|
326
|
+
static DeleteAutoRoute(req: DeleteAutoRouteRequest, initReq?: fm.InitReq): Promise<GoogleProtobufEmpty.Empty> {
|
|
327
|
+
return fm.fetchReq<DeleteAutoRouteRequest, GoogleProtobufEmpty.Empty>(`/apis/admin.hydra.io/v1alpha1/auto-routes/${req["cluster"]}`, {...initReq, method: "DELETE"})
|
|
328
|
+
}
|
|
329
|
+
static ListRouterModels(req: ListRouterModelsRequest, initReq?: fm.InitReq): Promise<ListRouterModelsResponse> {
|
|
330
|
+
return fm.fetchReq<ListRouterModelsRequest, ListRouterModelsResponse>(`/apis/admin.hydra.io/v1alpha1/auto-route-models?${fm.renderURLSearchParams(req, [])}`, {...initReq, method: "GET"})
|
|
331
|
+
}
|
|
332
|
+
static ListModelServings(req: ListModelServingsRequest, initReq?: fm.InitReq): Promise<ListModelServingsResponse> {
|
|
333
|
+
return fm.fetchReq<ListModelServingsRequest, ListModelServingsResponse>(`/apis/admin.hydra.io/v1alpha1/auto-routes/${req["cluster"]}/model-servings?${fm.renderURLSearchParams(req, ["cluster"])}`, {...initReq, method: "GET"})
|
|
334
|
+
}
|
|
335
|
+
static CheckUserPVCModel(req: CheckUserPVCModelRequest, initReq?: fm.InitReq): Promise<CheckUserPVCModelResponse> {
|
|
336
|
+
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)})
|
|
337
|
+
}
|
|
338
|
+
}
|
|
@@ -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 = {
|
|
@@ -150,6 +150,39 @@ export type QueryAIAuditLogResponse = {
|
|
|
150
150
|
page?: HydraCommonCommon.Pagination
|
|
151
151
|
}
|
|
152
152
|
|
|
153
|
+
export type QueryAIAuditLogStatisticsRequest = {
|
|
154
|
+
startTime?: GoogleProtobufTimestamp.Timestamp
|
|
155
|
+
endTime?: GoogleProtobufTimestamp.Timestamp
|
|
156
|
+
pluginId?: GuardrailsPlugin
|
|
157
|
+
level?: GuardrailsLevel
|
|
158
|
+
routeName?: string
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
export type AIAuditLogPolicyCount = {
|
|
162
|
+
pluginId?: GuardrailsPlugin
|
|
163
|
+
count?: string
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
export type AIAuditLogRouteNameCount = {
|
|
167
|
+
routeName?: string
|
|
168
|
+
count?: string
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
export type AIAuditLogRouteStatistics = {
|
|
172
|
+
routeName?: string
|
|
173
|
+
riskRequestCount?: string
|
|
174
|
+
logCount?: string
|
|
175
|
+
blockedCount?: string
|
|
176
|
+
policyCounts?: AIAuditLogPolicyCount[]
|
|
177
|
+
averageProcessingDurationMs?: number
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
export type QueryAIAuditLogStatisticsResponse = {
|
|
181
|
+
statisticsStartTime?: GoogleProtobufTimestamp.Timestamp
|
|
182
|
+
statisticsEndTime?: GoogleProtobufTimestamp.Timestamp
|
|
183
|
+
routeStatistics?: AIAuditLogRouteStatistics[]
|
|
184
|
+
}
|
|
185
|
+
|
|
153
186
|
export type ExportAIAuditLogRequest = {
|
|
154
187
|
startTime?: GoogleProtobufTimestamp.Timestamp
|
|
155
188
|
endTime?: GoogleProtobufTimestamp.Timestamp
|
|
@@ -174,6 +207,9 @@ export class AIGuardrailsService {
|
|
|
174
207
|
static QueryAIAuditLog(req: QueryAIAuditLogRequest, initReq?: fm.InitReq): Promise<QueryAIAuditLogResponse> {
|
|
175
208
|
return fm.fetchReq<QueryAIAuditLogRequest, QueryAIAuditLogResponse>(`/apis/admin.hydra.io/v1alpha1/ai-guardrails-logs?${fm.renderURLSearchParams(req, [])}`, {...initReq, method: "GET"})
|
|
176
209
|
}
|
|
210
|
+
static QueryAIAuditLogStatistics(req: QueryAIAuditLogStatisticsRequest, initReq?: fm.InitReq): Promise<QueryAIAuditLogStatisticsResponse> {
|
|
211
|
+
return fm.fetchReq<QueryAIAuditLogStatisticsRequest, QueryAIAuditLogStatisticsResponse>(`/apis/admin.hydra.io/v1alpha1/ai-guardrails-logs/statistics?${fm.renderURLSearchParams(req, [])}`, {...initReq, method: "GET"})
|
|
212
|
+
}
|
|
177
213
|
static ExportAIAuditLog(req: ExportAIAuditLogRequest, initReq?: fm.InitReq): Promise<GoogleApiHttpbody.HttpBody> {
|
|
178
214
|
return fm.fetchReq<ExportAIAuditLogRequest, GoogleApiHttpbody.HttpBody>(`/apis/admin.hydra.io/v1alpha1/ai-guardrails-logs/export?${fm.renderURLSearchParams(req, [])}`, {...initReq, method: "GET"})
|
|
179
215
|
}
|
|
@@ -9,6 +9,12 @@ import * as fm from "../../../fetch.pb"
|
|
|
9
9
|
import * as GoogleProtobufTimestamp from "../../../google/protobuf/timestamp.pb"
|
|
10
10
|
import * as HydraAdmin_apiModelV1alpha1Model from "../../model/v1alpha1/model.pb"
|
|
11
11
|
|
|
12
|
+
export enum MAASWorkspaceVisibilityScope {
|
|
13
|
+
MAAS_WORKSPACE_VISIBILITY_SCOPE_UNSPECIFIED = "MAAS_WORKSPACE_VISIBILITY_SCOPE_UNSPECIFIED",
|
|
14
|
+
MAAS_WORKSPACE_VISIBILITY_SCOPE_ALL = "MAAS_WORKSPACE_VISIBILITY_SCOPE_ALL",
|
|
15
|
+
MAAS_WORKSPACE_VISIBILITY_SCOPE_SPECIFIED = "MAAS_WORKSPACE_VISIBILITY_SCOPE_SPECIFIED",
|
|
16
|
+
}
|
|
17
|
+
|
|
12
18
|
export enum LoadBalanceStrategy {
|
|
13
19
|
LOAD_BALANCE_STRATEGY_UNSPECIFIED = "LOAD_BALANCE_STRATEGY_UNSPECIFIED",
|
|
14
20
|
LOAD_BALANCE_STRATEGY_ROUND_ROBIN = "LOAD_BALANCE_STRATEGY_ROUND_ROBIN",
|
|
@@ -22,6 +28,12 @@ export enum RateLimitBaseOn {
|
|
|
22
28
|
RATE_LIMIT_BASE_ON_WS = "RATE_LIMIT_BASE_ON_WS",
|
|
23
29
|
}
|
|
24
30
|
|
|
31
|
+
export enum MAASBackendStatus {
|
|
32
|
+
MAAS_BACKEND_STATUS_UNSPECIFIED = "MAAS_BACKEND_STATUS_UNSPECIFIED",
|
|
33
|
+
MAAS_BACKEND_STATUS_HEALTHY = "MAAS_BACKEND_STATUS_HEALTHY",
|
|
34
|
+
MAAS_BACKEND_STATUS_FAILED = "MAAS_BACKEND_STATUS_FAILED",
|
|
35
|
+
}
|
|
36
|
+
|
|
25
37
|
export enum MAASModelGatewayStatus {
|
|
26
38
|
GATEWAY_STATUS_UNSPECIFIED = "GATEWAY_STATUS_UNSPECIFIED",
|
|
27
39
|
GATEWAY_STATUS_HEALTHY = "GATEWAY_STATUS_HEALTHY",
|
|
@@ -34,6 +46,11 @@ export enum UpstreamModelStatus {
|
|
|
34
46
|
STATUS_FAILED = "STATUS_FAILED",
|
|
35
47
|
}
|
|
36
48
|
|
|
49
|
+
export type MAASWorkspaceVisibility = {
|
|
50
|
+
scope?: MAASWorkspaceVisibilityScope
|
|
51
|
+
workspaces?: number[]
|
|
52
|
+
}
|
|
53
|
+
|
|
37
54
|
export type CreateMAASModelRequest = {
|
|
38
55
|
modelId?: string
|
|
39
56
|
upstreamModels?: UpstreamModel[]
|
|
@@ -41,6 +58,8 @@ export type CreateMAASModelRequest = {
|
|
|
41
58
|
ratelimitConfig?: RatelimitConfig
|
|
42
59
|
loadBalanceConfig?: LoadBalanceConfig
|
|
43
60
|
tokenWeight?: string
|
|
61
|
+
workspaceVisibility?: MAASWorkspaceVisibility
|
|
62
|
+
capabilityRoutes?: MAASCapabilityRoute[]
|
|
44
63
|
}
|
|
45
64
|
|
|
46
65
|
export type MAASModel = {
|
|
@@ -53,6 +72,8 @@ export type MAASModel = {
|
|
|
53
72
|
gatewayStatus?: MAASModelGatewayStatus
|
|
54
73
|
enabled?: boolean
|
|
55
74
|
tokenWeight?: string
|
|
75
|
+
workspaceVisibility?: MAASWorkspaceVisibility
|
|
76
|
+
capabilityRoutes?: MAASCapabilityRoute[]
|
|
56
77
|
}
|
|
57
78
|
|
|
58
79
|
export type LoadBalanceConfig = {
|
|
@@ -82,6 +103,19 @@ export type RateLimitRule = {
|
|
|
82
103
|
apiKey?: string
|
|
83
104
|
}
|
|
84
105
|
|
|
106
|
+
export type MAASCapabilityRoute = {
|
|
107
|
+
capabilities?: string[]
|
|
108
|
+
upstreams?: MAASCapabilityUpstream[]
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
export type MAASCapabilityUpstream = {
|
|
112
|
+
modelId?: string
|
|
113
|
+
baseUrl?: string
|
|
114
|
+
capabilityPaths?: {[key: string]: string}
|
|
115
|
+
apiKey?: string
|
|
116
|
+
status?: MAASBackendStatus
|
|
117
|
+
}
|
|
118
|
+
|
|
85
119
|
export type UpstreamModel = {
|
|
86
120
|
modelId?: string
|
|
87
121
|
apiKey?: string
|
|
@@ -104,6 +138,8 @@ export type UpdateMAASModelRequest = {
|
|
|
104
138
|
loadBalanceConfig?: LoadBalanceConfig
|
|
105
139
|
upstreamModels?: UpstreamModel[]
|
|
106
140
|
tokenWeight?: string
|
|
141
|
+
workspaceVisibility?: MAASWorkspaceVisibility
|
|
142
|
+
capabilityRoutes?: MAASCapabilityRoute[]
|
|
107
143
|
}
|
|
108
144
|
|
|
109
145
|
export type UpdateMAASModelStatusRequest = {
|
|
@@ -40,6 +40,9 @@ export type CreateModelRequest = {
|
|
|
40
40
|
servingSpec?: HydraManagement_apiModelV1alpha1Model.ModelServingSpec
|
|
41
41
|
hidden?: boolean
|
|
42
42
|
providerName?: HydraCommonCommon.I18nName
|
|
43
|
+
parameterSize?: number
|
|
44
|
+
contextLength?: HydraManagement_apiModelV1alpha1Model.ContextLengthRange
|
|
45
|
+
operationTags?: HydraManagement_apiModelV1alpha1Model.ModelOperationTag[]
|
|
43
46
|
}
|
|
44
47
|
|
|
45
48
|
export type Model = {
|
|
@@ -59,6 +62,10 @@ export type Model = {
|
|
|
59
62
|
publicModelConfig?: HydraManagement_apiModelV1alpha1Model.PublicModelConfig
|
|
60
63
|
servingSpec?: HydraManagement_apiModelV1alpha1Model.ModelServingSpec
|
|
61
64
|
hidden?: boolean
|
|
65
|
+
parameterSize?: number
|
|
66
|
+
contextLength?: HydraManagement_apiModelV1alpha1Model.ContextLengthRange
|
|
67
|
+
operationTags?: HydraManagement_apiModelV1alpha1Model.ModelOperationTag[]
|
|
68
|
+
publishTimestamp?: GoogleProtobufTimestamp.Timestamp
|
|
62
69
|
}
|
|
63
70
|
|
|
64
71
|
export type UpdateModelRequest = {
|
|
@@ -75,6 +82,9 @@ export type UpdateModelRequest = {
|
|
|
75
82
|
publicModelConfig?: HydraManagement_apiModelV1alpha1Model.PublicModelConfig
|
|
76
83
|
servingSpec?: HydraManagement_apiModelV1alpha1Model.ModelServingSpec
|
|
77
84
|
hidden?: boolean
|
|
85
|
+
parameterSize?: number
|
|
86
|
+
contextLength?: HydraManagement_apiModelV1alpha1Model.ContextLengthRange
|
|
87
|
+
operationTags?: HydraManagement_apiModelV1alpha1Model.ModelOperationTag[]
|
|
78
88
|
}
|
|
79
89
|
|
|
80
90
|
export type ListModelRequest = {
|
|
@@ -157,6 +167,10 @@ export type ListModelServingsByModelResponse = {
|
|
|
157
167
|
items?: WorkspaceModelServingGroup[]
|
|
158
168
|
}
|
|
159
169
|
|
|
170
|
+
export type SortModelsRequest = {
|
|
171
|
+
modelIds?: string[]
|
|
172
|
+
}
|
|
173
|
+
|
|
160
174
|
export class AdminModelManagement {
|
|
161
175
|
static CreateModel(req: CreateModelRequest, initReq?: fm.InitReq): Promise<Model> {
|
|
162
176
|
return fm.fetchReq<CreateModelRequest, Model>(`/apis/admin.hydra.io/v1alpha1/models`, {...initReq, method: "POST", body: JSON.stringify(req, fm.replacer)})
|
|
@@ -194,6 +208,9 @@ export class AdminModelManagement {
|
|
|
194
208
|
static ListModelServingsByModel(req: ListModelServingsByModelRequest, initReq?: fm.InitReq): Promise<ListModelServingsByModelResponse> {
|
|
195
209
|
return fm.fetchReq<ListModelServingsByModelRequest, ListModelServingsByModelResponse>(`/apis/admin.hydra.io/v1alpha1/models/${req["modelId"]}/servings?${fm.renderURLSearchParams(req, ["modelId"])}`, {...initReq, method: "GET"})
|
|
196
210
|
}
|
|
211
|
+
static SortModels(req: SortModelsRequest, initReq?: fm.InitReq): Promise<GoogleProtobufEmpty.Empty> {
|
|
212
|
+
return fm.fetchReq<SortModelsRequest, GoogleProtobufEmpty.Empty>(`/apis/admin.hydra.io/v1alpha1/models:sort`, {...initReq, method: "POST", body: JSON.stringify(req, fm.replacer)})
|
|
213
|
+
}
|
|
197
214
|
}
|
|
198
215
|
export class AdminModelTemplateManagement {
|
|
199
216
|
static CreateModelTemplate(req: HydraManagement_apiModelV1alpha1Model.CreateModelTemplateRequest, initReq?: fm.InitReq): Promise<HydraManagement_apiModelV1alpha1Model.ModelTemplate> {
|
|
@@ -6,6 +6,13 @@
|
|
|
6
6
|
|
|
7
7
|
import * as HydraCommonCommon from "../../../common/common.pb"
|
|
8
8
|
import * as fm from "../../../fetch.pb"
|
|
9
|
+
import * as GoogleProtobufTimestamp from "../../../google/protobuf/timestamp.pb"
|
|
10
|
+
|
|
11
|
+
export enum DuplicatePolicy {
|
|
12
|
+
DUPLICATE_POLICY_SKIP = "DUPLICATE_POLICY_SKIP",
|
|
13
|
+
DUPLICATE_POLICY_UPDATE = "DUPLICATE_POLICY_UPDATE",
|
|
14
|
+
}
|
|
15
|
+
|
|
9
16
|
export type CreateProviderRequest = {
|
|
10
17
|
providerId?: string
|
|
11
18
|
providerName?: HydraCommonCommon.I18nName
|
|
@@ -18,6 +25,7 @@ export type Provider = {
|
|
|
18
25
|
providerName?: HydraCommonCommon.I18nName
|
|
19
26
|
providerDescription?: HydraCommonCommon.I18nName
|
|
20
27
|
providerAvatar?: string
|
|
28
|
+
createTime?: GoogleProtobufTimestamp.Timestamp
|
|
21
29
|
}
|
|
22
30
|
|
|
23
31
|
export type UpdateProviderRequest = {
|
|
@@ -40,6 +48,29 @@ export type SingleProviderRequest = {
|
|
|
40
48
|
providerId?: string
|
|
41
49
|
}
|
|
42
50
|
|
|
51
|
+
export type BatchCreateProvidersRequest = {
|
|
52
|
+
providers?: CreateProviderRequest[]
|
|
53
|
+
duplicatePolicy?: DuplicatePolicy
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
export type BatchCreateProvidersResponse = {
|
|
57
|
+
items?: Provider[]
|
|
58
|
+
skippedNames?: string[]
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
export type ParsedProvider = {
|
|
62
|
+
provider?: Provider
|
|
63
|
+
error?: string
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
export type ParseProvidersRequest = {
|
|
67
|
+
providers?: CreateProviderRequest[]
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
export type ParseProvidersResponse = {
|
|
71
|
+
items?: ParsedProvider[]
|
|
72
|
+
}
|
|
73
|
+
|
|
43
74
|
export class AdminProviderManagement {
|
|
44
75
|
static CreateProvider(req: CreateProviderRequest, initReq?: fm.InitReq): Promise<Provider> {
|
|
45
76
|
return fm.fetchReq<CreateProviderRequest, Provider>(`/apis/admin.hydra.io/v1alpha1/providers`, {...initReq, method: "POST", body: JSON.stringify(req, fm.replacer)})
|
|
@@ -56,4 +87,10 @@ export class AdminProviderManagement {
|
|
|
56
87
|
static DeleteProvider(req: SingleProviderRequest, initReq?: fm.InitReq): Promise<Provider> {
|
|
57
88
|
return fm.fetchReq<SingleProviderRequest, Provider>(`/apis/admin.hydra.io/v1alpha1/providers/${req["providerId"]}`, {...initReq, method: "DELETE"})
|
|
58
89
|
}
|
|
90
|
+
static ParseProviderSpecs(req: ParseProvidersRequest, initReq?: fm.InitReq): Promise<ParseProvidersResponse> {
|
|
91
|
+
return fm.fetchReq<ParseProvidersRequest, ParseProvidersResponse>(`/apis/admin.hydra.io/v1alpha1/providers:parse`, {...initReq, method: "POST", body: JSON.stringify(req, fm.replacer)})
|
|
92
|
+
}
|
|
93
|
+
static BatchCreateProviders(req: BatchCreateProvidersRequest, initReq?: fm.InitReq): Promise<BatchCreateProvidersResponse> {
|
|
94
|
+
return fm.fetchReq<BatchCreateProvidersRequest, BatchCreateProvidersResponse>(`/apis/admin.hydra.io/v1alpha1/providers:batch_create`, {...initReq, method: "POST", body: JSON.stringify(req, fm.replacer)})
|
|
95
|
+
}
|
|
59
96
|
}
|
package/common/errorcode.ts
CHANGED
|
@@ -30,6 +30,9 @@ export enum ErrorCode {
|
|
|
30
30
|
// EN: Request mode not match
|
|
31
31
|
// ZH: 请求模式不匹配。
|
|
32
32
|
SYSTEM_REQUEST_MODE_ERROR = "SYSTEM-REQUEST_MODE_ERROR",
|
|
33
|
+
// EN: upstream service unavailable: %v
|
|
34
|
+
// ZH: 上游服务暂时不可用:%v
|
|
35
|
+
SYSTEM_UPSTREAM_UNAVAILABLE = "SYSTEM-UPSTREAM_UNAVAILABLE",
|
|
33
36
|
// EN: Requested resource conflicted error: %v
|
|
34
37
|
// ZH: 请求的资源冲突错误:%v
|
|
35
38
|
USER_CONFLICT_ERROR = "USER-CONFLICT_ERROR",
|
|
@@ -85,6 +85,16 @@ export type DeleteWSAPIKeyRequest = {
|
|
|
85
85
|
workspace?: number
|
|
86
86
|
}
|
|
87
87
|
|
|
88
|
+
export type GetWSAPIKeySecretRequest = {
|
|
89
|
+
id?: string
|
|
90
|
+
workspace?: number
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
export type APIKeySecret = {
|
|
94
|
+
id?: string
|
|
95
|
+
key?: string
|
|
96
|
+
}
|
|
97
|
+
|
|
88
98
|
export type UpdateWSAPIKeyQuotaRequest = {
|
|
89
99
|
id?: string
|
|
90
100
|
workspace?: number
|
|
@@ -102,6 +112,10 @@ export type DeleteAPIKeyRequest = {
|
|
|
102
112
|
id?: string
|
|
103
113
|
}
|
|
104
114
|
|
|
115
|
+
export type GetAPIKeySecretRequest = {
|
|
116
|
+
id?: string
|
|
117
|
+
}
|
|
118
|
+
|
|
105
119
|
export type CheckAPIKeyCreationRequest = {
|
|
106
120
|
}
|
|
107
121
|
|
|
@@ -157,6 +171,12 @@ export class APIKeyManagement {
|
|
|
157
171
|
static ListAPIKey(req: ListAPIKeyRequest, initReq?: fm.InitReq): Promise<ListAPIKeyResponse> {
|
|
158
172
|
return fm.fetchReq<ListAPIKeyRequest, ListAPIKeyResponse>(`/apis/hydra.io/v1alpha1/apikeys?${fm.renderURLSearchParams(req, [])}`, {...initReq, method: "GET"})
|
|
159
173
|
}
|
|
174
|
+
static ListAPIKeyMasked(req: ListAPIKeyRequest, initReq?: fm.InitReq): Promise<ListAPIKeyResponse> {
|
|
175
|
+
return fm.fetchReq<ListAPIKeyRequest, ListAPIKeyResponse>(`/apis/hydra.io/v1alpha1/masked-apikeys?${fm.renderURLSearchParams(req, [])}`, {...initReq, method: "GET"})
|
|
176
|
+
}
|
|
177
|
+
static GetAPIKeySecret(req: GetAPIKeySecretRequest, initReq?: fm.InitReq): Promise<APIKeySecret> {
|
|
178
|
+
return fm.fetchReq<GetAPIKeySecretRequest, APIKeySecret>(`/apis/hydra.io/v1alpha1/apikeys/${req["id"]}/secret?${fm.renderURLSearchParams(req, ["id"])}`, {...initReq, method: "GET"})
|
|
179
|
+
}
|
|
160
180
|
static DeleteAPIKey(req: DeleteAPIKeyRequest, initReq?: fm.InitReq): Promise<APIKey> {
|
|
161
181
|
return fm.fetchReq<DeleteAPIKeyRequest, APIKey>(`/apis/hydra.io/v1alpha1/apikeys/${req["id"]}`, {...initReq, method: "DELETE", body: JSON.stringify(req, fm.replacer)})
|
|
162
182
|
}
|
|
@@ -177,6 +197,12 @@ export class WSAPIKeyManagement {
|
|
|
177
197
|
static ListMyWSAPIKeys(req: ListWSAPIKeyRequest, initReq?: fm.InitReq): Promise<ListAPIKeyResponse> {
|
|
178
198
|
return fm.fetchReq<ListWSAPIKeyRequest, ListAPIKeyResponse>(`/apis/hydra.io/v1alpha1/workspaces/${req["workspace"]}/my-apikeys?${fm.renderURLSearchParams(req, ["workspace"])}`, {...initReq, method: "GET"})
|
|
179
199
|
}
|
|
200
|
+
static ListWSAPIKeyMasked(req: ListWSAPIKeyRequest, initReq?: fm.InitReq): Promise<ListAPIKeyResponse> {
|
|
201
|
+
return fm.fetchReq<ListWSAPIKeyRequest, ListAPIKeyResponse>(`/apis/hydra.io/v1alpha1/workspaces/${req["workspace"]}/masked-apikeys?${fm.renderURLSearchParams(req, ["workspace"])}`, {...initReq, method: "GET"})
|
|
202
|
+
}
|
|
203
|
+
static GetWSAPIKeySecret(req: GetWSAPIKeySecretRequest, initReq?: fm.InitReq): Promise<APIKeySecret> {
|
|
204
|
+
return fm.fetchReq<GetWSAPIKeySecretRequest, APIKeySecret>(`/apis/hydra.io/v1alpha1/workspaces/${req["workspace"]}/apikeys/${req["id"]}/secret?${fm.renderURLSearchParams(req, ["workspace", "id"])}`, {...initReq, method: "GET"})
|
|
205
|
+
}
|
|
180
206
|
static DeleteWSAPIKey(req: DeleteWSAPIKeyRequest, initReq?: fm.InitReq): Promise<APIKey> {
|
|
181
207
|
return fm.fetchReq<DeleteWSAPIKeyRequest, APIKey>(`/apis/hydra.io/v1alpha1/workspaces/${req["workspace"]}/apikeys/${req["id"]}`, {...initReq, method: "DELETE", body: JSON.stringify(req, fm.replacer)})
|
|
182
208
|
}
|
|
@@ -18,6 +18,7 @@ export enum UserPermission {
|
|
|
18
18
|
APIKEY_GET = "APIKEY_GET",
|
|
19
19
|
APIKEY_CREATE = "APIKEY_CREATE",
|
|
20
20
|
APIKEY_DELETE = "APIKEY_DELETE",
|
|
21
|
+
APIKEY_UPDATE = "APIKEY_UPDATE",
|
|
21
22
|
CLUSTER_GET = "CLUSTER_GET",
|
|
22
23
|
FILES_STORAGE_GET = "FILES_STORAGE_GET",
|
|
23
24
|
FILES_STORAGE_CREATE = "FILES_STORAGE_CREATE",
|
|
@@ -70,7 +70,7 @@ export type ListWSInstanceTokenUsageRequest = {
|
|
|
70
70
|
}
|
|
71
71
|
|
|
72
72
|
export type InstanceTokenUsage = {
|
|
73
|
-
|
|
73
|
+
apiKeyId?: string
|
|
74
74
|
instanceName?: string
|
|
75
75
|
modelName?: string
|
|
76
76
|
inputTokens?: string
|
|
@@ -79,6 +79,7 @@ export type InstanceTokenUsage = {
|
|
|
79
79
|
totalTokens?: string
|
|
80
80
|
requestCount?: string
|
|
81
81
|
lastUsedTime?: GoogleProtobufTimestamp.Timestamp
|
|
82
|
+
username?: string
|
|
82
83
|
}
|
|
83
84
|
|
|
84
85
|
export type ListInstanceTokenUsageResponse = {
|
|
@@ -9,6 +9,15 @@ import * as fm from "../../../fetch.pb"
|
|
|
9
9
|
import * as GoogleProtobufEmpty from "../../../google/protobuf/empty.pb"
|
|
10
10
|
import * as GoogleProtobufTimestamp from "../../../google/protobuf/timestamp.pb"
|
|
11
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
|
+
|
|
12
21
|
export enum ModelSupportFeature {
|
|
13
22
|
MODEL_SUPPORT_TYPE_UNSPECIFIED = "MODEL_SUPPORT_TYPE_UNSPECIFIED",
|
|
14
23
|
TEXT_GENERATION = "TEXT_GENERATION",
|
|
@@ -22,6 +31,22 @@ export enum ModelSupportFeature {
|
|
|
22
31
|
AUDIO_TO_AUDIO = "AUDIO_TO_AUDIO",
|
|
23
32
|
AUDIO_TO_TEXT = "AUDIO_TO_TEXT",
|
|
24
33
|
TOOLS = "TOOLS",
|
|
34
|
+
TEXT_TO_AUDIO = "TEXT_TO_AUDIO",
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export enum ContextLengthRange {
|
|
38
|
+
CONTEXT_LENGTH_RANGE_UNSPECIFIED = "CONTEXT_LENGTH_RANGE_UNSPECIFIED",
|
|
39
|
+
CTX_0_32K = "CTX_0_32K",
|
|
40
|
+
CTX_32K_128K = "CTX_32K_128K",
|
|
41
|
+
CTX_128K_256K = "CTX_128K_256K",
|
|
42
|
+
CTX_256K_1M = "CTX_256K_1M",
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
export enum ModelOperationTag {
|
|
46
|
+
MODEL_OPERATION_TAG_UNSPECIFIED = "MODEL_OPERATION_TAG_UNSPECIFIED",
|
|
47
|
+
FEATURED = "FEATURED",
|
|
48
|
+
HOT = "HOT",
|
|
49
|
+
DEPRECATING = "DEPRECATING",
|
|
25
50
|
}
|
|
26
51
|
|
|
27
52
|
export enum SkuDiscountScheduleType {
|
|
@@ -43,6 +68,16 @@ export enum DeployTemplateInferenceRuntime {
|
|
|
43
68
|
IMAGE_GEN = "IMAGE_GEN",
|
|
44
69
|
}
|
|
45
70
|
|
|
71
|
+
export type ModelSupportFeatureRoute = {
|
|
72
|
+
modelSupportFeature?: ModelSupportFeature
|
|
73
|
+
defaultPath?: string
|
|
74
|
+
dependency?: ModelSupportFeature
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
export type ModelSupportFeatureConfig = {
|
|
78
|
+
items?: ModelSupportFeatureRoute[]
|
|
79
|
+
}
|
|
80
|
+
|
|
46
81
|
export type ModelPriceDiscountInfo = {
|
|
47
82
|
discountRate?: number
|
|
48
83
|
discountName?: string
|
|
@@ -89,6 +124,10 @@ export type Model = {
|
|
|
89
124
|
publicModelConfig?: PublicModelConfig
|
|
90
125
|
modelDeploymentsExists?: boolean
|
|
91
126
|
visible?: string
|
|
127
|
+
parameterSize?: number
|
|
128
|
+
contextLength?: ContextLengthRange
|
|
129
|
+
operationTags?: ModelOperationTag[]
|
|
130
|
+
publishTimestamp?: GoogleProtobufTimestamp.Timestamp
|
|
92
131
|
}
|
|
93
132
|
|
|
94
133
|
export type ListModelRequest = {
|
|
@@ -138,6 +177,9 @@ export type DeployTemplate = {
|
|
|
138
177
|
runtimeCommand?: string
|
|
139
178
|
templateName?: string
|
|
140
179
|
templateDescription?: string
|
|
180
|
+
workerCommand?: string
|
|
181
|
+
workerEnv?: EnvVar[]
|
|
182
|
+
distributed?: boolean
|
|
141
183
|
}
|
|
142
184
|
|
|
143
185
|
export type EnvVar = {
|
|
@@ -188,6 +230,10 @@ export type WSModel = {
|
|
|
188
230
|
modelDeploymentsExists?: boolean
|
|
189
231
|
visible?: string
|
|
190
232
|
tokenWeight?: string
|
|
233
|
+
parameterSize?: number
|
|
234
|
+
contextLength?: ContextLengthRange
|
|
235
|
+
operationTags?: ModelOperationTag[]
|
|
236
|
+
publishTimestamp?: GoogleProtobufTimestamp.Timestamp
|
|
191
237
|
}
|
|
192
238
|
|
|
193
239
|
export type CreatePrivateModelRequest = {
|
|
@@ -241,18 +287,29 @@ export type DeleteModelTemplateRequest = {
|
|
|
241
287
|
modelId?: string
|
|
242
288
|
}
|
|
243
289
|
|
|
244
|
-
|
|
290
|
+
|
|
291
|
+
/* hydra modified */ export type BaseListModelTemplatesRequest = {
|
|
245
292
|
workspace?: number
|
|
246
293
|
modelId?: string
|
|
247
294
|
inferenceRuntime?: string
|
|
248
295
|
page?: HydraCommonCommon.Pagination
|
|
249
296
|
}
|
|
250
297
|
|
|
298
|
+
export type ListModelTemplatesRequest = BaseListModelTemplatesRequest
|
|
299
|
+
& OneOf<{ distributed: boolean }>
|
|
300
|
+
|
|
251
301
|
export type ListModelTemplatesResponse = {
|
|
252
302
|
items?: ModelTemplate[]
|
|
253
303
|
page?: HydraCommonCommon.Pagination
|
|
254
304
|
}
|
|
255
305
|
|
|
306
|
+
export type GetModelSupportFeatureConfigRequest = {
|
|
307
|
+
}
|
|
308
|
+
|
|
309
|
+
export type GetModelSupportFeatureConfigResponse = {
|
|
310
|
+
config?: ModelSupportFeatureConfig
|
|
311
|
+
}
|
|
312
|
+
|
|
256
313
|
export class ModelManagement {
|
|
257
314
|
static GetModel(req: SingleModelRequest, initReq?: fm.InitReq): Promise<Model> {
|
|
258
315
|
return fm.fetchReq<SingleModelRequest, Model>(`/apis/hydra.io/v1alpha1/models/${req["modelId"]}?${fm.renderURLSearchParams(req, ["modelId"])}`, {...initReq, method: "GET"})
|
|
@@ -300,4 +357,9 @@ export class WSModelTemplateManagement {
|
|
|
300
357
|
static ListWSModelTemplates(req: ListModelTemplatesRequest, initReq?: fm.InitReq): Promise<ListModelTemplatesResponse> {
|
|
301
358
|
return fm.fetchReq<ListModelTemplatesRequest, ListModelTemplatesResponse>(`/apis/hydra.io/v1alpha1/workspaces/${req["workspace"]}/models/${req["modelId"]}/model-templates?${fm.renderURLSearchParams(req, ["workspace", "modelId"])}`, {...initReq, method: "GET"})
|
|
302
359
|
}
|
|
360
|
+
}
|
|
361
|
+
export class ModelConfigManagement {
|
|
362
|
+
static GetModelSupportFeatureConfig(req: GetModelSupportFeatureConfigRequest, initReq?: fm.InitReq): Promise<GetModelSupportFeatureConfigResponse> {
|
|
363
|
+
return fm.fetchReq<GetModelSupportFeatureConfigRequest, GetModelSupportFeatureConfigResponse>(`/apis/hydra.io/v1alpha1/model-support-features/config?${fm.renderURLSearchParams(req, [])}`, {...initReq, method: "GET"})
|
|
364
|
+
}
|
|
303
365
|
}
|
|
@@ -65,9 +65,17 @@ export enum DeployDetectConditionType {
|
|
|
65
65
|
MODEL_IMAGE_DOWNLOADED = "MODEL_IMAGE_DOWNLOADED",
|
|
66
66
|
}
|
|
67
67
|
|
|
68
|
+
export enum BuiltinEnvVarScope {
|
|
69
|
+
SCOPE_ALL = "SCOPE_ALL",
|
|
70
|
+
SCOPE_DISTRIBUTED = "SCOPE_DISTRIBUTED",
|
|
71
|
+
SCOPE_LEADER = "SCOPE_LEADER",
|
|
72
|
+
SCOPE_WORKER = "SCOPE_WORKER",
|
|
73
|
+
}
|
|
74
|
+
|
|
68
75
|
export enum ModelServingActionRequestAction {
|
|
69
76
|
MODEL_SERVING_ACTION_UNSPECIFIED = "MODEL_SERVING_ACTION_UNSPECIFIED",
|
|
70
77
|
START = "START",
|
|
78
|
+
STOP = "STOP",
|
|
71
79
|
}
|
|
72
80
|
|
|
73
81
|
export enum WSModelServingActionRequestAction {
|
|
@@ -156,6 +164,8 @@ export type RuntimeConfig = {
|
|
|
156
164
|
imagePullSecretName?: string[]
|
|
157
165
|
runtimeCommand?: string
|
|
158
166
|
env?: EnvVar[]
|
|
167
|
+
workerCommand?: string
|
|
168
|
+
workerEnv?: EnvVar[]
|
|
159
169
|
}
|
|
160
170
|
|
|
161
171
|
export type CreateModelServingRequest = {
|
|
@@ -343,12 +353,14 @@ export type ListBuiltinEnvVarsRequest = {
|
|
|
343
353
|
|
|
344
354
|
export type BuiltinEnvVar = {
|
|
345
355
|
name?: string
|
|
346
|
-
description?:
|
|
356
|
+
description?: HydraCommonCommon.I18nName
|
|
347
357
|
example?: string
|
|
348
358
|
}
|
|
349
359
|
|
|
350
360
|
export type ListBuiltinEnvVarsResponse = {
|
|
351
|
-
|
|
361
|
+
single?: BuiltinEnvVar[]
|
|
362
|
+
leader?: BuiltinEnvVar[]
|
|
363
|
+
worker?: BuiltinEnvVar[]
|
|
352
364
|
}
|
|
353
365
|
|
|
354
366
|
export class ModelServingManagement {
|