@daocloud-proto/hydra 0.5.0-dev-3 → 0.5.0-dev-7

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,121 @@
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 GoogleProtobufTimestamp from "../../../google/protobuf/timestamp.pb"
10
+ import * as HydraManagement_apiModelV1alpha1Model from "../../../management-api/model/v1alpha1/model.pb"
11
+ export type CreateModelRequest = {
12
+ modelId?: string
13
+ modelAvatar?: string
14
+ modelName?: string
15
+ providerId?: string
16
+ modelDescription?: HydraCommonCommon.I18nName
17
+ modelSupportFeature?: HydraManagement_apiModelV1alpha1Model.ModelSupportFeature[]
18
+ publicEndpointEnabled?: boolean
19
+ publicEndpointBaseUrl?: string
20
+ publicAccessModelName?: string
21
+ readme?: HydraCommonCommon.I18nName
22
+ publicModelConfig?: HydraManagement_apiModelV1alpha1Model.PublicModelConfig
23
+ servingSpec?: HydraManagement_apiModelV1alpha1Model.ModelServingSpec
24
+ hidden?: boolean
25
+ }
26
+
27
+ export type Model = {
28
+ modelId?: string
29
+ modelAvatar?: string
30
+ modelName?: string
31
+ providerId?: string
32
+ providerName?: HydraCommonCommon.I18nName
33
+ modelDescription?: HydraCommonCommon.I18nName
34
+ modelSupportFeature?: HydraManagement_apiModelV1alpha1Model.ModelSupportFeature[]
35
+ creationTimestamp?: GoogleProtobufTimestamp.Timestamp
36
+ updateTimestamp?: GoogleProtobufTimestamp.Timestamp
37
+ publicEndpointEnabled?: boolean
38
+ publicEndpointBaseUrl?: string
39
+ publicAccessModelName?: string
40
+ readme?: HydraCommonCommon.I18nName
41
+ publicModelConfig?: HydraManagement_apiModelV1alpha1Model.PublicModelConfig
42
+ servingSpec?: HydraManagement_apiModelV1alpha1Model.ModelServingSpec
43
+ hidden?: boolean
44
+ }
45
+
46
+ export type UpdateModelRequest = {
47
+ modelId?: string
48
+ modelAvatar?: string
49
+ modelName?: string
50
+ providerId?: string
51
+ modelDescription?: HydraCommonCommon.I18nName
52
+ modelSupportFeature?: HydraManagement_apiModelV1alpha1Model.ModelSupportFeature[]
53
+ publicEndpointEnabled?: boolean
54
+ publicEndpointBaseUrl?: string
55
+ publicAccessModelName?: string
56
+ readme?: HydraCommonCommon.I18nName
57
+ publicModelConfig?: HydraManagement_apiModelV1alpha1Model.PublicModelConfig
58
+ servingSpec?: HydraManagement_apiModelV1alpha1Model.ModelServingSpec
59
+ hidden?: boolean
60
+ }
61
+
62
+ export type ListModelRequest = {
63
+ page?: HydraCommonCommon.Pagination
64
+ showDeployTemplate?: boolean
65
+ }
66
+
67
+ export type ListModelResponse = {
68
+ items?: Model[]
69
+ page?: HydraCommonCommon.Pagination
70
+ }
71
+
72
+ export type SingleModelRequest = {
73
+ modelId?: string
74
+ }
75
+
76
+ export type ImportModelRequest = {
77
+ yAML?: string
78
+ uRL?: string
79
+ }
80
+
81
+ export type ImportModelResponse = {
82
+ items?: Model[]
83
+ }
84
+
85
+ export type BatchCreateModelsRequest = {
86
+ models?: CreateModelRequest[]
87
+ }
88
+
89
+ export type BatchCreateModelsResponse = {
90
+ items?: Model[]
91
+ }
92
+
93
+ export class AdminModelManagement {
94
+ static CreateModel(req: CreateModelRequest, initReq?: fm.InitReq): Promise<Model> {
95
+ return fm.fetchReq<CreateModelRequest, Model>(`/apis/admin.hydra.io/v1alpha1/models`, {...initReq, method: "POST", body: JSON.stringify(req, fm.replacer)})
96
+ }
97
+ static GetModel(req: SingleModelRequest, initReq?: fm.InitReq): Promise<Model> {
98
+ return fm.fetchReq<SingleModelRequest, Model>(`/apis/admin.hydra.io/v1alpha1/models/${req["modelId"]}?${fm.renderURLSearchParams(req, ["modelId"])}`, {...initReq, method: "GET"})
99
+ }
100
+ static ListModels(req: ListModelRequest, initReq?: fm.InitReq): Promise<ListModelResponse> {
101
+ return fm.fetchReq<ListModelRequest, ListModelResponse>(`/apis/admin.hydra.io/v1alpha1/models?${fm.renderURLSearchParams(req, [])}`, {...initReq, method: "GET"})
102
+ }
103
+ static UpdateModel(req: UpdateModelRequest, initReq?: fm.InitReq): Promise<Model> {
104
+ return fm.fetchReq<UpdateModelRequest, Model>(`/apis/admin.hydra.io/v1alpha1/models/${req["modelId"]}`, {...initReq, method: "PUT", body: JSON.stringify(req, fm.replacer)})
105
+ }
106
+ static DeleteModel(req: SingleModelRequest, initReq?: fm.InitReq): Promise<Model> {
107
+ return fm.fetchReq<SingleModelRequest, Model>(`/apis/admin.hydra.io/v1alpha1/models/${req["modelId"]}`, {...initReq, method: "DELETE"})
108
+ }
109
+ static ImportModel(req: ImportModelRequest, initReq?: fm.InitReq): Promise<ImportModelResponse> {
110
+ return fm.fetchReq<ImportModelRequest, ImportModelResponse>(`/apis/admin.hydra.io/v1alpha1/models:import`, {...initReq, method: "POST", body: JSON.stringify(req, fm.replacer)})
111
+ }
112
+ static BatchCreateModels(req: BatchCreateModelsRequest, initReq?: fm.InitReq): Promise<BatchCreateModelsResponse> {
113
+ return fm.fetchReq<BatchCreateModelsRequest, BatchCreateModelsResponse>(`/apis/admin.hydra.io/v1alpha1/models:batch_create`, {...initReq, method: "POST", body: JSON.stringify(req, fm.replacer)})
114
+ }
115
+ static PublishModel(req: SingleModelRequest, initReq?: fm.InitReq): Promise<Model> {
116
+ return fm.fetchReq<SingleModelRequest, Model>(`/apis/admin.hydra.io/v1alpha1/models/${req["modelId"]}:publish`, {...initReq, method: "POST", body: JSON.stringify(req, fm.replacer)})
117
+ }
118
+ static UnpublishModel(req: SingleModelRequest, initReq?: fm.InitReq): Promise<Model> {
119
+ return fm.fetchReq<SingleModelRequest, Model>(`/apis/admin.hydra.io/v1alpha1/models/${req["modelId"]}:unpublish`, {...initReq, method: "POST", body: JSON.stringify(req, fm.replacer)})
120
+ }
121
+ }
@@ -0,0 +1,59 @@
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
+ export type CreateProviderRequest = {
10
+ providerId?: string
11
+ providerName?: HydraCommonCommon.I18nName
12
+ providerDescription?: HydraCommonCommon.I18nName
13
+ providerAvatar?: string
14
+ }
15
+
16
+ export type Provider = {
17
+ providerId?: string
18
+ providerName?: HydraCommonCommon.I18nName
19
+ providerDescription?: HydraCommonCommon.I18nName
20
+ providerAvatar?: string
21
+ }
22
+
23
+ export type UpdateProviderRequest = {
24
+ providerId?: string
25
+ providerName?: HydraCommonCommon.I18nName
26
+ providerDescription?: HydraCommonCommon.I18nName
27
+ providerAvatar?: string
28
+ }
29
+
30
+ export type ListProviderRequest = {
31
+ page?: HydraCommonCommon.Pagination
32
+ }
33
+
34
+ export type ListProviderResponse = {
35
+ items?: Provider[]
36
+ page?: HydraCommonCommon.Pagination
37
+ }
38
+
39
+ export type SingleProviderRequest = {
40
+ providerId?: string
41
+ }
42
+
43
+ export class AdminProviderManagement {
44
+ static CreateProvider(req: CreateProviderRequest, initReq?: fm.InitReq): Promise<Provider> {
45
+ return fm.fetchReq<CreateProviderRequest, Provider>(`/apis/admin.hydra.io/v1alpha1/providers`, {...initReq, method: "POST", body: JSON.stringify(req, fm.replacer)})
46
+ }
47
+ static GetProvider(req: SingleProviderRequest, initReq?: fm.InitReq): Promise<Provider> {
48
+ return fm.fetchReq<SingleProviderRequest, Provider>(`/apis/admin.hydra.io/v1alpha1/providers/${req["providerId"]}?${fm.renderURLSearchParams(req, ["providerId"])}`, {...initReq, method: "GET"})
49
+ }
50
+ static ListProviders(req: ListProviderRequest, initReq?: fm.InitReq): Promise<ListProviderResponse> {
51
+ return fm.fetchReq<ListProviderRequest, ListProviderResponse>(`/apis/admin.hydra.io/v1alpha1/providers?${fm.renderURLSearchParams(req, [])}`, {...initReq, method: "GET"})
52
+ }
53
+ static UpdateProvider(req: UpdateProviderRequest, initReq?: fm.InitReq): Promise<Provider> {
54
+ return fm.fetchReq<UpdateProviderRequest, Provider>(`/apis/admin.hydra.io/v1alpha1/providers/${req["providerId"]}`, {...initReq, method: "PUT", body: JSON.stringify(req, fm.replacer)})
55
+ }
56
+ static DeleteProvider(req: SingleProviderRequest, initReq?: fm.InitReq): Promise<Provider> {
57
+ return fm.fetchReq<SingleProviderRequest, Provider>(`/apis/admin.hydra.io/v1alpha1/providers/${req["providerId"]}`, {...initReq, method: "DELETE"})
58
+ }
59
+ }
@@ -8,6 +8,7 @@ export enum Mode {
8
8
  MODE_UNSPECIFIED = "MODE_UNSPECIFIED",
9
9
  CSP = "CSP",
10
10
  WS = "WS",
11
+ Any = "Any",
11
12
  }
