@daocloud-proto/hydra 0.0.0-dev-df7fe94b → 0.0.0-dev-88ed8f0b

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.
@@ -15,6 +15,7 @@ export enum APIKeyEventType {
15
15
  OUT_OF_QUOTA = "OUT_OF_QUOTA",
16
16
  RECOVERY = "RECOVERY",
17
17
  UPDATE = "UPDATE",
18
+ CREATE = "CREATE",
18
19
  }
19
20
 
20
21
  export enum UsageReportRequestMode {
@@ -8,6 +8,22 @@ 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
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 APIKeyStatus {
21
+ API_KEY_STATUS_UNSPECIFIED = "API_KEY_STATUS_UNSPECIFIED",
22
+ API_KEY_STATUS_ACTIVE = "API_KEY_STATUS_ACTIVE",
23
+ API_KEY_STATUS_DISABLED = "API_KEY_STATUS_DISABLED",
24
+ API_KEY_STATUS_EXPIRED = "API_KEY_STATUS_EXPIRED",
25
+ }
26
+
11
27
  export enum TimePeriod {
12
28
  TIME_PERIOD_UNSPECIFIED = "TIME_PERIOD_UNSPECIFIED",
13
29
  TIME_PERIOD_HOUR = "TIME_PERIOD_HOUR",
@@ -16,15 +32,25 @@ export enum TimePeriod {
16
32
  TIME_PERIOD_MONTH = "TIME_PERIOD_MONTH",
17
33
  }
18
34
 
19
- export type CreateWSAPIKeyRequest = {
35
+
36
+ /* hydra modified */ export type BaseCreateWSAPIKeyRequest = {
20
37
  name?: string
21
38
  workspace?: number
39
+ quota?: string
40
+ unlimitedQuota?: boolean
22
41
  }
23
42
 
24
- export type CreateAPIKeyRequest = {
43
+ export type CreateWSAPIKeyRequest = BaseCreateWSAPIKeyRequest
44
+ & OneOf<{ expireTime: GoogleProtobufTimestamp.Timestamp }>
45
+
46
+
47
+ /* hydra modified */ export type BaseCreateAPIKeyRequest = {
25
48
  name?: string
26
49
  }
27
50
 
51
+ export type CreateAPIKeyRequest = BaseCreateAPIKeyRequest
52
+ & OneOf<{ expireTime: GoogleProtobufTimestamp.Timestamp }>
53
+
28
54
  export type APIKey = {
29
55
  id?: string
30
56
  key?: string
@@ -35,6 +61,13 @@ export type APIKey = {
35
61
  denyModels?: string[]
36
62
  workspace?: number
37
63
  createBy?: string
64
+ quota?: string
65
+ expireTime?: GoogleProtobufTimestamp.Timestamp
66
+ remainingQuota?: string
67
+ remainingQuotaSyncedAt?: GoogleProtobufTimestamp.Timestamp
68
+ status?: APIKeyStatus
69
+ unlimitedQuota?: boolean
70
+ usedQuota?: string
38
71
  }
39
72
 
40
73
  export type ListWSAPIKeyRequest = {
@@ -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
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@daocloud-proto/hydra",
3
- "version": "v0.0.0-dev-df7fe94b",
3
+ "version": "v0.0.0-dev-88ed8f0b",
4
4
  "description": "",
5
5
  "author": "",
6
6
  "license": "ISC"