@daocloud-proto/hydra 0.0.0-dev-23801a3d → 0.0.0-dev-e3f01965

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.
@@ -99,6 +99,15 @@ export type ReportFineTuneMetricsResponse = {
99
99
  accepted?: boolean
100
100
  }
101
101
 
102
+ export type ReportEvalMetricsRequest = {
103
+ jobId?: string
104
+ metric?: {[key: string]: number}
105
+ }
106
+
107
+ export type ReportEvalMetricsResponse = {
108
+ accepted?: boolean
109
+ }
110
+
102
111
  export class AgentCommunicationService {
103
112
  static FetchAPIKeyByKey(req: FetchAPIKeyRequest, initReq?: fm.InitReq): Promise<HydraManagement_apiApikeyV1alpha1Apikey.APIKey> {
104
113
  return fm.fetchReq<FetchAPIKeyRequest, HydraManagement_apiApikeyV1alpha1Apikey.APIKey>(`/hydra.management_api.agent.v1alpha1.AgentCommunicationService/FetchAPIKeyByKey`, {...initReq, method: "POST", body: JSON.stringify(req, fm.replacer)})
@@ -112,4 +121,7 @@ export class AgentCommunicationService {
112
121
  static ReportFineTuneMetrics(req: ReportFineTuneMetricsRequest, initReq?: fm.InitReq): Promise<ReportFineTuneMetricsResponse> {
113
122
  return fm.fetchReq<ReportFineTuneMetricsRequest, ReportFineTuneMetricsResponse>(`/apis/hydra.io/v1alpha1/agent/fine-tune-metrics:report`, {...initReq, method: "POST", body: JSON.stringify(req, fm.replacer)})
114
123
  }
124
+ static ReportEvalMetrics(req: ReportEvalMetricsRequest, initReq?: fm.InitReq): Promise<ReportEvalMetricsResponse> {
125
+ return fm.fetchReq<ReportEvalMetricsRequest, ReportEvalMetricsResponse>(`/apis/hydra.io/v1alpha1/agent/evaljob-metrics:report`, {...initReq, method: "POST", body: JSON.stringify(req, fm.replacer)})
126
+ }
115
127
  }
@@ -0,0 +1,124 @@
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 GoogleProtobufStruct from "../../../google/protobuf/struct.pb"
11
+ import * as GoogleProtobufTimestamp from "../../../google/protobuf/timestamp.pb"
12
+ import * as HydraManagement_apiFinetuneV1alpha1Common from "./common.pb"
13
+ import * as HydraManagement_apiFinetuneV1alpha1Finetuneconfig from "./finetuneconfig.pb"
14
+
15
+ type Absent<T, K extends keyof T> = { [k in Exclude<keyof T, K>]?: undefined };
16
+ type OneOf<T> =
17
+ | { [k in keyof T]?: undefined }
18
+ | (
19
+ keyof T extends infer K ?
20
+ (K extends string & keyof T ? { [k in K]: T[K] } & Absent<T, K>
21
+ : never)
22
+ : never);
23
+ export type EvalJob = {
24
+ id?: string
25
+ name?: string
26
+ workspace?: number
27
+ cluster?: string
28
+ namespace?: string
29
+ resources?: HydraManagement_apiFinetuneV1alpha1Finetuneconfig.ResourceConfig
30
+ finetuneConfigName?: string
31
+ finetuneJobName?: string
32
+ finetuneJobId?: string
33
+ datasetId?: string
34
+ datasetVolumeId?: string
35
+ cutoffLen?: number
36
+ maxSamples?: number
37
+ overwriteCache?: boolean
38
+ preprocessingNumWorkers?: number
39
+ perDeviceEvalBatchSize?: number
40
+ predictWithGenerate?: boolean
41
+ ddpTimeout?: string
42
+ phase?: HydraManagement_apiFinetuneV1alpha1Common.JobStatus
43
+ reason?: string
44
+ creationTimestamp?: GoogleProtobufTimestamp.Timestamp
45
+ completionTimestamp?: GoogleProtobufTimestamp.Timestamp
46
+ }
47
+
48
+
49
+ /* hydra modified */ export type BaseCreateWSEvalJobRequest = {
50
+ workspace?: number
51
+ name?: string
52
+ cluster?: string
53
+ namespace?: string
54
+ resources?: HydraManagement_apiFinetuneV1alpha1Finetuneconfig.ResourceConfig
55
+ finetuneConfigName?: string
56
+ finetuneJobName?: string
57
+ datasetId?: string
58
+ datasetVolumeId?: string
59
+ }
60
+
61
+ export type CreateWSEvalJobRequest = BaseCreateWSEvalJobRequest
62
+ & OneOf<{ cutoffLen: number }>
63
+ & OneOf<{ maxSamples: number }>
64
+ & OneOf<{ overwriteCache: boolean }>
65
+ & OneOf<{ preprocessingNumWorkers: number }>
66
+ & OneOf<{ perDeviceEvalBatchSize: number }>
67
+ & OneOf<{ predictWithGenerate: boolean }>
68
+ & OneOf<{ ddpTimeout: string }>
69
+
70
+ export type GetWSEvalJobRequest = {
71
+ workspace?: number
72
+ cluster?: string
73
+ namespace?: string
74
+ name?: string
75
+ }
76
+
77
+ export type ListWSEvalJobsRequest = {
78
+ workspace?: number
79
+ cluster?: string
80
+ namespace?: string
81
+ page?: HydraCommonCommon.Pagination
82
+ }
83
+
84
+ export type ListWSEvalJobsResponse = {
85
+ items?: EvalJob[]
86
+ page?: HydraCommonCommon.Pagination
87
+ }
88
+
89
+ export type DeleteWSEvalJobRequest = {
90
+ workspace?: number
91
+ cluster?: string
92
+ namespace?: string
93
+ id?: string
94
+ }
95
+
96
+ export type GetWSEvalMetricsRequest = {
97
+ workspace?: number
98
+ id?: string
99
+ }
100
+
101
+ export type GetWSEvalMetricsResponse = {
102
+ metrics?: GoogleProtobufStruct.Struct
103
+ }
104
+
105
+ export class WSEvalJobManagement {
106
+ static CreateWSEvalJob(req: CreateWSEvalJobRequest, initReq?: fm.InitReq): Promise<EvalJob> {
107
+ return fm.fetchReq<CreateWSEvalJobRequest, EvalJob>(`/apis/hydra.io/v1alpha1/workspaces/${req["workspace"]}/clusters/${req["cluster"]}/namespaces/${req["namespace"]}/finetune-evaljobs`, {...initReq, method: "POST", body: JSON.stringify(req, fm.replacer)})
108
+ }
109
+ static GetWSEvalJob(req: GetWSEvalJobRequest, initReq?: fm.InitReq): Promise<EvalJob> {
110
+ return fm.fetchReq<GetWSEvalJobRequest, EvalJob>(`/apis/hydra.io/v1alpha1/workspaces/${req["workspace"]}/clusters/${req["cluster"]}/namespaces/${req["namespace"]}/finetune-evaljobs/${req["name"]}?${fm.renderURLSearchParams(req, ["workspace", "cluster", "namespace", "name"])}`, {...initReq, method: "GET"})
111
+ }
112
+ static ListWSEvalJobs(req: ListWSEvalJobsRequest, initReq?: fm.InitReq): Promise<ListWSEvalJobsResponse> {
113
+ return fm.fetchReq<ListWSEvalJobsRequest, ListWSEvalJobsResponse>(`/apis/hydra.io/v1alpha1/workspaces/${req["workspace"]}/clusters/${req["cluster"]}/namespaces/${req["namespace"]}/finetune-evaljobs?${fm.renderURLSearchParams(req, ["workspace", "cluster", "namespace"])}`, {...initReq, method: "GET"})
114
+ }
115
+ static DeleteWSEvalJob(req: DeleteWSEvalJobRequest, initReq?: fm.InitReq): Promise<GoogleProtobufEmpty.Empty> {
116
+ return fm.fetchReq<DeleteWSEvalJobRequest, GoogleProtobufEmpty.Empty>(`/apis/hydra.io/v1alpha1/workspaces/${req["workspace"]}/clusters/${req["cluster"]}/namespaces/${req["namespace"]}/finetune-evaljobs/${req["id"]}`, {...initReq, method: "DELETE"})
117
+ }
118
+ static DefaultEvalJob(req: GoogleProtobufEmpty.Empty, initReq?: fm.InitReq): Promise<EvalJob> {
119
+ return fm.fetchReq<GoogleProtobufEmpty.Empty, EvalJob>(`/apis/hydra.io/v1alpha1/finetune-evaljobs:default?${fm.renderURLSearchParams(req, [])}`, {...initReq, method: "GET"})
120
+ }
121
+ static GetWSEvalMetrics(req: GetWSEvalMetricsRequest, initReq?: fm.InitReq): Promise<GetWSEvalMetricsResponse> {
122
+ return fm.fetchReq<GetWSEvalMetricsRequest, GetWSEvalMetricsResponse>(`/apis/hydra.io/v1alpha1/workspaces/${req["workspace"]}/finetune-evaljobs/${req["id"]}/metrics?${fm.renderURLSearchParams(req, ["workspace", "id"])}`, {...initReq, method: "GET"})
123
+ }
124
+ }
@@ -8,6 +8,15 @@ 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
+
11
20
  export enum TrainingStage {
12
21
  TRAINING_STAGE_UNSPECIFIED = "TRAINING_STAGE_UNSPECIFIED",
13
22
  SFT = "SFT",
@@ -86,19 +95,18 @@ export type DpoConfig = {
86
95
  refModel?: string
87
96
  }
88
97
 
89
- export type ResourceQuota = {
90
- request?: string
91
- limit?: string
92
- }
93
98
 
94
- export type ResourceConfig = {
95
- replicas?: number
99
+ /* hydra modified */ export type BaseResourceConfig = {
96
100
  gpuType?: string
97
101
  gpuCount?: number
98
- cpu?: ResourceQuota
99
- memory?: ResourceQuota
102
+ cpu?: number
103
+ memory?: number
104
+ perGpuMemory?: number
100
105
  }
101
106
 
107
+ export type ResourceConfig = BaseResourceConfig
108
+ & OneOf<{ gpuCores: number }>
109
+
102
110
  export type FineTuneConfig = {
103
111
  name?: string
104
112
  cluster?: string
@@ -51,6 +51,7 @@ export type FineTuneJob = {
51
51
  creationTimestamp?: GoogleProtobufTimestamp.Timestamp
52
52
  completionTimestamp?: GoogleProtobufTimestamp.Timestamp
53
53
  metrics?: MetricPoint[]
54
+ trainingParams?: GoogleProtobufStruct.Struct
54
55
  }
55
56
 
56
57
  export type CreateWSFineTuneJobRequest = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@daocloud-proto/hydra",
3
- "version": "v0.0.0-dev-23801a3d",
3
+ "version": "v0.0.0-dev-e3f01965",
4
4
  "description": "",
5
5
  "author": "",
6
6
  "license": "ISC"