@daocloud-proto/infery 0.0.0-dev-5b50f43a

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,109 @@
1
+ /* eslint-disable */
2
+ // @ts-nocheck
3
+ /*
4
+ * This file is a generated Typescript file for GRPC Gateway, DO NOT MODIFY
5
+ */
6
+
7
+ export enum DBType {
8
+ DB_TYPE_UNSPECIFIED = "DB_TYPE_UNSPECIFIED",
9
+ MYSQL = "MYSQL",
10
+ POSTGRESQL = "POSTGRESQL",
11
+ SQLITE = "SQLITE",
12
+ }
13
+
14
+ export enum InferenceStack {
15
+ INFERENCE_STACK_UNSPECIFIED = "INFERENCE_STACK_UNSPECIFIED",
16
+ INFERENCE_STACK_LLM_D = "INFERENCE_STACK_LLM_D",
17
+ INFERENCE_STACK_DYNAMO = "INFERENCE_STACK_DYNAMO",
18
+ }
19
+
20
+ export enum DisaggregationMode {
21
+ DISAGGREGATION_MODE_UNSPECIFIED = "DISAGGREGATION_MODE_UNSPECIFIED",
22
+ DISAGGREGATION_MODE_AGGREGATED = "DISAGGREGATION_MODE_AGGREGATED",
23
+ DISAGGREGATION_MODE_DISAGGREGATED = "DISAGGREGATION_MODE_DISAGGREGATED",
24
+ DISAGGREGATION_MODE_EPD = "DISAGGREGATION_MODE_EPD",
25
+ }
26
+
27
+ export enum SearchIndexFieldBuilderType {
28
+ FIELD_TYPE_UNSPECIFIED = "FIELD_TYPE_UNSPECIFIED",
29
+ FILED = "FILED",
30
+ JSON_FILED_PATH = "JSON_FILED_PATH",
31
+ CONST = "CONST",
32
+ I18N_FIELD = "I18N_FIELD",
33
+ SUBQUERY = "SUBQUERY",
34
+ FUNC_REPLACE = "FUNC_REPLACE",
35
+ FUNC_CONCAT = "FUNC_CONCAT",
36
+ }
37
+
38
+ export type NoParamsQuery = {
39
+ }
40
+
41
+ export type Pagination = {
42
+ total?: number
43
+ page?: number
44
+ pageSize?: number
45
+ sort?: string
46
+ search?: string
47
+ }
48
+
49
+ export type I18nName = {
50
+ zhCn?: string
51
+ enUs?: string
52
+ }
53
+
54
+ export type SearchIndexFieldBuilderFuncCall = {
55
+ fields?: SearchIndexFieldBuilder[]
56
+ }
57
+
58
+ export type SearchIndexFieldBuilder = {
59
+ type?: SearchIndexFieldBuilderType
60
+ fieldName?: string
61
+ jsonFieldPath?: string[]
62
+ constValue?: string
63
+ funcCall?: SearchIndexFieldBuilderFuncCall
64
+ }
65
+
66
+ export type SearchIndex = {
67
+ searchKey?: string
68
+ fieldBuilder?: SearchIndexFieldBuilder
69
+ }
70
+
71
+ export type AuthResourceAction = {
72
+ resourceType?: string
73
+ action?: string
74
+ }
75
+
76
+ export type Auth = {
77
+ skipAuth?: boolean
78
+ user?: AuthResourceAction
79
+ }
80
+
81
+ export type AuditObject = {
82
+ nameKey?: string
83
+ namespaceKey?: string
84
+ clusterKey?: string
85
+ }
86
+
87
+ export type AuditObjectKind = {
88
+ kindName?: string
89
+ kindGroup?: string
90
+ kindVersion?: string
91
+ kindKey?: string
92
+ }
93
+
94
+ export type Audit = {
95
+ object?: AuditObject
96
+ objectKind?: AuditObjectKind
97
+ action?: string
98
+ actionKey?: string
99
+ customObject?: boolean
100
+ extraExplainKeys?: string[]
101
+ }
102
+
103
+ export type AuditObject = {
104
+ namespace?: string
105
+ name?: string
106
+ kind?: string
107
+ group?: string
108
+ version?: string
109
+ }
@@ -0,0 +1,10 @@
1
+ /* eslint-disable */
2
+ // @ts-nocheck
3
+ /*
4
+ * This file is a generated Typescript file for GRPC Gateway, DO NOT MODIFY
5
+ */
6
+ export type RPCError = {
7
+ id?: string
8
+ message?: string
9
+ targets?: string[]
10
+ }
@@ -0,0 +1,23 @@
1
+ // auto generated by tools/gen-error-ts/main.go
2
+ export enum ErrorCode {
3
+ // EN: internal server error: %v
4
+ SYSTEM_INTERNAL_ERROR = "SYSTEM-INTERNAL_ERROR",
5
+ // EN: resource not found: %v
6
+ SYSTEM_NOT_FOUND_ERROR = "SYSTEM-NOT_FOUND_ERROR",
7
+ // EN: request params error: %v
8
+ SYSTEM_PARAMS_ERROR = "SYSTEM-PARAMS_ERROR",
9
+ // EN: not implemented: %v
10
+ SYSTEM_UNIMPLEMENTED = "SYSTEM-UNIMPLEMENTED",
11
+ // EN: upstream service unavailable: %v
12
+ SYSTEM_UPSTREAM_UNAVAILABLE = "SYSTEM-UPSTREAM_UNAVAILABLE",
13
+ // EN: Requested resource conflicted error: %v
14
+ USER_CONFLICT_ERROR = "USER-CONFLICT_ERROR",
15
+ // EN: Failed precondition error: %v
16
+ USER_FAILED_PRECONDITION_ERROR = "USER-FAILED_PRECONDITION_ERROR",
17
+ // EN: out of page: %v
18
+ USER_OUT_OF_PAGE = "USER-OUT_OF_PAGE",
19
+ // EN: permission denied: %v
20
+ USER_PERMISSION_DENIED = "USER-PERMISSION_DENIED",
21
+ // EN: unauthorized request
22
+ USER_UNAUTHORIZED = "USER-UNAUTHORIZED",
23
+ }
package/fetch.pb.ts ADDED
@@ -0,0 +1,341 @@
1
+ /* eslint-disable */
2
+ // @ts-nocheck
3
+ /*
4
+ * This file is a generated Typescript file for GRPC Gateway, DO NOT MODIFY
5
+ */
6
+
7
+ /**
8
+ * base64 encoder and decoder
9
+ * Copied and adapted from https://github.com/protobufjs/protobuf.js/blob/master/lib/base64/index.js
10
+ */
11
+ // Base64 encoding table
12
+ const b64 = new Array(64);
13
+
14
+ // Base64 decoding table
15
+ const s64 = new Array(123);
16
+
17
+ // 65..90, 97..122, 48..57, 43, 47
18
+ for (let i = 0; i < 64;)
19
+ s64[b64[i] = i < 26 ? i + 65 : i < 52 ? i + 71 : i < 62 ? i - 4 : i - 59 | 43] = i++;
20
+
21
+ export function b64Encode(buffer: Uint8Array, start: number, end: number): string {
22
+ let parts: string[] = null;
23
+ const chunk = [];
24
+ let i = 0, // output index
25
+ j = 0, // goto index
26
+ t; // temporary
27
+ while (start < end) {
28
+ const b = buffer[start++];
29
+ switch (j) {
30
+ case 0:
31
+ chunk[i++] = b64[b >> 2];
32
+ t = (b & 3) << 4;
33
+ j = 1;
34
+ break;
35
+ case 1:
36
+ chunk[i++] = b64[t | b >> 4];
37
+ t = (b & 15) << 2;
38
+ j = 2;
39
+ break;
40
+ case 2:
41
+ chunk[i++] = b64[t | b >> 6];
42
+ chunk[i++] = b64[b & 63];
43
+ j = 0;
44
+ break;
45
+ }
46
+ if (i > 8191) {
47
+ (parts || (parts = [])).push(String.fromCharCode.apply(String, chunk));
48
+ i = 0;
49
+ }
50
+ }
51
+ if (j) {
52
+ chunk[i++] = b64[t];
53
+ chunk[i++] = 61;
54
+ if (j === 1)
55
+ chunk[i++] = 61;
56
+ }
57
+ if (parts) {
58
+ if (i)
59
+ parts.push(String.fromCharCode.apply(String, chunk.slice(0, i)));
60
+ return parts.join("");
61
+ }
62
+ return String.fromCharCode.apply(String, chunk.slice(0, i));
63
+ }
64
+
65
+ const invalidEncoding = "invalid encoding";
66
+
67
+ export function b64Decode(s: string): Uint8Array {
68
+ const buffer = [];
69
+ let offset = 0;
70
+ let j = 0, // goto index
71
+ t; // temporary
72
+ for (let i = 0; i < s.length;) {
73
+ let c = s.charCodeAt(i++);
74
+ if (c === 61 && j > 1)
75
+ break;
76
+ if ((c = s64[c]) === undefined)
77
+ throw Error(invalidEncoding);
78
+ switch (j) {
79
+ case 0:
80
+ t = c;
81
+ j = 1;
82
+ break;
83
+ case 1:
84
+ buffer[offset++] = t << 2 | (c & 48) >> 4;
85
+ t = c;
86
+ j = 2;
87
+ break;
88
+ case 2:
89
+ buffer[offset++] = (t & 15) << 4 | (c & 60) >> 2;
90
+ t = c;
91
+ j = 3;
92
+ break;
93
+ case 3:
94
+ buffer[offset++] = (t & 3) << 6 | c;
95
+ j = 0;
96
+ break;
97
+ }
98
+ }
99
+ if (j === 1)
100
+ throw Error(invalidEncoding);
101
+ return new Uint8Array(buffer);
102
+ }
103
+
104
+ function b64Test(s: string): boolean {
105
+ return /^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(s);
106
+ }
107
+
108
+ export interface InitReq extends RequestInit {
109
+ pathPrefix?: string
110
+ }
111
+
112
+ export function replacer(key: any, value: any): any {
113
+ if(value && value.constructor === Uint8Array) {
114
+ return b64Encode(value, 0, value.length);
115
+ }
116
+
117
+ return value;
118
+ }
119
+
120
+ export function fetchReq<I, O>(path: string, init?: InitReq): Promise<O> {
121
+ const {pathPrefix, ...req} = init || {}
122
+
123
+ const url = pathPrefix ? `${pathPrefix}${path}` : path
124
+
125
+ return fetch(url, req).then(r => r.json().then((body: O) => {
126
+ if (!r.ok) { throw body; }
127
+ return body;
128
+ })) as Promise<O>
129
+ }
130
+
131
+ // NotifyStreamEntityArrival is a callback that will be called on streaming entity arrival
132
+ export type NotifyStreamEntityArrival<T> = (resp: T) => void
133
+
134
+ /**
135
+ * fetchStreamingRequest is able to handle grpc-gateway server side streaming call
136
+ * it takes NotifyStreamEntityArrival that lets users respond to entity arrival during the call
137
+ * all entities will be returned as an array after the call finishes.
138
+ **/
139
+ export async function fetchStreamingRequest<S, R>(path: string, callback?: NotifyStreamEntityArrival<R>, init?: InitReq) {
140
+ const {pathPrefix, ...req} = init || {}
141
+ const url = pathPrefix ?`${pathPrefix}${path}` : path
142
+ const result = await fetch(url, req)
143
+ // needs to use the .ok to check the status of HTTP status code
144
+ // http other than 200 will not throw an error, instead the .ok will become false.
145
+ // see https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API/Using_Fetch#
146
+ if (!result.ok) {
147
+ const resp = await result.json()
148
+ const errMsg = resp.error && resp.error.message ? resp.error.message : ""
149
+ throw new Error(errMsg)
150
+ }
151
+
152
+ if (!result.body) {
153
+ throw new Error("response doesnt have a body")
154
+ }
155
+
156
+ await result.body
157
+ .pipeThrough(new TextDecoderStream())
158
+ .pipeThrough<R>(getNewLineDelimitedJSONDecodingStream<R>())
159
+ .pipeTo(getNotifyEntityArrivalSink((e: R) => {
160
+ if (callback) {
161
+ callback(e)
162
+ }
163
+ }))
164
+
165
+ // wait for the streaming to finish and return the success respond
166
+ return
167
+ }
168
+
169
+ /**
170
+ * JSONStringStreamController represents the transform controller that's able to transform the incoming
171
+ * new line delimited json content stream into entities and able to push the entity to the down stream
172
+ */
173
+ interface JSONStringStreamController<T> extends TransformStreamDefaultController {
174
+ buf?: string
175
+ pos?: number
176
+ enqueue: (s: T) => void
177
+ }
178
+
179
+ /**
180
+ * getNewLineDelimitedJSONDecodingStream returns a TransformStream that's able to handle new line delimited json stream content into parsed entities
181
+ */
182
+ function getNewLineDelimitedJSONDecodingStream<T>(): TransformStream<string, T> {
183
+ return new TransformStream({
184
+ start(controller: JSONStringStreamController<T>) {
185
+ controller.buf = ''
186
+ controller.pos = 0
187
+ },
188
+
189
+ transform(chunk: string, controller: JSONStringStreamController<T>) {
190
+ if (controller.buf === undefined) {
191
+ controller.buf = ''
192
+ }
193
+ if (controller.pos === undefined) {
194
+ controller.pos = 0
195
+ }
196
+ controller.buf += chunk
197
+ while (controller.pos < controller.buf.length) {
198
+ if (controller.buf[controller.pos] === '\n') {
199
+ const line = controller.buf.substring(0, controller.pos)
200
+ const response = JSON.parse(line)
201
+ controller.enqueue(response.result)
202
+ controller.buf = controller.buf.substring(controller.pos + 1)
203
+ controller.pos = 0
204
+ } else {
205
+ ++controller.pos
206
+ }
207
+ }
208
+ }
209
+ })
210
+
211
+ }
212
+
213
+ /**
214
+ * getNotifyEntityArrivalSink takes the NotifyStreamEntityArrival callback and return
215
+ * a sink that will call the callback on entity arrival
216
+ * @param notifyCallback
217
+ */
218
+ function getNotifyEntityArrivalSink<T>(notifyCallback: NotifyStreamEntityArrival<T>) {
219
+ return new WritableStream<T>({
220
+ write(entity: T) {
221
+ notifyCallback(entity)
222
+ }
223
+ })
224
+ }
225
+
226
+ type Primitive = string | boolean | number;
227
+ type RequestPayload = Record<string, unknown>;
228
+ type FlattenedRequestPayload = Record<string, Primitive | Array<Primitive>>;
229
+
230
+ /**
231
+ * Checks if given value is a plain object
232
+ * Logic copied and adapted from below source:
233
+ * https://github.com/char0n/ramda-adjunct/blob/master/src/isPlainObj.js
234
+ * @param {unknown} value
235
+ * @return {boolean}
236
+ */
237
+ function isPlainObject(value: unknown): boolean {
238
+ const isObject =
239
+ Object.prototype.toString.call(value).slice(8, -1) === "Object";
240
+ const isObjLike = value !== null && isObject;
241
+
242
+ if (!isObjLike || !isObject) {
243
+ return false;
244
+ }
245
+
246
+ const proto = Object.getPrototypeOf(value);
247
+
248
+ const hasObjectConstructor =
249
+ typeof proto === "object" &&
250
+ proto.constructor === Object.prototype.constructor;
251
+
252
+ return hasObjectConstructor;
253
+ }
254
+
255
+ /**
256
+ * Checks if given value is of a primitive type
257
+ * @param {unknown} value
258
+ * @return {boolean}
259
+ */
260
+ function isPrimitive(value: unknown): boolean {
261
+ return ["string", "number", "boolean"].some(t => typeof value === t);
262
+ }
263
+
264
+ /**
265
+ * Checks if given primitive is zero-value
266
+ * @param {Primitive} value
267
+ * @return {boolean}
268
+ */
269
+ function isZeroValuePrimitive(value: Primitive): boolean {
270
+ return value === false || value === 0 || value === "";
271
+ }
272
+
273
+ /**
274
+ * Flattens a deeply nested request payload and returns an object
275
+ * with only primitive values and non-empty array of primitive values
276
+ * as per https://github.com/googleapis/googleapis/blob/master/google/api/http.proto
277
+ * @param {RequestPayload} requestPayload
278
+ * @param {String} path
279
+ * @return {FlattenedRequestPayload>}
280
+ */
281
+ function flattenRequestPayload<T extends RequestPayload>(
282
+ requestPayload: T,
283
+ path: string = ""
284
+ ): FlattenedRequestPayload {
285
+ return Object.keys(requestPayload).reduce(
286
+ (acc: T, key: string): T => {
287
+ const value = requestPayload[key];
288
+ const newPath = path ? [path, key].join(".") : key;
289
+
290
+ const isNonEmptyPrimitiveArray =
291
+ Array.isArray(value) &&
292
+ value.every(v => isPrimitive(v)) &&
293
+ value.length > 0;
294
+
295
+ const isNonZeroValuePrimitive =
296
+ isPrimitive(value) && !isZeroValuePrimitive(value as Primitive);
297
+
298
+ let objectToMerge = {};
299
+
300
+ if (isPlainObject(value)) {
301
+ objectToMerge = flattenRequestPayload(value as RequestPayload, newPath);
302
+ } else if (isNonZeroValuePrimitive || isNonEmptyPrimitiveArray) {
303
+ objectToMerge = { [newPath]: value };
304
+ }
305
+
306
+ return { ...acc, ...objectToMerge };
307
+ },
308
+ {} as T
309
+ ) as FlattenedRequestPayload;
310
+ }
311
+
312
+ /**
313
+ * Renders a deeply nested request payload into a string of URL search
314
+ * parameters by first flattening the request payload and then removing keys
315
+ * which are already present in the URL path.
316
+ * @param {RequestPayload} requestPayload
317
+ * @param {string[]} urlPathParams
318
+ * @return {string}
319
+ */
320
+ export function renderURLSearchParams<T extends RequestPayload>(
321
+ requestPayload: T,
322
+ urlPathParams: string[] = []
323
+ ): string {
324
+ const flattenedRequestPayload = flattenRequestPayload(requestPayload);
325
+
326
+ const urlSearchParams = Object.keys(flattenedRequestPayload).reduce(
327
+ (acc: string[][], key: string): string[][] => {
328
+ // key should not be present in the url path as a parameter
329
+ const value = flattenedRequestPayload[key];
330
+ if (urlPathParams.find(f => f === key)) {
331
+ return acc;
332
+ }
333
+ return Array.isArray(value)
334
+ ? [...acc, ...value.map(m => [key, m.toString()])]
335
+ : (acc = [...acc, [key, value.toString()]]);
336
+ },
337
+ [] as string[][]
338
+ );
339
+
340
+ return new URLSearchParams(urlSearchParams).toString();
341
+ }
@@ -0,0 +1,146 @@
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 InferyCommonCommon from "../../../common/common.pb"
8
+ import * as fm from "../../../fetch.pb"
9
+
10
+ export enum Maturity {
11
+ MATURITY_UNSPECIFIED = "MATURITY_UNSPECIFIED",
12
+ MATURITY_PRODUCTION = "MATURITY_PRODUCTION",
13
+ MATURITY_PREVIEW = "MATURITY_PREVIEW",
14
+ }
15
+
16
+ export enum InferenceEngine {
17
+ INFERENCE_ENGINE_UNSPECIFIED = "INFERENCE_ENGINE_UNSPECIFIED",
18
+ INFERENCE_ENGINE_VLLM = "INFERENCE_ENGINE_VLLM",
19
+ INFERENCE_ENGINE_SGLANG = "INFERENCE_ENGINE_SGLANG",
20
+ }
21
+
22
+ export type ParallelSpec = {
23
+ tp?: number
24
+ dp?: number
25
+ ep?: boolean
26
+ gpuPerNode?: number
27
+ }
28
+
29
+ export type RoleSpec = {
30
+ replicas?: number
31
+ nodes?: number
32
+ parallel?: ParallelSpec
33
+ }
34
+
35
+ export type RoleConfig = {
36
+ decode?: RoleSpec
37
+ prefill?: RoleSpec
38
+ encoder?: RoleSpec
39
+ }
40
+
41
+ export type InferenceTemplateSpec = {
42
+ modelName?: string
43
+ engine?: InferenceEngine
44
+ stack?: InferyCommonCommon.InferenceStack
45
+ disaggregationMode?: InferyCommonCommon.DisaggregationMode
46
+ maturity?: Maturity
47
+ hardwareVendor?: string
48
+ supportedGpus?: {[key: string]: string}
49
+ guide?: InferyCommonCommon.I18nName
50
+ role?: RoleConfig
51
+ }
52
+
53
+ export type InferenceTemplateMetadata = {
54
+ name?: string
55
+ }
56
+
57
+ export type InferenceTemplateManifest = {
58
+ content?: string
59
+ }
60
+
61
+ export type InferenceTemplate = {
62
+ metadata?: InferenceTemplateMetadata
63
+ spec?: InferenceTemplateSpec
64
+ }
65
+
66
+ export type ModelServingReference = {
67
+ name?: string
68
+ configurationRevision?: string
69
+ }
70
+
71
+ export type ExportInferenceTemplateRequest = {
72
+ workspace?: number
73
+ modelServing?: ModelServingReference
74
+ templateName?: string
75
+ maturity?: Maturity
76
+ }
77
+
78
+ export type CreateInferenceTemplateRequest = {
79
+ workspace?: number
80
+ name?: string
81
+ manifest?: InferenceTemplateManifest
82
+ maturity?: Maturity
83
+ guide?: string
84
+ }
85
+
86
+ export type ListInferenceTemplatesRequest = {
87
+ workspace?: number
88
+ name?: string
89
+ modelName?: string
90
+ hardwareVendor?: string
91
+ stack?: string
92
+ disaggregationMode?: string
93
+ maturity?: Maturity
94
+ page?: InferyCommonCommon.Pagination
95
+ }
96
+
97
+ export type ListInferenceTemplatesResponse = {
98
+ items?: InferenceTemplateListItem[]
99
+ page?: InferyCommonCommon.Pagination
100
+ }
101
+
102
+ export type InferenceTemplateListItem = {
103
+ inferenceTemplate?: InferenceTemplate
104
+ }
105
+
106
+ export type GetInferenceTemplateRequest = {
107
+ workspace?: number
108
+ name?: string
109
+ }
110
+
111
+ export type GetInferenceTemplateResponse = {
112
+ inferenceTemplate?: InferenceTemplate
113
+ manifest?: InferenceTemplateManifest
114
+ }
115
+
116
+ export type UpdateInferenceTemplateRequest = {
117
+ workspace?: number
118
+ name?: string
119
+ manifest?: InferenceTemplateManifest
120
+ }
121
+
122
+ export type DeleteInferenceTemplateRequest = {
123
+ workspace?: number
124
+ name?: string
125
+ }
126
+
127
+ export class InferenceTemplateManagement {
128
+ static ExportInferenceTemplate(req: ExportInferenceTemplateRequest, initReq?: fm.InitReq): Promise<InferenceTemplateManifest> {
129
+ return fm.fetchReq<ExportInferenceTemplateRequest, InferenceTemplateManifest>(`/apis/infery.io/v1alpha1/workspaces/${req["workspace"]}/inference-templates:export`, {...initReq, method: "POST", body: JSON.stringify(req, fm.replacer)})
130
+ }
131
+ static CreateInferenceTemplate(req: CreateInferenceTemplateRequest, initReq?: fm.InitReq): Promise<InferenceTemplate> {
132
+ return fm.fetchReq<CreateInferenceTemplateRequest, InferenceTemplate>(`/apis/infery.io/v1alpha1/workspaces/${req["workspace"]}/inference-templates`, {...initReq, method: "POST", body: JSON.stringify(req, fm.replacer)})
133
+ }
134
+ static ListInferenceTemplates(req: ListInferenceTemplatesRequest, initReq?: fm.InitReq): Promise<ListInferenceTemplatesResponse> {
135
+ return fm.fetchReq<ListInferenceTemplatesRequest, ListInferenceTemplatesResponse>(`/apis/infery.io/v1alpha1/workspaces/${req["workspace"]}/inference-templates?${fm.renderURLSearchParams(req, ["workspace"])}`, {...initReq, method: "GET"})
136
+ }
137
+ static GetInferenceTemplate(req: GetInferenceTemplateRequest, initReq?: fm.InitReq): Promise<GetInferenceTemplateResponse> {
138
+ return fm.fetchReq<GetInferenceTemplateRequest, GetInferenceTemplateResponse>(`/apis/infery.io/v1alpha1/workspaces/${req["workspace"]}/inference-templates/${req["name"]}?${fm.renderURLSearchParams(req, ["workspace", "name"])}`, {...initReq, method: "GET"})
139
+ }
140
+ static UpdateInferenceTemplate(req: UpdateInferenceTemplateRequest, initReq?: fm.InitReq): Promise<InferenceTemplate> {
141
+ return fm.fetchReq<UpdateInferenceTemplateRequest, InferenceTemplate>(`/apis/infery.io/v1alpha1/workspaces/${req["workspace"]}/inference-templates/${req["name"]}`, {...initReq, method: "PUT", body: JSON.stringify(req, fm.replacer)})
142
+ }
143
+ static DeleteInferenceTemplate(req: DeleteInferenceTemplateRequest, initReq?: fm.InitReq): Promise<InferenceTemplate> {
144
+ return fm.fetchReq<DeleteInferenceTemplateRequest, InferenceTemplate>(`/apis/infery.io/v1alpha1/workspaces/${req["workspace"]}/inference-templates/${req["name"]}`, {...initReq, method: "DELETE"})
145
+ }
146
+ }
@@ -0,0 +1,474 @@
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 InferyCommonCommon from "../../../common/common.pb"
8
+ import * as fm from "../../../fetch.pb"
9
+ import * as GoogleProtobufTimestamp from "../../../google/protobuf/timestamp.pb"
10
+
11
+ type Absent<T, K extends keyof T> = { [k in Exclude<keyof T, K>]?: undefined };
12
+ type OneOf<T> =
13
+ | { [k in keyof T]?: undefined }
14
+ | (
15
+ keyof T extends infer K ?
16
+ (K extends string & keyof T ? { [k in K]: T[K] } & Absent<T, K>
17
+ : never)
18
+ : never);
19
+
20
+ export enum ConfigurationFormat {
21
+ CONFIGURATION_FORMAT_UNSPECIFIED = "CONFIGURATION_FORMAT_UNSPECIFIED",
22
+ CONFIGURATION_FORMAT_HELM_VALUES_YAML = "CONFIGURATION_FORMAT_HELM_VALUES_YAML",
23
+ }
24
+
25
+ export enum RoleType {
26
+ ROLE_TYPE_UNSPECIFIED = "ROLE_TYPE_UNSPECIFIED",
27
+ ROLE_TYPE_LLM_D_PREFILL = "ROLE_TYPE_LLM_D_PREFILL",
28
+ ROLE_TYPE_LLM_D_DECODE = "ROLE_TYPE_LLM_D_DECODE",
29
+ ROLE_TYPE_LLM_D_MODEL_SERVER = "ROLE_TYPE_LLM_D_MODEL_SERVER",
30
+ ROLE_TYPE_LLM_D_ROUTING_PROXY = "ROLE_TYPE_LLM_D_ROUTING_PROXY",
31
+ ROLE_TYPE_LLM_D_ROUTER = "ROLE_TYPE_LLM_D_ROUTER",
32
+ ROLE_TYPE_DYNAMO_GATEWAY = "ROLE_TYPE_DYNAMO_GATEWAY",
33
+ ROLE_TYPE_DYNAMO_FRONTEND = "ROLE_TYPE_DYNAMO_FRONTEND",
34
+ ROLE_TYPE_DYNAMO_PLANNER = "ROLE_TYPE_DYNAMO_PLANNER",
35
+ ROLE_TYPE_DYNAMO_WORKER_POOL = "ROLE_TYPE_DYNAMO_WORKER_POOL",
36
+ ROLE_TYPE_DYNAMO_PREFILL = "ROLE_TYPE_DYNAMO_PREFILL",
37
+ ROLE_TYPE_DYNAMO_DECODE = "ROLE_TYPE_DYNAMO_DECODE",
38
+ }
39
+
40
+ export enum KVCacheMode {
41
+ KV_CACHE_MODE_UNSPECIFIED = "KV_CACHE_MODE_UNSPECIFIED",
42
+ KV_CACHE_MODE_LOCAL_GPU = "KV_CACHE_MODE_LOCAL_GPU",
43
+ KV_CACHE_MODE_REDHARD_OFFLOAD = "KV_CACHE_MODE_REDHARD_OFFLOAD",
44
+ }
45
+
46
+ export enum OperationPhase {
47
+ OPERATION_PHASE_UNSPECIFIED = "OPERATION_PHASE_UNSPECIFIED",
48
+ OPERATION_PHASE_DEPLOYING = "OPERATION_PHASE_DEPLOYING",
49
+ OPERATION_PHASE_RUNNING = "OPERATION_PHASE_RUNNING",
50
+ OPERATION_PHASE_UPDATING = "OPERATION_PHASE_UPDATING",
51
+ OPERATION_PHASE_DELETING = "OPERATION_PHASE_DELETING",
52
+ OPERATION_PHASE_STOPPED = "OPERATION_PHASE_STOPPED",
53
+ OPERATION_PHASE_FAILED = "OPERATION_PHASE_FAILED",
54
+ }
55
+
56
+ export enum SyncStatus {
57
+ SYNC_STATUS_UNSPECIFIED = "SYNC_STATUS_UNSPECIFIED",
58
+ SYNC_STATUS_SYNCED = "SYNC_STATUS_SYNCED",
59
+ SYNC_STATUS_OUT_OF_SYNC = "SYNC_STATUS_OUT_OF_SYNC",
60
+ SYNC_STATUS_UNKNOWN = "SYNC_STATUS_UNKNOWN",
61
+ }
62
+
63
+ export enum HealthStatus {
64
+ HEALTH_STATUS_UNSPECIFIED = "HEALTH_STATUS_UNSPECIFIED",
65
+ HEALTH_STATUS_HEALTHY = "HEALTH_STATUS_HEALTHY",
66
+ HEALTH_STATUS_PROGRESSING = "HEALTH_STATUS_PROGRESSING",
67
+ HEALTH_STATUS_DEGRADED = "HEALTH_STATUS_DEGRADED",
68
+ HEALTH_STATUS_MISSING = "HEALTH_STATUS_MISSING",
69
+ HEALTH_STATUS_UNKNOWN = "HEALTH_STATUS_UNKNOWN",
70
+ }
71
+
72
+ export enum AvailabilityStatus {
73
+ AVAILABILITY_STATUS_UNSPECIFIED = "AVAILABILITY_STATUS_UNSPECIFIED",
74
+ AVAILABILITY_STATUS_AVAILABLE = "AVAILABILITY_STATUS_AVAILABLE",
75
+ AVAILABILITY_STATUS_UNAVAILABLE = "AVAILABILITY_STATUS_UNAVAILABLE",
76
+ AVAILABILITY_STATUS_UNKNOWN = "AVAILABILITY_STATUS_UNKNOWN",
77
+ }
78
+
79
+ export enum ConditionStatus {
80
+ CONDITION_STATUS_UNSPECIFIED = "CONDITION_STATUS_UNSPECIFIED",
81
+ CONDITION_STATUS_TRUE = "CONDITION_STATUS_TRUE",
82
+ CONDITION_STATUS_FALSE = "CONDITION_STATUS_FALSE",
83
+ CONDITION_STATUS_UNKNOWN = "CONDITION_STATUS_UNKNOWN",
84
+ }
85
+
86
+ export enum ModelServingOriginType {
87
+ MODEL_SERVING_ORIGIN_TYPE_UNSPECIFIED = "MODEL_SERVING_ORIGIN_TYPE_UNSPECIFIED",
88
+ MODEL_SERVING_ORIGIN_TYPE_STRUCTURED = "MODEL_SERVING_ORIGIN_TYPE_STRUCTURED",
89
+ MODEL_SERVING_ORIGIN_TYPE_INFERENCE_TEMPLATE = "MODEL_SERVING_ORIGIN_TYPE_INFERENCE_TEMPLATE",
90
+ MODEL_SERVING_ORIGIN_TYPE_CUSTOM_CONFIGURATION = "MODEL_SERVING_ORIGIN_TYPE_CUSTOM_CONFIGURATION",
91
+ MODEL_SERVING_ORIGIN_TYPE_EXTERNAL = "MODEL_SERVING_ORIGIN_TYPE_EXTERNAL",
92
+ }
93
+
94
+ export enum RoleCapability {
95
+ ROLE_CAPABILITY_UNSPECIFIED = "ROLE_CAPABILITY_UNSPECIFIED",
96
+ ROLE_CAPABILITY_ENTRY = "ROLE_CAPABILITY_ENTRY",
97
+ ROLE_CAPABILITY_ROUTING = "ROLE_CAPABILITY_ROUTING",
98
+ ROLE_CAPABILITY_KV_CACHE_OFFLOAD = "ROLE_CAPABILITY_KV_CACHE_OFFLOAD",
99
+ }
100
+
101
+ export enum ModelServingAction {
102
+ MODEL_SERVING_ACTION_UNSPECIFIED = "MODEL_SERVING_ACTION_UNSPECIFIED",
103
+ MODEL_SERVING_ACTION_START = "MODEL_SERVING_ACTION_START",
104
+ MODEL_SERVING_ACTION_STOP = "MODEL_SERVING_ACTION_STOP",
105
+ MODEL_SERVING_ACTION_SYNC = "MODEL_SERVING_ACTION_SYNC",
106
+ MODEL_SERVING_ACTION_PAUSE_UPDATE = "MODEL_SERVING_ACTION_PAUSE_UPDATE",
107
+ MODEL_SERVING_ACTION_RESUME_UPDATE = "MODEL_SERVING_ACTION_RESUME_UPDATE",
108
+ }
109
+
110
+ export enum ValidationIssueSeverity {
111
+ SEVERITY_UNSPECIFIED = "SEVERITY_UNSPECIFIED",
112
+ SEVERITY_ERROR = "SEVERITY_ERROR",
113
+ SEVERITY_WARNING = "SEVERITY_WARNING",
114
+ }
115
+
116
+ export type Configuration = {
117
+ format?: ConfigurationFormat
118
+ content?: string
119
+ }
120
+
121
+ export type GetModelServingConfigurationResponse = {
122
+ configuration?: Configuration
123
+ revision?: string
124
+ }
125
+
126
+ export type ValidationIssue = {
127
+ severity?: ValidationIssueSeverity
128
+ fieldPath?: string
129
+ code?: string
130
+ message?: string
131
+ }
132
+
133
+ export type ConfigurationPreview = {
134
+ valid?: boolean
135
+ normalized?: Configuration
136
+ issues?: ValidationIssue[]
137
+ }
138
+
139
+ export type PVCModelSource = {
140
+ claimName?: string
141
+ subPath?: string
142
+ mountPath?: string
143
+ }
144
+
145
+
146
+ type BaseModelSource = {
147
+ }
148
+
149
+ export type ModelSource = BaseModelSource
150
+ & OneOf<{ pvc: PVCModelSource }>
151
+
152
+ export type ModelConfiguration = {
153
+ modelSource?: ModelSource
154
+ accessModelName?: string
155
+ }
156
+
157
+
158
+ type BaseParallelismConfig = {
159
+ expertParallelSize?: boolean
160
+ }
161
+
162
+ export type ParallelismConfig = BaseParallelismConfig
163
+ & OneOf<{ tensorParallelSize: number }>
164
+ & OneOf<{ dataParallelSize: number }>
165
+ & OneOf<{ pipelineParallelSize: number }>
166
+
167
+ export type KVCacheConfig = {
168
+ mode?: KVCacheMode
169
+ redisInstance?: string
170
+ }
171
+
172
+ export type InferenceTemplateReference = {
173
+ name?: string
174
+ }
175
+
176
+ export type InferenceTemplateDeployment = {
177
+ inferenceTemplateName?: string
178
+ }
179
+
180
+ export type StatusCondition = {
181
+ type?: string
182
+ status?: ConditionStatus
183
+ reason?: string
184
+ message?: string
185
+ lastTransitionTime?: GoogleProtobufTimestamp.Timestamp
186
+ }
187
+
188
+ export type ModelServingStatusSummary = {
189
+ phase?: OperationPhase
190
+ syncStatus?: SyncStatus
191
+ healthStatus?: HealthStatus
192
+ availability?: AvailabilityStatus
193
+ }
194
+
195
+ export type RoleStatus = {
196
+ role?: RoleType
197
+ desiredReplicas?: number
198
+ readyReplicas?: number
199
+ restartingPods?: number
200
+ }
201
+
202
+ export type ModelServiceStatus = {
203
+ phase?: OperationPhase
204
+ syncStatus?: SyncStatus
205
+ healthStatus?: HealthStatus
206
+ availability?: AvailabilityStatus
207
+ roles?: RoleStatus[]
208
+ conditions?: StatusCondition[]
209
+ }
210
+
211
+ export type ModelServingOrigin = {
212
+ type?: ModelServingOriginType
213
+ template?: InferenceTemplateReference
214
+ }
215
+
216
+ export type ModelServing = {
217
+ name?: string
218
+ workspace?: number
219
+ alias?: string
220
+ cluster?: string
221
+ namespace?: string
222
+ status?: ModelServiceStatus
223
+ createTime?: GoogleProtobufTimestamp.Timestamp
224
+ updateTime?: GoogleProtobufTimestamp.Timestamp
225
+ origin?: ModelServingOrigin
226
+ resourceVersion?: string
227
+ }
228
+
229
+ export type AcceleratorSummary = {
230
+ vendor?: string
231
+ model?: string
232
+ count?: number
233
+ }
234
+
235
+
236
+ type BasePreviewModelServingRequest = {
237
+ workspace?: number
238
+ name?: string
239
+ alias?: string
240
+ cluster?: string
241
+ namespace?: string
242
+ accelerator?: AcceleratorSummary
243
+ modelConfiguration?: ModelConfiguration
244
+ }
245
+
246
+ export type PreviewModelServingRequest = BasePreviewModelServingRequest
247
+ & OneOf<{ inferenceTemplate: InferenceTemplateDeployment; configuration: Configuration }>
248
+
249
+ export type PreviewModelServingResponse = {
250
+ configuration?: ConfigurationPreview
251
+ resolvedTemplate?: InferenceTemplateReference
252
+ origin?: ModelServingOrigin
253
+ }
254
+
255
+ export type CreateModelServingRequest = {
256
+ workspace?: number
257
+ name?: string
258
+ alias?: string
259
+ cluster?: string
260
+ namespace?: string
261
+ configuration?: Configuration
262
+ origin?: ModelServingOrigin
263
+ }
264
+
265
+ export type CreateModelServingResponse = {
266
+ name?: string
267
+ phase?: OperationPhase
268
+ resourceVersion?: string
269
+ createTime?: GoogleProtobufTimestamp.Timestamp
270
+ }
271
+
272
+ export type ListModelServingRequest = {
273
+ workspace?: number
274
+ name?: string
275
+ phase?: OperationPhase
276
+ availability?: AvailabilityStatus
277
+ syncStatus?: SyncStatus
278
+ cluster?: string
279
+ namespace?: string
280
+ stack?: InferyCommonCommon.InferenceStack
281
+ disaggregationMode?: InferyCommonCommon.DisaggregationMode
282
+ gpuModel?: string
283
+ page?: InferyCommonCommon.Pagination
284
+ }
285
+
286
+ export type ModelServingRoleSummary = {
287
+ role?: RoleType
288
+ desiredReplicas?: number
289
+ readyReplicas?: number
290
+ }
291
+
292
+ export type ModelServingListItem = {
293
+ name?: string
294
+ alias?: string
295
+ accessModelName?: string
296
+ cluster?: string
297
+ namespace?: string
298
+ disaggregationMode?: InferyCommonCommon.DisaggregationMode
299
+ stack?: InferyCommonCommon.InferenceStack
300
+ createTime?: GoogleProtobufTimestamp.Timestamp
301
+ status?: ModelServingStatusSummary
302
+ roles?: ModelServingRoleSummary[]
303
+ totalGpuCount?: number
304
+ accelerators?: AcceleratorSummary[]
305
+ origin?: ModelServingOrigin
306
+ }
307
+
308
+ export type ListModelServingResponse = {
309
+ items?: ModelServingListItem[]
310
+ page?: InferyCommonCommon.Pagination
311
+ }
312
+
313
+ export type GPUAllocation = {
314
+ vendor?: string
315
+ model?: string
316
+ resourceName?: string
317
+ gpuCountPerNode?: number
318
+ nodesPerReplica?: number
319
+ totalGpuCount?: number
320
+ }
321
+
322
+ export type ModelServingRoleOverview = {
323
+ role?: RoleType
324
+ componentName?: string
325
+ desiredReplicas?: number
326
+ readyReplicas?: number
327
+ image?: string
328
+ gpu?: GPUAllocation
329
+ parallelism?: ParallelismConfig
330
+ capabilities?: RoleCapability[]
331
+ }
332
+
333
+ export type ModelServingAccess = {
334
+ serviceAddress?: string
335
+ accessPath?: string
336
+ accessModelName?: string
337
+ }
338
+
339
+ export type GetModelServingResponse = {
340
+ modelServing?: ModelServing
341
+ topology?: ModelServingRoleOverview[]
342
+ access?: ModelServingAccess
343
+ }
344
+
345
+ export type GetModelServingRequest = {
346
+ workspace?: number
347
+ name?: string
348
+ }
349
+
350
+ export type ListModelServingResourcesRequest = {
351
+ workspace?: number
352
+ name?: string
353
+ kind?: string
354
+ healthStatus?: HealthStatus
355
+ resourceName?: string
356
+ status?: string
357
+ }
358
+
359
+ export type ModelServingResource = {
360
+ apiVersion?: string
361
+ kind?: string
362
+ namespace?: string
363
+ name?: string
364
+ healthStatus?: HealthStatus
365
+ status?: string
366
+ message?: string
367
+ nodeName?: string
368
+ logsAvailable?: boolean
369
+ }
370
+
371
+ export type ModelServingResourceGroup = {
372
+ role?: RoleType
373
+ componentName?: string
374
+ desiredReplicas?: number
375
+ readyReplicas?: number
376
+ resources?: ModelServingResource[]
377
+ }
378
+
379
+ export type ListModelServingResourcesResponse = {
380
+ groups?: ModelServingResourceGroup[]
381
+ }
382
+
383
+ export type UpdateModelServingRequest = {
384
+ workspace?: number
385
+ name?: string
386
+ alias?: string
387
+ resourceVersion?: string
388
+ }
389
+
390
+ export type DeleteModelServingRequest = {
391
+ workspace?: number
392
+ name?: string
393
+ resourceVersion?: string
394
+ }
395
+
396
+ export type ModelServingActionRequest = {
397
+ workspace?: number
398
+ name?: string
399
+ action?: ModelServingAction
400
+ resourceVersion?: string
401
+ }
402
+
403
+ export type UpdateModelServingResponse = {
404
+ name?: string
405
+ alias?: string
406
+ resourceVersion?: string
407
+ updateTime?: GoogleProtobufTimestamp.Timestamp
408
+ }
409
+
410
+ export type DeleteModelServingResponse = {
411
+ name?: string
412
+ phase?: OperationPhase
413
+ resourceVersion?: string
414
+ updateTime?: GoogleProtobufTimestamp.Timestamp
415
+ }
416
+
417
+ export type ModelServingActionResponse = {
418
+ name?: string
419
+ phase?: OperationPhase
420
+ resourceVersion?: string
421
+ updateTime?: GoogleProtobufTimestamp.Timestamp
422
+ }
423
+
424
+ export type UpdateModelServingConfigurationResponse = {
425
+ name?: string
426
+ phase?: OperationPhase
427
+ resourceVersion?: string
428
+ updateTime?: GoogleProtobufTimestamp.Timestamp
429
+ }
430
+
431
+ export type GetModelServingConfigurationRequest = {
432
+ workspace?: number
433
+ name?: string
434
+ }
435
+
436
+ export type UpdateModelServingConfigurationRequest = {
437
+ workspace?: number
438
+ name?: string
439
+ configuration?: Configuration
440
+ baseRevision?: string
441
+ }
442
+
443
+ export class ModelServingManagement {
444
+ static PreviewModelServing(req: PreviewModelServingRequest, initReq?: fm.InitReq): Promise<PreviewModelServingResponse> {
445
+ return fm.fetchReq<PreviewModelServingRequest, PreviewModelServingResponse>(`/apis/infery.io/v1alpha1/workspaces/${req["workspace"]}/model-serving/preview`, {...initReq, method: "POST", body: JSON.stringify(req, fm.replacer)})
446
+ }
447
+ static CreateModelServing(req: CreateModelServingRequest, initReq?: fm.InitReq): Promise<CreateModelServingResponse> {
448
+ return fm.fetchReq<CreateModelServingRequest, CreateModelServingResponse>(`/apis/infery.io/v1alpha1/workspaces/${req["workspace"]}/model-serving`, {...initReq, method: "POST", body: JSON.stringify(req, fm.replacer)})
449
+ }
450
+ static ListModelServing(req: ListModelServingRequest, initReq?: fm.InitReq): Promise<ListModelServingResponse> {
451
+ return fm.fetchReq<ListModelServingRequest, ListModelServingResponse>(`/apis/infery.io/v1alpha1/workspaces/${req["workspace"]}/model-serving?${fm.renderURLSearchParams(req, ["workspace"])}`, {...initReq, method: "GET"})
452
+ }
453
+ static GetModelServing(req: GetModelServingRequest, initReq?: fm.InitReq): Promise<GetModelServingResponse> {
454
+ return fm.fetchReq<GetModelServingRequest, GetModelServingResponse>(`/apis/infery.io/v1alpha1/workspaces/${req["workspace"]}/model-serving/${req["name"]}?${fm.renderURLSearchParams(req, ["workspace", "name"])}`, {...initReq, method: "GET"})
455
+ }
456
+ static ListModelServingResources(req: ListModelServingResourcesRequest, initReq?: fm.InitReq): Promise<ListModelServingResourcesResponse> {
457
+ return fm.fetchReq<ListModelServingResourcesRequest, ListModelServingResourcesResponse>(`/apis/infery.io/v1alpha1/workspaces/${req["workspace"]}/model-serving/${req["name"]}/resources?${fm.renderURLSearchParams(req, ["workspace", "name"])}`, {...initReq, method: "GET"})
458
+ }
459
+ static UpdateModelServing(req: UpdateModelServingRequest, initReq?: fm.InitReq): Promise<UpdateModelServingResponse> {
460
+ return fm.fetchReq<UpdateModelServingRequest, UpdateModelServingResponse>(`/apis/infery.io/v1alpha1/workspaces/${req["workspace"]}/model-serving/${req["name"]}`, {...initReq, method: "PUT", body: JSON.stringify(req, fm.replacer)})
461
+ }
462
+ static DeleteModelServing(req: DeleteModelServingRequest, initReq?: fm.InitReq): Promise<DeleteModelServingResponse> {
463
+ return fm.fetchReq<DeleteModelServingRequest, DeleteModelServingResponse>(`/apis/infery.io/v1alpha1/workspaces/${req["workspace"]}/model-serving/${req["name"]}`, {...initReq, method: "DELETE"})
464
+ }
465
+ static DoModelServingAction(req: ModelServingActionRequest, initReq?: fm.InitReq): Promise<ModelServingActionResponse> {
466
+ return fm.fetchReq<ModelServingActionRequest, ModelServingActionResponse>(`/apis/infery.io/v1alpha1/workspaces/${req["workspace"]}/model-serving/${req["name"]}/actions`, {...initReq, method: "POST", body: JSON.stringify(req, fm.replacer)})
467
+ }
468
+ static GetModelServingConfiguration(req: GetModelServingConfigurationRequest, initReq?: fm.InitReq): Promise<GetModelServingConfigurationResponse> {
469
+ return fm.fetchReq<GetModelServingConfigurationRequest, GetModelServingConfigurationResponse>(`/apis/infery.io/v1alpha1/workspaces/${req["workspace"]}/model-serving/${req["name"]}/configuration?${fm.renderURLSearchParams(req, ["workspace", "name"])}`, {...initReq, method: "GET"})
470
+ }
471
+ static UpdateModelServingConfiguration(req: UpdateModelServingConfigurationRequest, initReq?: fm.InitReq): Promise<UpdateModelServingConfigurationResponse> {
472
+ return fm.fetchReq<UpdateModelServingConfigurationRequest, UpdateModelServingConfigurationResponse>(`/apis/infery.io/v1alpha1/workspaces/${req["workspace"]}/model-serving/${req["name"]}/configuration`, {...initReq, method: "PUT", body: JSON.stringify(req, fm.replacer)})
473
+ }
474
+ }
@@ -0,0 +1,150 @@
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 InferyCommonCommon from "../../../common/common.pb"
8
+ import * as fm from "../../../fetch.pb"
9
+ export type ListWorkspaceRequest = {
10
+ cluster?: string
11
+ }
12
+
13
+ export type Workspace = {
14
+ workspaceId?: number
15
+ alias?: string
16
+ }
17
+
18
+ export type ListWorkspacesResponse = {
19
+ items?: Workspace[]
20
+ }
21
+
22
+ export type ListClusterRequest = {
23
+ workspace?: number
24
+ }
25
+
26
+ export type Cluster = {
27
+ name?: string
28
+ }
29
+
30
+ export type ListClustersResponse = {
31
+ items?: Cluster[]
32
+ }
33
+
34
+ export type ListClusterNamespacesRequest = {
35
+ workspace?: number
36
+ cluster?: string
37
+ }
38
+
39
+ export type ClusterNamespace = {
40
+ cluster?: string
41
+ namespace?: string
42
+ }
43
+
44
+ export type ListClusterNamespaceResponse = {
45
+ items?: ClusterNamespace[]
46
+ }
47
+
48
+ export type ListClusterGPUTypesRequest = {
49
+ workspace?: number
50
+ cluster?: string
51
+ }
52
+
53
+ export type GPUType = {
54
+ type?: string
55
+ alias?: string
56
+ }
57
+
58
+ export type ListClusterGPUTypesResponse = {
59
+ items?: GPUType[]
60
+ }
61
+
62
+ export type KubernetesObjectMeta = {
63
+ name?: string
64
+ namespace?: string
65
+ labels?: {[key: string]: string}
66
+ annotations?: {[key: string]: string}
67
+ }
68
+
69
+ export type PersistentVolumeClaim = {
70
+ metadata?: KubernetesObjectMeta
71
+ }
72
+
73
+ export type Secret = {
74
+ metadata?: KubernetesObjectMeta
75
+ immutable?: boolean
76
+ type?: string
77
+ data?: {[key: string]: Uint8Array}
78
+ stringData?: {[key: string]: string}
79
+ }
80
+
81
+ export type ConfigMap = {
82
+ metadata?: KubernetesObjectMeta
83
+ immutable?: boolean
84
+ data?: {[key: string]: string}
85
+ binaryData?: {[key: string]: Uint8Array}
86
+ }
87
+
88
+ export type ListPersistentVolumeClaimsRequest = {
89
+ workspace?: number
90
+ cluster?: string
91
+ namespace?: string
92
+ page?: InferyCommonCommon.Pagination
93
+ name?: string
94
+ }
95
+
96
+ export type ListPersistentVolumeClaimsResponse = {
97
+ items?: PersistentVolumeClaim[]
98
+ page?: InferyCommonCommon.Pagination
99
+ }
100
+
101
+ export type ListSecretsRequest = {
102
+ workspace?: number
103
+ cluster?: string
104
+ namespace?: string
105
+ page?: InferyCommonCommon.Pagination
106
+ name?: string
107
+ type?: string
108
+ }
109
+
110
+ export type ListSecretsResponse = {
111
+ items?: Secret[]
112
+ page?: InferyCommonCommon.Pagination
113
+ }
114
+
115
+ export type ListConfigMapsRequest = {
116
+ workspace?: number
117
+ cluster?: string
118
+ namespace?: string
119
+ page?: InferyCommonCommon.Pagination
120
+ name?: string
121
+ }
122
+
123
+ export type ListConfigMapsResponse = {
124
+ items?: ConfigMap[]
125
+ page?: InferyCommonCommon.Pagination
126
+ }
127
+
128
+ export class WorkspaceService {
129
+ static ListWorkspaces(req: ListWorkspaceRequest, initReq?: fm.InitReq): Promise<ListWorkspacesResponse> {
130
+ return fm.fetchReq<ListWorkspaceRequest, ListWorkspacesResponse>(`/apis/infery.io/v1alpha1/workspaces?${fm.renderURLSearchParams(req, [])}`, {...initReq, method: "GET"})
131
+ }
132
+ static ListClusterGPUTypes(req: ListClusterGPUTypesRequest, initReq?: fm.InitReq): Promise<ListClusterGPUTypesResponse> {
133
+ return fm.fetchReq<ListClusterGPUTypesRequest, ListClusterGPUTypesResponse>(`/apis/infery.io/v1alpha1/workspaces/${req["workspace"]}/clusters/${req["cluster"]}/gpu-types?${fm.renderURLSearchParams(req, ["workspace", "cluster"])}`, {...initReq, method: "GET"})
134
+ }
135
+ static ListClusters(req: ListClusterRequest, initReq?: fm.InitReq): Promise<ListClustersResponse> {
136
+ return fm.fetchReq<ListClusterRequest, ListClustersResponse>(`/apis/infery.io/v1alpha1/workspaces/${req["workspace"]}/clusters?${fm.renderURLSearchParams(req, ["workspace"])}`, {...initReq, method: "GET"})
137
+ }
138
+ static ListClusterNamespaces(req: ListClusterNamespacesRequest, initReq?: fm.InitReq): Promise<ListClusterNamespaceResponse> {
139
+ return fm.fetchReq<ListClusterNamespacesRequest, ListClusterNamespaceResponse>(`/apis/infery.io/v1alpha1/workspaces/${req["workspace"]}/cluster-namespaces?${fm.renderURLSearchParams(req, ["workspace"])}`, {...initReq, method: "GET"})
140
+ }
141
+ static ListPersistentVolumeClaims(req: ListPersistentVolumeClaimsRequest, initReq?: fm.InitReq): Promise<ListPersistentVolumeClaimsResponse> {
142
+ return fm.fetchReq<ListPersistentVolumeClaimsRequest, ListPersistentVolumeClaimsResponse>(`/apis/infery.io/v1alpha1/workspaces/${req["workspace"]}/clusters/${req["cluster"]}/namespaces/${req["namespace"]}/persistentvolumeclaims?${fm.renderURLSearchParams(req, ["workspace", "cluster", "namespace"])}`, {...initReq, method: "GET"})
143
+ }
144
+ static ListSecrets(req: ListSecretsRequest, initReq?: fm.InitReq): Promise<ListSecretsResponse> {
145
+ return fm.fetchReq<ListSecretsRequest, ListSecretsResponse>(`/apis/infery.io/v1alpha1/workspaces/${req["workspace"]}/clusters/${req["cluster"]}/namespaces/${req["namespace"]}/secrets?${fm.renderURLSearchParams(req, ["workspace", "cluster", "namespace"])}`, {...initReq, method: "GET"})
146
+ }
147
+ static ListConfigMaps(req: ListConfigMapsRequest, initReq?: fm.InitReq): Promise<ListConfigMapsResponse> {
148
+ return fm.fetchReq<ListConfigMapsRequest, ListConfigMapsResponse>(`/apis/infery.io/v1alpha1/workspaces/${req["workspace"]}/clusters/${req["cluster"]}/namespaces/${req["namespace"]}/configmaps?${fm.renderURLSearchParams(req, ["workspace", "cluster", "namespace"])}`, {...initReq, method: "GET"})
149
+ }
150
+ }
package/package.json ADDED
@@ -0,0 +1,6 @@
1
+ {
2
+ "name": "@daocloud-proto/infery",
3
+ "version": "v0.0.0-dev-5b50f43a",
4
+ "description": "Infery frontend protobuf SDK",
5
+ "license": "ISC"
6
+ }