@daocloud-proto/hydra 0.0.0-dev-593036d8 → 0.0.0-dev-87f727ca
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.
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
import * as HydraCommonCommon from "../../../common/common.pb"
|
|
8
8
|
import * as fm from "../../../fetch.pb"
|
|
9
9
|
import * as GoogleProtobufEmpty from "../../../google/protobuf/empty.pb"
|
|
10
|
+
import * as HydraManagement_apiCoreV1alpha1Permissions from "../../../management-api/core/v1alpha1/permissions.pb"
|
|
10
11
|
import * as HydraManagement_apiWorkspaceV1alpha1Workspace from "../../../management-api/workspace/v1alpha1/workspace.pb"
|
|
11
12
|
export type ListClusterRequest = {
|
|
12
13
|
page?: HydraCommonCommon.Pagination
|
|
@@ -22,6 +23,10 @@ export type ConstantsResponse = {
|
|
|
22
23
|
defaultMountPath?: string
|
|
23
24
|
}
|
|
24
25
|
|
|
26
|
+
export type ListPlatformRolePermissionsForCurrentUserResponse = {
|
|
27
|
+
permissions?: HydraManagement_apiCoreV1alpha1Permissions.Permission[]
|
|
28
|
+
}
|
|
29
|
+
|
|
25
30
|
export class CoreService {
|
|
26
31
|
static AdminListCluster(req: ListClusterRequest, initReq?: fm.InitReq): Promise<ListClusterResponse> {
|
|
27
32
|
return fm.fetchReq<ListClusterRequest, ListClusterResponse>(`/apis/admin.hydra.io/v1alpha1/clusters?${fm.renderURLSearchParams(req, [])}`, {...initReq, method: "GET"})
|
|
@@ -29,4 +34,7 @@ export class CoreService {
|
|
|
29
34
|
static AdminListConstants(req: GoogleProtobufEmpty.Empty, initReq?: fm.InitReq): Promise<ConstantsResponse> {
|
|
30
35
|
return fm.fetchReq<GoogleProtobufEmpty.Empty, ConstantsResponse>(`/apis/admin.hydra.io/v1alpha1/constants?${fm.renderURLSearchParams(req, [])}`, {...initReq, method: "GET"})
|
|
31
36
|
}
|
|
37
|
+
static ListPlatformRolePermissionsForCurrentUser(req: GoogleProtobufEmpty.Empty, initReq?: fm.InitReq): Promise<ListPlatformRolePermissionsForCurrentUserResponse> {
|
|
38
|
+
return fm.fetchReq<GoogleProtobufEmpty.Empty, ListPlatformRolePermissionsForCurrentUserResponse>(`/apis/admin.hydra.io/v1alpha1/permissions?${fm.renderURLSearchParams(req, [])}`, {...initReq, method: "GET"})
|
|
39
|
+
}
|
|
32
40
|
}
|
|
@@ -5,26 +5,44 @@
|
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
7
|
import * as fm from "../../../fetch.pb"
|
|
8
|
-
export type ListRolePermissionsByWorkspaceForCurrentUserRequest = {
|
|
9
|
-
workspace?: number
|
|
10
|
-
}
|
|
11
8
|
|
|
12
|
-
export
|
|
13
|
-
|
|
9
|
+
export enum Permission {
|
|
10
|
+
MODEL_GET = "MODEL_GET",
|
|
11
|
+
MODEL_CREATE = "MODEL_CREATE",
|
|
12
|
+
MODEL_UPDATE = "MODEL_UPDATE",
|
|
13
|
+
MODEL_DELETE = "MODEL_DELETE",
|
|
14
|
+
MAAS_MODEL_GET = "MAAS_MODEL_GET",
|
|
15
|
+
MAAS_MODEL_CREATE = "MAAS_MODEL_CREATE",
|
|
16
|
+
MAAS_MODEL_UPDATE = "MAAS_MODEL_UPDATE",
|
|
17
|
+
MODEL_SERVING_GET = "MODEL_SERVING_GET",
|
|
18
|
+
MODEL_SERVING_CREATE = "MODEL_SERVING_CREATE",
|
|
19
|
+
MODEL_SERVING_UPDATE = "MODEL_SERVING_UPDATE",
|
|
20
|
+
MODEL_SERVING_DELETE = "MODEL_SERVING_DELETE",
|
|
21
|
+
APIKEY_GET = "APIKEY_GET",
|
|
22
|
+
APIKEY_CREATE = "APIKEY_CREATE",
|
|
23
|
+
APIKEY_DELETE = "APIKEY_DELETE",
|
|
24
|
+
CLUSTER_GET = "CLUSTER_GET",
|
|
25
|
+
FILES_STORAGE_GET = "FILES_STORAGE_GET",
|
|
26
|
+
FILES_STORAGE_CREATE = "FILES_STORAGE_CREATE",
|
|
27
|
+
FILES_STORAGE_UPDATE = "FILES_STORAGE_UPDATE",
|
|
28
|
+
FILES_STORAGE_DELETE = "FILES_STORAGE_DELETE",
|
|
29
|
+
QUEUE_GET = "QUEUE_GET",
|
|
30
|
+
QUEUE_CREATE = "QUEUE_CREATE",
|
|
31
|
+
QUEUE_UPDATE = "QUEUE_UPDATE",
|
|
32
|
+
QUEUE_DELETE = "QUEUE_DELETE",
|
|
33
|
+
ALL = "ALL",
|
|
14
34
|
}
|
|
15
35
|
|
|
16
|
-
export type
|
|
36
|
+
export type ListRolePermissionsByWorkspaceForCurrentUserRequest = {
|
|
37
|
+
workspace?: number
|
|
17
38
|
}
|
|
18
39
|
|
|
19
|
-
export type
|
|
20
|
-
permissions?:
|
|
40
|
+
export type ListRolePermissionsByWorkspaceForCurrentUserResponse = {
|
|
41
|
+
permissions?: Permission[]
|
|
21
42
|
}
|
|
22
43
|
|
|
23
44
|
export class Core {
|
|
24
45
|
static ListRolePermissionsByWorkspaceForCurrentUser(req: ListRolePermissionsByWorkspaceForCurrentUserRequest, initReq?: fm.InitReq): Promise<ListRolePermissionsByWorkspaceForCurrentUserResponse> {
|
|
25
46
|
return fm.fetchReq<ListRolePermissionsByWorkspaceForCurrentUserRequest, ListRolePermissionsByWorkspaceForCurrentUserResponse>(`/apis/hydra.io/v1alpha1/workspaces/${req["workspace"]}/permissions?${fm.renderURLSearchParams(req, ["workspace"])}`, {...initReq, method: "GET"})
|
|
26
47
|
}
|
|
27
|
-
static ListPlatformRolePermissionsForCurrentUser(req: ListPlatformRolePermissionsForCurrentUserRequest, initReq?: fm.InitReq): Promise<ListPlatformRolePermissionsForCurrentUserResponse> {
|
|
28
|
-
return fm.fetchReq<ListPlatformRolePermissionsForCurrentUserRequest, ListPlatformRolePermissionsForCurrentUserResponse>(`/apis/hydra.io/v1alpha1/permissions?${fm.renderURLSearchParams(req, [])}`, {...initReq, method: "GET"})
|
|
29
|
-
}
|
|
30
48
|
}
|
|
@@ -0,0 +1,182 @@
|
|
|
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
|
+
|
|
11
|
+
export enum TrainingStage {
|
|
12
|
+
TRAINING_STAGE_UNSPECIFIED = "TRAINING_STAGE_UNSPECIFIED",
|
|
13
|
+
SFT = "SFT",
|
|
14
|
+
DPO = "DPO",
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export enum FineTuningType {
|
|
18
|
+
FINE_TUNING_TYPE_UNSPECIFIED = "FINE_TUNING_TYPE_UNSPECIFIED",
|
|
19
|
+
LORA = "LORA",
|
|
20
|
+
FULL = "FULL",
|
|
21
|
+
FREEZE = "FREEZE",
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export type ModelConfig = {
|
|
25
|
+
modelId?: string
|
|
26
|
+
modelVolumeId?: string
|
|
27
|
+
template?: string
|
|
28
|
+
trustRemoteCode?: boolean
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export type LoraConfig = {
|
|
32
|
+
loraRank?: number
|
|
33
|
+
loraAlpha?: number
|
|
34
|
+
loraDropout?: number
|
|
35
|
+
loraTarget?: string
|
|
36
|
+
additionalTarget?: string
|
|
37
|
+
loraPlusLrRatio?: number
|
|
38
|
+
loraPlusLrEmbedding?: number
|
|
39
|
+
useRslora?: boolean
|
|
40
|
+
useDora?: boolean
|
|
41
|
+
pissaInit?: boolean
|
|
42
|
+
pissaIter?: number
|
|
43
|
+
pissaConvert?: boolean
|
|
44
|
+
createNewAdapter?: boolean
|
|
45
|
+
quantizationBit?: number
|
|
46
|
+
quantizationMethod?: string
|
|
47
|
+
ropeScaling?: string
|
|
48
|
+
booster?: string
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
export type DatasetConfig = {
|
|
52
|
+
datasetId?: string
|
|
53
|
+
datasetVolumeId?: string
|
|
54
|
+
cutoffLen?: number
|
|
55
|
+
maxSamples?: number
|
|
56
|
+
valSize?: string
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
export type TrainingConfig = {
|
|
60
|
+
numTrainEpochs?: string
|
|
61
|
+
perDeviceTrainBatchSize?: number
|
|
62
|
+
gradientAccumulationSteps?: number
|
|
63
|
+
learningRate?: string
|
|
64
|
+
lrSchedulerType?: string
|
|
65
|
+
warmupRatio?: string
|
|
66
|
+
warmupSteps?: number
|
|
67
|
+
bf16?: boolean
|
|
68
|
+
optimizer?: string
|
|
69
|
+
seed?: number
|
|
70
|
+
ddpTimeout?: number
|
|
71
|
+
maxGradNorm?: string
|
|
72
|
+
neftAlpha?: number
|
|
73
|
+
deepspeedStage?: string
|
|
74
|
+
deepspeedOffload?: boolean
|
|
75
|
+
gradientCheckpointing?: boolean
|
|
76
|
+
loggingSteps?: number
|
|
77
|
+
saveSteps?: number
|
|
78
|
+
outputSubPath?: string
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
export type DpoConfig = {
|
|
82
|
+
prefBeta?: string
|
|
83
|
+
prefLoss?: string
|
|
84
|
+
prefFtx?: string
|
|
85
|
+
dpoLabelSmoothing?: string
|
|
86
|
+
refModel?: string
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
export type ResourceQuota = {
|
|
90
|
+
request?: string
|
|
91
|
+
limit?: string
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
export type ResourceConfig = {
|
|
95
|
+
replicas?: number
|
|
96
|
+
gpuType?: string
|
|
97
|
+
gpuCount?: number
|
|
98
|
+
cpu?: ResourceQuota
|
|
99
|
+
memory?: ResourceQuota
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
export type FineTuneConfig = {
|
|
103
|
+
name?: string
|
|
104
|
+
cluster?: string
|
|
105
|
+
stage?: TrainingStage
|
|
106
|
+
finetuningType?: FineTuningType
|
|
107
|
+
model?: ModelConfig
|
|
108
|
+
lora?: LoraConfig
|
|
109
|
+
dataset?: DatasetConfig
|
|
110
|
+
training?: TrainingConfig
|
|
111
|
+
dpo?: DpoConfig
|
|
112
|
+
resources?: ResourceConfig
|
|
113
|
+
createdAt?: GoogleProtobufTimestamp.Timestamp
|
|
114
|
+
updatedAt?: GoogleProtobufTimestamp.Timestamp
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
export type CreateWSFineTuneConfigRequest = {
|
|
118
|
+
workspace?: number
|
|
119
|
+
cluster?: string
|
|
120
|
+
name?: string
|
|
121
|
+
stage?: TrainingStage
|
|
122
|
+
finetuningType?: FineTuningType
|
|
123
|
+
model?: ModelConfig
|
|
124
|
+
lora?: LoraConfig
|
|
125
|
+
dataset?: DatasetConfig
|
|
126
|
+
training?: TrainingConfig
|
|
127
|
+
dpo?: DpoConfig
|
|
128
|
+
resources?: ResourceConfig
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
export type UpdateWSFineTuneConfigRequest = {
|
|
132
|
+
workspace?: number
|
|
133
|
+
cluster?: string
|
|
134
|
+
name?: string
|
|
135
|
+
stage?: TrainingStage
|
|
136
|
+
finetuningType?: FineTuningType
|
|
137
|
+
model?: ModelConfig
|
|
138
|
+
lora?: LoraConfig
|
|
139
|
+
dataset?: DatasetConfig
|
|
140
|
+
training?: TrainingConfig
|
|
141
|
+
dpo?: DpoConfig
|
|
142
|
+
resources?: ResourceConfig
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
export type GetWSFineTuneConfigRequest = {
|
|
146
|
+
workspace?: number
|
|
147
|
+
name?: string
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
export type ListWSFineTuneConfigsRequest = {
|
|
151
|
+
workspace?: number
|
|
152
|
+
cluster?: string
|
|
153
|
+
page?: HydraCommonCommon.Pagination
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
export type ListWSFineTuneConfigsResponse = {
|
|
157
|
+
items?: FineTuneConfig[]
|
|
158
|
+
page?: HydraCommonCommon.Pagination
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
export type DeleteWSFineTuneConfigRequest = {
|
|
162
|
+
workspace?: number
|
|
163
|
+
name?: string
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
export class WSFineTuneConfigManagement {
|
|
167
|
+
static CreateWSFineTuneConfig(req: CreateWSFineTuneConfigRequest, initReq?: fm.InitReq): Promise<FineTuneConfig> {
|
|
168
|
+
return fm.fetchReq<CreateWSFineTuneConfigRequest, FineTuneConfig>(`/apis/hydra.io/v1alpha1/workspaces/${req["workspace"]}/train-configs`, {...initReq, method: "POST", body: JSON.stringify(req, fm.replacer)})
|
|
169
|
+
}
|
|
170
|
+
static UpdateWSFineTuneConfig(req: UpdateWSFineTuneConfigRequest, initReq?: fm.InitReq): Promise<FineTuneConfig> {
|
|
171
|
+
return fm.fetchReq<UpdateWSFineTuneConfigRequest, FineTuneConfig>(`/apis/hydra.io/v1alpha1/workspaces/${req["workspace"]}/train-configs/${req["name"]}`, {...initReq, method: "PUT", body: JSON.stringify(req, fm.replacer)})
|
|
172
|
+
}
|
|
173
|
+
static GetWSFineTuneConfig(req: GetWSFineTuneConfigRequest, initReq?: fm.InitReq): Promise<FineTuneConfig> {
|
|
174
|
+
return fm.fetchReq<GetWSFineTuneConfigRequest, FineTuneConfig>(`/apis/hydra.io/v1alpha1/workspaces/${req["workspace"]}/train-configs/${req["name"]}?${fm.renderURLSearchParams(req, ["workspace", "name"])}`, {...initReq, method: "GET"})
|
|
175
|
+
}
|
|
176
|
+
static ListWSFineTuneConfigs(req: ListWSFineTuneConfigsRequest, initReq?: fm.InitReq): Promise<ListWSFineTuneConfigsResponse> {
|
|
177
|
+
return fm.fetchReq<ListWSFineTuneConfigsRequest, ListWSFineTuneConfigsResponse>(`/apis/hydra.io/v1alpha1/workspaces/${req["workspace"]}/train-configs?${fm.renderURLSearchParams(req, ["workspace"])}`, {...initReq, method: "GET"})
|
|
178
|
+
}
|
|
179
|
+
static DeleteWSFineTuneConfig(req: DeleteWSFineTuneConfigRequest, initReq?: fm.InitReq): Promise<FineTuneConfig> {
|
|
180
|
+
return fm.fetchReq<DeleteWSFineTuneConfigRequest, FineTuneConfig>(`/apis/hydra.io/v1alpha1/workspaces/${req["workspace"]}/train-configs/${req["name"]}`, {...initReq, method: "DELETE"})
|
|
181
|
+
}
|
|
182
|
+
}
|