12
13
 
13
14
  export type NoParamsQuery = {
@@ -28,6 +28,19 @@ export enum PublicModelConfigRateLimitLimitedBy {
28
28
  API_KEY = "API_KEY",
29
29
  }
30
30
 
31
+ export enum DeployTemplateGPUType {
32
+ GPU_TYPE_UNSPECIFIED = "GPU_TYPE_UNSPECIFIED",
33
+ NVIDIA_GPU = "NVIDIA_GPU",
34
+ NVIDIA_vGPU = "NVIDIA_vGPU",
35
+ }
36
+
37
+ export enum DeployTemplateInferenceRuntime {
38
+ INFERENCE_RUNTIME_UNSPECIFIED = "INFERENCE_RUNTIME_UNSPECIFIED",
39
+ VLLM = "VLLM",
40
+ SGLANG = "SGLANG",
41
+ IMAGE_GEN = "IMAGE_GEN",
42
+ }
43
+
31
44
  export type ModelPrice = {
32
45
  inputPerKTokens?: string
33
46
  outputPerKTokens?: string
@@ -77,6 +90,25 @@ export type PublicModelConfig = {
77
90
  rateLimit?: PublicModelConfigRateLimit
78
91
  }
79
92
 
93
+ export type ModelServingSpec = {
94
+ deployTemplates?: DeployTemplate[]
95
+ }
96
+
97
+ export type DeployTemplateResourcesRequirements = {
98
+ cpu?: number
99
+ memory?: number
100
+ gpuType?: DeployTemplateGPUType
101
+ gpuCount?: number
102
+ perGpuMemory?: number
103
+ }
104
+
105
+ export type DeployTemplate = {
106
+ resourcesRequirements?: DeployTemplateResourcesRequirements
107
+ runtime?: DeployTemplateInferenceRuntime
108
+ versionRequired?: string
109
+ customDeployArgs?: string[]
110
+ }
111
+
80
112
  export type ListWSModelRequest = {
81
113
  workspace?: number
82
114
  page?: HydraCommonCommon.Pagination
@@ -7,11 +7,6 @@
7
7
  import * as HydraCommonCommon from "../../../common/common.pb"
8
8
  import * as fm from "../../../fetch.pb"
9
9
  import * as GoogleProtobufTimestamp from "../../../google/protobuf/timestamp.pb"
10
- export type CreateProviderRequest = {
11
- providerName?: string
12
- providerAvatar?: string
13
- }
14
-
15
10
  export type Provider = {
16
11
  providerId?: string
17
12
  providerName?: HydraCommonCommon.I18nName
@@ -32,12 +27,6 @@ export type SingleProviderRequest = {
32
27
  id?: string
33
28
  }
34
29
 
35
- export type CreateWSProviderRequest = {
36
- providerName?: string
37
- providerAvatar?: string
38
- workspace?: number
39
- }
40
-
41
30
  export type ListWSProviderRequest = {
42
31
  page?: HydraCommonCommon.Pagination
43
32
  workspace?: number
@@ -62,30 +51,18 @@ export type SingleWSProviderRequest = {
62
51
  }
63
52
 
64
53
  export class ProviderManagement {
65
- static CreateProvider(req: CreateProviderRequest, initReq?: fm.InitReq): Promise<Provider> {
66
- return fm.fetchReq<CreateProviderRequest, Provider>(`/apis/hydra.io/v1alpha1/providers`, {...initReq, method: "POST", body: JSON.stringify(req, fm.replacer)})
67
- }
68
54
  static GetProvider(req: SingleProviderRequest, initReq?: fm.InitReq): Promise<Provider> {
69
55
  return fm.fetchReq<SingleProviderRequest, Provider>(`/apis/hydra.io/v1alpha1/providers/${req["id"]}?${fm.renderURLSearchParams(req, ["id"])}`, {...initReq, method: "GET"})
70
56
  }
71
57
  static ListProvider(req: ListProviderRequest, initReq?: fm.InitReq): Promise<ListProviderResponse> {
72
58
  return fm.fetchReq<ListProviderRequest, ListProviderResponse>(`/apis/hydra.io/v1alpha1/providers?${fm.renderURLSearchParams(req, [])}`, {...initReq, method: "GET"})
73
59
  }
74
- static DeleteProvider(req: SingleProviderRequest, initReq?: fm.InitReq): Promise<Provider> {
75
- return fm.fetchReq<SingleProviderRequest, Provider>(`/apis/hydra.io/v1alpha1/providers/${req["id"]}`, {...initReq, method: "DELETE", body: JSON.stringify(req, fm.replacer)})
76
- }
77
60
  }
78
61
  export class WSProviderManagement {
79
- static CreateWSProvider(req: CreateWSProviderRequest, initReq?: fm.InitReq): Promise<WSProvider> {
80
- return fm.fetchReq<CreateWSProviderRequest, WSProvider>(`/apis/hydra.io/v1alpha1/workspaces/${req["workspace"]}/providers`, {...initReq, method: "POST", body: JSON.stringify(req, fm.replacer)})
81
- }
82
62
  static GetWSProvider(req: SingleWSProviderRequest, initReq?: fm.InitReq): Promise<WSProvider> {
83
63
  return fm.fetchReq<SingleWSProviderRequest, WSProvider>(`/apis/hydra.io/v1alpha1/workspaces/${req["workspace"]}/providers/${req["id"]}?${fm.renderURLSearchParams(req, ["workspace", "id"])}`, {...initReq, method: "GET"})
84
64
  }
85
65
  static ListWSProvider(req: ListWSProviderRequest, initReq?: fm.InitReq): Promise<ListWSProviderResponse> {
86
66
  return fm.fetchReq<ListWSProviderRequest, ListWSProviderResponse>(`/apis/hydra.io/v1alpha1/workspaces/${req["workspace"]}/providers?${fm.renderURLSearchParams(req, ["workspace"])}`, {...initReq, method: "GET"})
87
67
  }
88
- static DeleteWSProvider(req: SingleWSProviderRequest, initReq?: fm.InitReq): Promise<WSProvider> {
89
- return fm.fetchReq<SingleWSProviderRequest, WSProvider>(`/apis/hydra.io/v1alpha1/workspaces/${req["workspace"]}/providers/${req["id"]}`, {...initReq, method: "DELETE", body: JSON.stringify(req, fm.replacer)})
90
- }
91
68
  }
@@ -38,6 +38,7 @@ export enum ModelServingActionRequestAction {
38
38
  export enum WSModelServingActionRequestAction {
39
39
  MODEL_SERVING_ACTION_UNSPECIFIED = "MODEL_SERVING_ACTION_UNSPECIFIED",
40
40
  START = "START",
41
+ STOP = "STOP",
41
42
  }
42
43
 
43
44
  export type CreateModelServingRequest = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@daocloud-proto/hydra",
3
- "version": "v0.5.0-dev-3",
3
+ "version": "v0.5.0-dev-7",
4
4
  "description": "",
5
5
  "author": "",
6
6
  "license": "ISC"