@gpuai/sdk 0.5.4 → 0.5.5

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.
Files changed (196) hide show
  1. package/.openapi-generator/FILES +56 -0
  2. package/README.md +50 -2
  3. package/dist/apis/EndpointsApi.d.ts +150 -0
  4. package/dist/apis/EndpointsApi.js +379 -0
  5. package/dist/apis/InstancesApi.d.ts +15 -0
  6. package/dist/apis/InstancesApi.js +45 -0
  7. package/dist/apis/JobsApi.d.ts +172 -0
  8. package/dist/apis/JobsApi.js +444 -0
  9. package/dist/apis/OperationsApi.d.ts +17 -0
  10. package/dist/apis/OperationsApi.js +48 -0
  11. package/dist/apis/SecretsApi.d.ts +123 -0
  12. package/dist/apis/SecretsApi.js +328 -0
  13. package/dist/apis/index.d.ts +3 -0
  14. package/dist/apis/index.js +3 -0
  15. package/dist/esm/apis/EndpointsApi.d.ts +150 -0
  16. package/dist/esm/apis/EndpointsApi.js +375 -0
  17. package/dist/esm/apis/InstancesApi.d.ts +15 -0
  18. package/dist/esm/apis/InstancesApi.js +45 -0
  19. package/dist/esm/apis/JobsApi.d.ts +172 -0
  20. package/dist/esm/apis/JobsApi.js +440 -0
  21. package/dist/esm/apis/OperationsApi.d.ts +17 -0
  22. package/dist/esm/apis/OperationsApi.js +48 -0
  23. package/dist/esm/apis/SecretsApi.d.ts +123 -0
  24. package/dist/esm/apis/SecretsApi.js +324 -0
  25. package/dist/esm/apis/index.d.ts +3 -0
  26. package/dist/esm/apis/index.js +3 -0
  27. package/dist/esm/models/DedicatedIPOffer.d.ts +98 -0
  28. package/dist/esm/models/DedicatedIPOffer.js +87 -0
  29. package/dist/esm/models/Endpoint.d.ts +147 -0
  30. package/dist/esm/models/Endpoint.js +121 -0
  31. package/dist/esm/models/EndpointCreate.d.ts +80 -0
  32. package/dist/esm/models/EndpointCreate.js +63 -0
  33. package/dist/esm/models/EndpointList.d.ts +33 -0
  34. package/dist/esm/models/EndpointList.js +44 -0
  35. package/dist/esm/models/EndpointMachine.d.ts +90 -0
  36. package/dist/esm/models/EndpointMachine.js +84 -0
  37. package/dist/esm/models/EndpointReplicaCounts.d.ts +38 -0
  38. package/dist/esm/models/EndpointReplicaCounts.js +47 -0
  39. package/dist/esm/models/Job.d.ts +352 -0
  40. package/dist/esm/models/Job.js +254 -0
  41. package/dist/esm/models/JobAttempt.d.ts +176 -0
  42. package/dist/esm/models/JobAttempt.js +147 -0
  43. package/dist/esm/models/JobCreate.d.ts +153 -0
  44. package/dist/esm/models/JobCreate.js +84 -0
  45. package/dist/esm/models/JobGpuTypes.d.ts +39 -0
  46. package/dist/esm/models/JobGpuTypes.js +48 -0
  47. package/dist/esm/models/JobGpuTypesDataInner.d.ts +58 -0
  48. package/dist/esm/models/JobGpuTypesDataInner.js +59 -0
  49. package/dist/esm/models/JobLogChunk.d.ts +50 -0
  50. package/dist/esm/models/JobLogChunk.js +55 -0
  51. package/dist/esm/models/JobLogs.d.ts +39 -0
  52. package/dist/esm/models/JobLogs.js +48 -0
  53. package/dist/esm/models/JobPage.d.ts +39 -0
  54. package/dist/esm/models/JobPage.js +48 -0
  55. package/dist/esm/models/JobSharingHint.d.ts +46 -0
  56. package/dist/esm/models/JobSharingHint.js +51 -0
  57. package/dist/esm/models/JobTelemetry.d.ts +51 -0
  58. package/dist/esm/models/JobTelemetry.js +56 -0
  59. package/dist/esm/models/JobTelemetryPoint.d.ts +56 -0
  60. package/dist/esm/models/JobTelemetryPoint.js +59 -0
  61. package/dist/esm/models/JobTrial.d.ts +79 -0
  62. package/dist/esm/models/JobTrial.js +73 -0
  63. package/dist/esm/models/Secret.d.ts +62 -0
  64. package/dist/esm/models/Secret.js +63 -0
  65. package/dist/esm/models/SecretCreate.d.ts +44 -0
  66. package/dist/esm/models/SecretCreate.js +49 -0
  67. package/dist/esm/models/SecretImportItem.d.ts +38 -0
  68. package/dist/esm/models/SecretImportItem.js +47 -0
  69. package/dist/esm/models/SecretImportRequest.d.ts +39 -0
  70. package/dist/esm/models/SecretImportRequest.js +46 -0
  71. package/dist/esm/models/SecretImportResult.d.ts +44 -0
  72. package/dist/esm/models/SecretImportResult.js +51 -0
  73. package/dist/esm/models/SecretList.d.ts +33 -0
  74. package/dist/esm/models/SecretList.js +44 -0
  75. package/dist/esm/models/SecretPut.d.ts +38 -0
  76. package/dist/esm/models/SecretPut.js +45 -0
  77. package/dist/esm/models/index.d.ts +25 -0
  78. package/dist/esm/models/index.js +25 -0
  79. package/dist/esm/runtime.js +1 -1
  80. package/dist/models/DedicatedIPOffer.d.ts +98 -0
  81. package/dist/models/DedicatedIPOffer.js +94 -0
  82. package/dist/models/Endpoint.d.ts +147 -0
  83. package/dist/models/Endpoint.js +129 -0
  84. package/dist/models/EndpointCreate.d.ts +80 -0
  85. package/dist/models/EndpointCreate.js +70 -0
  86. package/dist/models/EndpointList.d.ts +33 -0
  87. package/dist/models/EndpointList.js +51 -0
  88. package/dist/models/EndpointMachine.d.ts +90 -0
  89. package/dist/models/EndpointMachine.js +92 -0
  90. package/dist/models/EndpointReplicaCounts.d.ts +38 -0
  91. package/dist/models/EndpointReplicaCounts.js +54 -0
  92. package/dist/models/Job.d.ts +352 -0
  93. package/dist/models/Job.js +262 -0
  94. package/dist/models/JobAttempt.d.ts +176 -0
  95. package/dist/models/JobAttempt.js +155 -0
  96. package/dist/models/JobCreate.d.ts +153 -0
  97. package/dist/models/JobCreate.js +92 -0
  98. package/dist/models/JobGpuTypes.d.ts +39 -0
  99. package/dist/models/JobGpuTypes.js +55 -0
  100. package/dist/models/JobGpuTypesDataInner.d.ts +58 -0
  101. package/dist/models/JobGpuTypesDataInner.js +66 -0
  102. package/dist/models/JobLogChunk.d.ts +50 -0
  103. package/dist/models/JobLogChunk.js +62 -0
  104. package/dist/models/JobLogs.d.ts +39 -0
  105. package/dist/models/JobLogs.js +55 -0
  106. package/dist/models/JobPage.d.ts +39 -0
  107. package/dist/models/JobPage.js +55 -0
  108. package/dist/models/JobSharingHint.d.ts +46 -0
  109. package/dist/models/JobSharingHint.js +58 -0
  110. package/dist/models/JobTelemetry.d.ts +51 -0
  111. package/dist/models/JobTelemetry.js +63 -0
  112. package/dist/models/JobTelemetryPoint.d.ts +56 -0
  113. package/dist/models/JobTelemetryPoint.js +66 -0
  114. package/dist/models/JobTrial.d.ts +79 -0
  115. package/dist/models/JobTrial.js +81 -0
  116. package/dist/models/Secret.d.ts +62 -0
  117. package/dist/models/Secret.js +70 -0
  118. package/dist/models/SecretCreate.d.ts +44 -0
  119. package/dist/models/SecretCreate.js +56 -0
  120. package/dist/models/SecretImportItem.d.ts +38 -0
  121. package/dist/models/SecretImportItem.js +54 -0
  122. package/dist/models/SecretImportRequest.d.ts +39 -0
  123. package/dist/models/SecretImportRequest.js +53 -0
  124. package/dist/models/SecretImportResult.d.ts +44 -0
  125. package/dist/models/SecretImportResult.js +58 -0
  126. package/dist/models/SecretList.d.ts +33 -0
  127. package/dist/models/SecretList.js +51 -0
  128. package/dist/models/SecretPut.d.ts +38 -0
  129. package/dist/models/SecretPut.js +52 -0
  130. package/dist/models/index.d.ts +25 -0
  131. package/dist/models/index.js +25 -0
  132. package/dist/runtime.js +1 -1
  133. package/docs/DedicatedIPOffer.md +56 -0
  134. package/docs/Endpoint.md +68 -0
  135. package/docs/EndpointCreate.md +50 -0
  136. package/docs/EndpointList.md +34 -0
  137. package/docs/EndpointMachine.md +50 -0
  138. package/docs/EndpointReplicaCounts.md +36 -0
  139. package/docs/EndpointsApi.md +544 -0
  140. package/docs/InstancesApi.md +67 -0
  141. package/docs/Job.md +125 -0
  142. package/docs/JobAttempt.md +69 -0
  143. package/docs/JobCreate.md +66 -0
  144. package/docs/JobGpuTypes.md +36 -0
  145. package/docs/JobGpuTypesDataInner.md +42 -0
  146. package/docs/JobLogChunk.md +40 -0
  147. package/docs/JobLogs.md +36 -0
  148. package/docs/JobPage.md +36 -0
  149. package/docs/JobSharingHint.md +39 -0
  150. package/docs/JobTelemetry.md +40 -0
  151. package/docs/JobTelemetryPoint.md +42 -0
  152. package/docs/JobTrial.md +46 -0
  153. package/docs/JobsApi.md +609 -0
  154. package/docs/OperationsApi.md +76 -0
  155. package/docs/Secret.md +45 -0
  156. package/docs/SecretCreate.md +38 -0
  157. package/docs/SecretImportItem.md +36 -0
  158. package/docs/SecretImportRequest.md +36 -0
  159. package/docs/SecretImportResult.md +38 -0
  160. package/docs/SecretList.md +34 -0
  161. package/docs/SecretPut.md +36 -0
  162. package/docs/SecretsApi.md +450 -0
  163. package/package.json +1 -1
  164. package/src/apis/EndpointsApi.ts +481 -0
  165. package/src/apis/InstancesApi.ts +52 -0
  166. package/src/apis/JobsApi.ts +551 -0
  167. package/src/apis/OperationsApi.ts +59 -0
  168. package/src/apis/SecretsApi.ts +413 -0
  169. package/src/apis/index.ts +3 -0
  170. package/src/models/DedicatedIPOffer.ts +165 -0
  171. package/src/models/Endpoint.ts +247 -0
  172. package/src/models/EndpointCreate.ts +132 -0
  173. package/src/models/EndpointList.ts +74 -0
  174. package/src/models/EndpointMachine.ts +151 -0
  175. package/src/models/EndpointReplicaCounts.ts +75 -0
  176. package/src/models/Job.ts +538 -0
  177. package/src/models/JobAttempt.ts +267 -0
  178. package/src/models/JobCreate.ts +221 -0
  179. package/src/models/JobGpuTypes.ts +83 -0
  180. package/src/models/JobGpuTypesDataInner.ts +104 -0
  181. package/src/models/JobLogChunk.ts +93 -0
  182. package/src/models/JobLogs.ts +83 -0
  183. package/src/models/JobPage.ts +83 -0
  184. package/src/models/JobSharingHint.ts +86 -0
  185. package/src/models/JobTelemetry.ts +101 -0
  186. package/src/models/JobTelemetryPoint.ts +102 -0
  187. package/src/models/JobTrial.ts +132 -0
  188. package/src/models/Secret.ts +111 -0
  189. package/src/models/SecretCreate.ts +83 -0
  190. package/src/models/SecretImportItem.ts +75 -0
  191. package/src/models/SecretImportRequest.ts +82 -0
  192. package/src/models/SecretImportResult.ts +84 -0
  193. package/src/models/SecretList.ts +74 -0
  194. package/src/models/SecretPut.ts +74 -0
  195. package/src/models/index.ts +25 -0
  196. package/src/runtime.ts +1 -1
@@ -0,0 +1,352 @@
1
+ /**
2
+ * GPU.ai Public Developer API
3
+ * Programmatic API for GPU.ai. Authenticate with API keys minted from the dashboard. See https://gpu.ai/docs for details.
4
+ *
5
+ * The version of the OpenAPI document: 1.0.0
6
+ * Contact: support@gpu.ai
7
+ *
8
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
9
+ * https://openapi-generator.tech
10
+ * Do not edit the class manually.
11
+ */
12
+ import type { JobAttempt } from './JobAttempt';
13
+ import type { JobSharingHint } from './JobSharingHint';
14
+ /**
15
+ * A batch job. It names no machine: the machines a job runs on are instances of your organization and appear in the instance list.
16
+ *
17
+ * @export
18
+ * @interface Job
19
+ */
20
+ export interface Job {
21
+ /**
22
+ *
23
+ * @type {string}
24
+ * @memberof Job
25
+ */
26
+ id: string;
27
+ /**
28
+ *
29
+ * @type {string}
30
+ * @memberof Job
31
+ */
32
+ name: string;
33
+ /**
34
+ *
35
+ * @type {string}
36
+ * @memberof Job
37
+ */
38
+ image: string;
39
+ /**
40
+ *
41
+ * @type {Array<string>}
42
+ * @memberof Job
43
+ */
44
+ command: Array<string>;
45
+ /**
46
+ * The names of the job's environment variables. Values are never returned.
47
+ * @type {Array<string>}
48
+ * @memberof Job
49
+ */
50
+ envNames: Array<string>;
51
+ /**
52
+ * Names of the organization secrets the job receives. Empty when none.
53
+ * @type {Array<string>}
54
+ * @memberof Job
55
+ */
56
+ secrets: Array<string>;
57
+ /**
58
+ * The requested GPU model, or an empty string when the job asked for `min_vram_gb` only.
59
+ * @type {string}
60
+ * @memberof Job
61
+ */
62
+ gpuType: string;
63
+ /**
64
+ *
65
+ * @type {number}
66
+ * @memberof Job
67
+ */
68
+ minVramGb: number;
69
+ /**
70
+ *
71
+ * @type {number}
72
+ * @memberof Job
73
+ */
74
+ memoryHintMb: number | null;
75
+ /**
76
+ *
77
+ * @type {number}
78
+ * @memberof Job
79
+ */
80
+ computeHintPct: number | null;
81
+ /**
82
+ *
83
+ * @type {number}
84
+ * @memberof Job
85
+ */
86
+ timeoutSeconds: number;
87
+ /**
88
+ *
89
+ * @type {number}
90
+ * @memberof Job
91
+ */
92
+ maxWaitSeconds: number;
93
+ /**
94
+ *
95
+ * @type {boolean}
96
+ * @memberof Job
97
+ */
98
+ allowSharing: boolean;
99
+ /**
100
+ *
101
+ * @type {boolean}
102
+ * @memberof Job
103
+ */
104
+ allowRestart: boolean;
105
+ /**
106
+ *
107
+ * @type {JobIsolationEnum}
108
+ * @memberof Job
109
+ */
110
+ isolation: JobIsolationEnum;
111
+ /**
112
+ * The GPU slice (NVIDIA MIG profile) a job with `isolation` `hard` runs in during its current or last attempt, such as `3g.40gb`; null for a soft job or one with a whole GPU.
113
+ *
114
+ * @type {string}
115
+ * @memberof Job
116
+ */
117
+ migProfile: string | null;
118
+ /**
119
+ *
120
+ * @type {string}
121
+ * @memberof Job
122
+ */
123
+ checkpointPath: string | null;
124
+ /**
125
+ *
126
+ * @type {number}
127
+ * @memberof Job
128
+ */
129
+ maxRetries: number;
130
+ /**
131
+ *
132
+ * @type {number}
133
+ * @memberof Job
134
+ */
135
+ maxPricePerHour: number | null;
136
+ /**
137
+ * `queued` is waiting for a GPU, `assigned` has a GPU and is about to start, `running` is running. `succeeded`, `failed` and `cancelled` are final. A job that is retried goes back to `queued`.
138
+ *
139
+ * @type {JobStatusEnum}
140
+ * @memberof Job
141
+ */
142
+ status: JobStatusEnum;
143
+ /**
144
+ * Why the job is waiting, or why it failed or was retried.
145
+ * @type {string}
146
+ * @memberof Job
147
+ */
148
+ statusReason: string | null;
149
+ /**
150
+ * True once a cancel has been asked for and until the job stops.
151
+ * @type {boolean}
152
+ * @memberof Job
153
+ */
154
+ cancelRequested: boolean;
155
+ /**
156
+ * The number of the current or last attempt. 0 before the job is first placed.
157
+ * @type {number}
158
+ * @memberof Job
159
+ */
160
+ attempt: number;
161
+ /**
162
+ * Reruns after a memory failure, counted against `max_retries`.
163
+ * @type {number}
164
+ * @memberof Job
165
+ */
166
+ retries: number;
167
+ /**
168
+ * Times the job was stopped for outgrowing its reservation on a full GPU.
169
+ * @type {number}
170
+ * @memberof Job
171
+ */
172
+ evictions: number;
173
+ /**
174
+ * Times the job exited out of GPU memory.
175
+ * @type {number}
176
+ * @memberof Job
177
+ */
178
+ oomExits: number;
179
+ /**
180
+ * GPU memory reserved for the current or last attempt, in MiB. For a whole GPU it is the GPU's total memory. It is used for placement and is not a hard cap.
181
+ *
182
+ * @type {number}
183
+ * @memberof Job
184
+ */
185
+ reservationMb: number | null;
186
+ /**
187
+ * Whether the current or last attempt has a GPU to itself. Null before the job is first placed.
188
+ * @type {boolean}
189
+ * @memberof Job
190
+ */
191
+ wholeGpu: boolean | null;
192
+ /**
193
+ * The estimate behind the reservation, from the hint or from history, with headroom.
194
+ * @type {number}
195
+ * @memberof Job
196
+ */
197
+ predictedMb: number | null;
198
+ /**
199
+ * Where the reservation came from: `hint`, `history:org+name`, `history:org+image`, `history:image`, `none` (no hint and no usable history), `not_shared` (the job did not opt in to sharing) or `no_restart` (sharing needs restart). `+retry` is appended once a memory failure has grown the reservation.
200
+ *
201
+ * @type {string}
202
+ * @memberof Job
203
+ */
204
+ predictionSource: string | null;
205
+ /**
206
+ * The compute duty the current or last attempt was charged on its GPU, 1 to 100. 100 when the job's compute is unknown.
207
+ *
208
+ * @type {number}
209
+ * @memberof Job
210
+ */
211
+ predictedComputePct: number | null;
212
+ /**
213
+ * Where the compute duty came from: `hint`, `history:org+name`, `history:org+image`, `history:image` or `none` (unknown, counted as 100).
214
+ *
215
+ * @type {string}
216
+ * @memberof Job
217
+ */
218
+ computePredictionSource: string | null;
219
+ /**
220
+ * The job's highest GPU memory use so far, across attempts, in MiB.
221
+ * @type {number}
222
+ * @memberof Job
223
+ */
224
+ peakMemoryMb: number | null;
225
+ /**
226
+ * Total memory of the GPU the current or last attempt runs on, in MiB.
227
+ * @type {number}
228
+ * @memberof Job
229
+ */
230
+ gpuMemoryTotalMb: number | null;
231
+ /**
232
+ * Mean GPU utilization measured during the last finished attempt. See `compute_source` on the attempt for how it was attributed.
233
+ *
234
+ * @type {number}
235
+ * @memberof Job
236
+ */
237
+ utilMeanPct: number | null;
238
+ /**
239
+ * Share of the last finished attempt's samples with GPU utilization at or above 50%. Close to `util_mean_pct` for a job that runs in on/off bursts, near 0 or 100 for a steady one.
240
+ *
241
+ * @type {number}
242
+ * @memberof Job
243
+ */
244
+ busyPct: number | null;
245
+ /**
246
+ * Where the job's memory numbers come from: `process` is the GPU's per-process accounting, `limit` means per-process memory was not visible and the reservation stands in for it.
247
+ *
248
+ * @type {JobMemorySourceEnum}
249
+ * @memberof Job
250
+ */
251
+ memorySource: JobMemorySourceEnum | null;
252
+ /**
253
+ * How the GPU was shared during the last attempt. `mig` is a GPU slice of the job's own.
254
+ * @type {JobSharingModeEnum}
255
+ * @memberof Job
256
+ */
257
+ sharingMode: JobSharingModeEnum | null;
258
+ /**
259
+ * Seconds the job has spent running on a GPU, across attempts.
260
+ * @type {number}
261
+ * @memberof Job
262
+ */
263
+ gpuSeconds: number;
264
+ /**
265
+ * The job's share of its machines' price, for display. A GPU's hourly price is split equally between the jobs running on it at the time, so a job that shared a GPU is attributed less than one that had it alone. A job in a GPU slice is attributed its slice's share of the GPU (for example 3/7 for `3g.40gb`). Machine time with no job running is not attributed to any job. The bill of record is the machine's instance billing.
266
+ *
267
+ * @type {number}
268
+ * @memberof Job
269
+ */
270
+ attributedCostUsd: number;
271
+ /**
272
+ *
273
+ * @type {number}
274
+ * @memberof Job
275
+ */
276
+ exitCode: number | null;
277
+ /**
278
+ *
279
+ * @type {Date}
280
+ * @memberof Job
281
+ */
282
+ createdAt: Date;
283
+ /**
284
+ * When the current or last attempt started.
285
+ * @type {Date}
286
+ * @memberof Job
287
+ */
288
+ startedAt: Date | null;
289
+ /**
290
+ *
291
+ * @type {Date}
292
+ * @memberof Job
293
+ */
294
+ finishedAt: Date | null;
295
+ /**
296
+ *
297
+ * @type {JobSharingHint}
298
+ * @memberof Job
299
+ */
300
+ sharingHint?: JobSharingHint;
301
+ /**
302
+ * The job's attempts, oldest first. Returned by GET /v1/jobs/{id} only.
303
+ * @type {Array<JobAttempt>}
304
+ * @memberof Job
305
+ */
306
+ attempts?: Array<JobAttempt>;
307
+ }
308
+ /**
309
+ * @export
310
+ */
311
+ export declare const JobIsolationEnum: {
312
+ readonly Soft: "soft";
313
+ readonly Hard: "hard";
314
+ };
315
+ export type JobIsolationEnum = typeof JobIsolationEnum[keyof typeof JobIsolationEnum];
316
+ /**
317
+ * @export
318
+ */
319
+ export declare const JobStatusEnum: {
320
+ readonly Queued: "queued";
321
+ readonly Assigned: "assigned";
322
+ readonly Running: "running";
323
+ readonly Succeeded: "succeeded";
324
+ readonly Failed: "failed";
325
+ readonly Cancelled: "cancelled";
326
+ };
327
+ export type JobStatusEnum = typeof JobStatusEnum[keyof typeof JobStatusEnum];
328
+ /**
329
+ * @export
330
+ */
331
+ export declare const JobMemorySourceEnum: {
332
+ readonly Process: "process";
333
+ readonly Limit: "limit";
334
+ };
335
+ export type JobMemorySourceEnum = typeof JobMemorySourceEnum[keyof typeof JobMemorySourceEnum];
336
+ /**
337
+ * @export
338
+ */
339
+ export declare const JobSharingModeEnum: {
340
+ readonly TimeSlicing: "time_slicing";
341
+ readonly Mps: "mps";
342
+ readonly Mig: "mig";
343
+ };
344
+ export type JobSharingModeEnum = typeof JobSharingModeEnum[keyof typeof JobSharingModeEnum];
345
+ /**
346
+ * Check if a given object implements the Job interface.
347
+ */
348
+ export declare function instanceOfJob(value: object): value is Job;
349
+ export declare function JobFromJSON(json: any): Job;
350
+ export declare function JobFromJSONTyped(json: any, ignoreDiscriminator: boolean): Job;
351
+ export declare function JobToJSON(json: any): Job;
352
+ export declare function JobToJSONTyped(value?: Job | null, ignoreDiscriminator?: boolean): any;
@@ -0,0 +1,262 @@
1
+ "use strict";
2
+ /* tslint:disable */
3
+ /* eslint-disable */
4
+ /**
5
+ * GPU.ai Public Developer API
6
+ * Programmatic API for GPU.ai. Authenticate with API keys minted from the dashboard. See https://gpu.ai/docs for details.
7
+ *
8
+ * The version of the OpenAPI document: 1.0.0
9
+ * Contact: support@gpu.ai
10
+ *
11
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
12
+ * https://openapi-generator.tech
13
+ * Do not edit the class manually.
14
+ */
15
+ Object.defineProperty(exports, "__esModule", { value: true });
16
+ exports.JobSharingModeEnum = exports.JobMemorySourceEnum = exports.JobStatusEnum = exports.JobIsolationEnum = void 0;
17
+ exports.instanceOfJob = instanceOfJob;
18
+ exports.JobFromJSON = JobFromJSON;
19
+ exports.JobFromJSONTyped = JobFromJSONTyped;
20
+ exports.JobToJSON = JobToJSON;
21
+ exports.JobToJSONTyped = JobToJSONTyped;
22
+ const JobAttempt_1 = require("./JobAttempt");
23
+ const JobSharingHint_1 = require("./JobSharingHint");
24
+ /**
25
+ * @export
26
+ */
27
+ exports.JobIsolationEnum = {
28
+ Soft: 'soft',
29
+ Hard: 'hard'
30
+ };
31
+ /**
32
+ * @export
33
+ */
34
+ exports.JobStatusEnum = {
35
+ Queued: 'queued',
36
+ Assigned: 'assigned',
37
+ Running: 'running',
38
+ Succeeded: 'succeeded',
39
+ Failed: 'failed',
40
+ Cancelled: 'cancelled'
41
+ };
42
+ /**
43
+ * @export
44
+ */
45
+ exports.JobMemorySourceEnum = {
46
+ Process: 'process',
47
+ Limit: 'limit'
48
+ };
49
+ /**
50
+ * @export
51
+ */
52
+ exports.JobSharingModeEnum = {
53
+ TimeSlicing: 'time_slicing',
54
+ Mps: 'mps',
55
+ Mig: 'mig'
56
+ };
57
+ /**
58
+ * Check if a given object implements the Job interface.
59
+ */
60
+ function instanceOfJob(value) {
61
+ if (!('id' in value) || value['id'] === undefined)
62
+ return false;
63
+ if (!('name' in value) || value['name'] === undefined)
64
+ return false;
65
+ if (!('image' in value) || value['image'] === undefined)
66
+ return false;
67
+ if (!('command' in value) || value['command'] === undefined)
68
+ return false;
69
+ if ((!('envNames' in value) && !('env_names' in value)) || (value['envNames'] === undefined && value['env_names'] === undefined))
70
+ return false;
71
+ if (!('secrets' in value) || value['secrets'] === undefined)
72
+ return false;
73
+ if ((!('gpuType' in value) && !('gpu_type' in value)) || (value['gpuType'] === undefined && value['gpu_type'] === undefined))
74
+ return false;
75
+ if ((!('minVramGb' in value) && !('min_vram_gb' in value)) || (value['minVramGb'] === undefined && value['min_vram_gb'] === undefined))
76
+ return false;
77
+ if ((!('memoryHintMb' in value) && !('memory_hint_mb' in value)) || (value['memoryHintMb'] === undefined && value['memory_hint_mb'] === undefined))
78
+ return false;
79
+ if ((!('computeHintPct' in value) && !('compute_hint_pct' in value)) || (value['computeHintPct'] === undefined && value['compute_hint_pct'] === undefined))
80
+ return false;
81
+ if ((!('timeoutSeconds' in value) && !('timeout_seconds' in value)) || (value['timeoutSeconds'] === undefined && value['timeout_seconds'] === undefined))
82
+ return false;
83
+ if ((!('maxWaitSeconds' in value) && !('max_wait_seconds' in value)) || (value['maxWaitSeconds'] === undefined && value['max_wait_seconds'] === undefined))
84
+ return false;
85
+ if ((!('allowSharing' in value) && !('allow_sharing' in value)) || (value['allowSharing'] === undefined && value['allow_sharing'] === undefined))
86
+ return false;
87
+ if ((!('allowRestart' in value) && !('allow_restart' in value)) || (value['allowRestart'] === undefined && value['allow_restart'] === undefined))
88
+ return false;
89
+ if (!('isolation' in value) || value['isolation'] === undefined)
90
+ return false;
91
+ if ((!('migProfile' in value) && !('mig_profile' in value)) || (value['migProfile'] === undefined && value['mig_profile'] === undefined))
92
+ return false;
93
+ if ((!('checkpointPath' in value) && !('checkpoint_path' in value)) || (value['checkpointPath'] === undefined && value['checkpoint_path'] === undefined))
94
+ return false;
95
+ if ((!('maxRetries' in value) && !('max_retries' in value)) || (value['maxRetries'] === undefined && value['max_retries'] === undefined))
96
+ return false;
97
+ if ((!('maxPricePerHour' in value) && !('max_price_per_hour' in value)) || (value['maxPricePerHour'] === undefined && value['max_price_per_hour'] === undefined))
98
+ return false;
99
+ if (!('status' in value) || value['status'] === undefined)
100
+ return false;
101
+ if ((!('statusReason' in value) && !('status_reason' in value)) || (value['statusReason'] === undefined && value['status_reason'] === undefined))
102
+ return false;
103
+ if ((!('cancelRequested' in value) && !('cancel_requested' in value)) || (value['cancelRequested'] === undefined && value['cancel_requested'] === undefined))
104
+ return false;
105
+ if (!('attempt' in value) || value['attempt'] === undefined)
106
+ return false;
107
+ if (!('retries' in value) || value['retries'] === undefined)
108
+ return false;
109
+ if (!('evictions' in value) || value['evictions'] === undefined)
110
+ return false;
111
+ if ((!('oomExits' in value) && !('oom_exits' in value)) || (value['oomExits'] === undefined && value['oom_exits'] === undefined))
112
+ return false;
113
+ if ((!('reservationMb' in value) && !('reservation_mb' in value)) || (value['reservationMb'] === undefined && value['reservation_mb'] === undefined))
114
+ return false;
115
+ if ((!('wholeGpu' in value) && !('whole_gpu' in value)) || (value['wholeGpu'] === undefined && value['whole_gpu'] === undefined))
116
+ return false;
117
+ if ((!('predictedMb' in value) && !('predicted_mb' in value)) || (value['predictedMb'] === undefined && value['predicted_mb'] === undefined))
118
+ return false;
119
+ if ((!('predictionSource' in value) && !('prediction_source' in value)) || (value['predictionSource'] === undefined && value['prediction_source'] === undefined))
120
+ return false;
121
+ if ((!('predictedComputePct' in value) && !('predicted_compute_pct' in value)) || (value['predictedComputePct'] === undefined && value['predicted_compute_pct'] === undefined))
122
+ return false;
123
+ if ((!('computePredictionSource' in value) && !('compute_prediction_source' in value)) || (value['computePredictionSource'] === undefined && value['compute_prediction_source'] === undefined))
124
+ return false;
125
+ if ((!('peakMemoryMb' in value) && !('peak_memory_mb' in value)) || (value['peakMemoryMb'] === undefined && value['peak_memory_mb'] === undefined))
126
+ return false;
127
+ if ((!('gpuMemoryTotalMb' in value) && !('gpu_memory_total_mb' in value)) || (value['gpuMemoryTotalMb'] === undefined && value['gpu_memory_total_mb'] === undefined))
128
+ return false;
129
+ if ((!('utilMeanPct' in value) && !('util_mean_pct' in value)) || (value['utilMeanPct'] === undefined && value['util_mean_pct'] === undefined))
130
+ return false;
131
+ if ((!('busyPct' in value) && !('busy_pct' in value)) || (value['busyPct'] === undefined && value['busy_pct'] === undefined))
132
+ return false;
133
+ if ((!('memorySource' in value) && !('memory_source' in value)) || (value['memorySource'] === undefined && value['memory_source'] === undefined))
134
+ return false;
135
+ if ((!('sharingMode' in value) && !('sharing_mode' in value)) || (value['sharingMode'] === undefined && value['sharing_mode'] === undefined))
136
+ return false;
137
+ if ((!('gpuSeconds' in value) && !('gpu_seconds' in value)) || (value['gpuSeconds'] === undefined && value['gpu_seconds'] === undefined))
138
+ return false;
139
+ if ((!('attributedCostUsd' in value) && !('attributed_cost_usd' in value)) || (value['attributedCostUsd'] === undefined && value['attributed_cost_usd'] === undefined))
140
+ return false;
141
+ if ((!('exitCode' in value) && !('exit_code' in value)) || (value['exitCode'] === undefined && value['exit_code'] === undefined))
142
+ return false;
143
+ if ((!('createdAt' in value) && !('created_at' in value)) || (value['createdAt'] === undefined && value['created_at'] === undefined))
144
+ return false;
145
+ if ((!('startedAt' in value) && !('started_at' in value)) || (value['startedAt'] === undefined && value['started_at'] === undefined))
146
+ return false;
147
+ if ((!('finishedAt' in value) && !('finished_at' in value)) || (value['finishedAt'] === undefined && value['finished_at'] === undefined))
148
+ return false;
149
+ return true;
150
+ }
151
+ function JobFromJSON(json) {
152
+ return JobFromJSONTyped(json, false);
153
+ }
154
+ function JobFromJSONTyped(json, ignoreDiscriminator) {
155
+ if (json == null) {
156
+ return json;
157
+ }
158
+ return {
159
+ 'id': json['id'],
160
+ 'name': json['name'],
161
+ 'image': json['image'],
162
+ 'command': json['command'],
163
+ 'envNames': json['env_names'],
164
+ 'secrets': json['secrets'],
165
+ 'gpuType': json['gpu_type'],
166
+ 'minVramGb': json['min_vram_gb'],
167
+ 'memoryHintMb': json['memory_hint_mb'],
168
+ 'computeHintPct': json['compute_hint_pct'],
169
+ 'timeoutSeconds': json['timeout_seconds'],
170
+ 'maxWaitSeconds': json['max_wait_seconds'],
171
+ 'allowSharing': json['allow_sharing'],
172
+ 'allowRestart': json['allow_restart'],
173
+ 'isolation': json['isolation'],
174
+ 'migProfile': json['mig_profile'],
175
+ 'checkpointPath': json['checkpoint_path'],
176
+ 'maxRetries': json['max_retries'],
177
+ 'maxPricePerHour': json['max_price_per_hour'],
178
+ 'status': json['status'],
179
+ 'statusReason': json['status_reason'],
180
+ 'cancelRequested': json['cancel_requested'],
181
+ 'attempt': json['attempt'],
182
+ 'retries': json['retries'],
183
+ 'evictions': json['evictions'],
184
+ 'oomExits': json['oom_exits'],
185
+ 'reservationMb': json['reservation_mb'],
186
+ 'wholeGpu': json['whole_gpu'],
187
+ 'predictedMb': json['predicted_mb'],
188
+ 'predictionSource': json['prediction_source'],
189
+ 'predictedComputePct': json['predicted_compute_pct'],
190
+ 'computePredictionSource': json['compute_prediction_source'],
191
+ 'peakMemoryMb': json['peak_memory_mb'],
192
+ 'gpuMemoryTotalMb': json['gpu_memory_total_mb'],
193
+ 'utilMeanPct': json['util_mean_pct'],
194
+ 'busyPct': json['busy_pct'],
195
+ 'memorySource': json['memory_source'],
196
+ 'sharingMode': json['sharing_mode'],
197
+ 'gpuSeconds': json['gpu_seconds'],
198
+ 'attributedCostUsd': json['attributed_cost_usd'],
199
+ 'exitCode': json['exit_code'],
200
+ 'createdAt': (new Date(json['created_at'])),
201
+ 'startedAt': (json['started_at'] == null ? null : new Date(json['started_at'])),
202
+ 'finishedAt': (json['finished_at'] == null ? null : new Date(json['finished_at'])),
203
+ 'sharingHint': json['sharing_hint'] == null ? undefined : (0, JobSharingHint_1.JobSharingHintFromJSON)(json['sharing_hint']),
204
+ 'attempts': json['attempts'] == null ? undefined : (json['attempts'].map(JobAttempt_1.JobAttemptFromJSON)),
205
+ };
206
+ }
207
+ function JobToJSON(json) {
208
+ return JobToJSONTyped(json, false);
209
+ }
210
+ function JobToJSONTyped(value, ignoreDiscriminator = false) {
211
+ if (value == null) {
212
+ return value;
213
+ }
214
+ return {
215
+ 'id': value['id'],
216
+ 'name': value['name'],
217
+ 'image': value['image'],
218
+ 'command': value['command'],
219
+ 'env_names': value['envNames'],
220
+ 'secrets': value['secrets'],
221
+ 'gpu_type': value['gpuType'],
222
+ 'min_vram_gb': value['minVramGb'],
223
+ 'memory_hint_mb': value['memoryHintMb'],
224
+ 'compute_hint_pct': value['computeHintPct'],
225
+ 'timeout_seconds': value['timeoutSeconds'],
226
+ 'max_wait_seconds': value['maxWaitSeconds'],
227
+ 'allow_sharing': value['allowSharing'],
228
+ 'allow_restart': value['allowRestart'],
229
+ 'isolation': value['isolation'],
230
+ 'mig_profile': value['migProfile'],
231
+ 'checkpoint_path': value['checkpointPath'],
232
+ 'max_retries': value['maxRetries'],
233
+ 'max_price_per_hour': value['maxPricePerHour'],
234
+ 'status': value['status'],
235
+ 'status_reason': value['statusReason'],
236
+ 'cancel_requested': value['cancelRequested'],
237
+ 'attempt': value['attempt'],
238
+ 'retries': value['retries'],
239
+ 'evictions': value['evictions'],
240
+ 'oom_exits': value['oomExits'],
241
+ 'reservation_mb': value['reservationMb'],
242
+ 'whole_gpu': value['wholeGpu'],
243
+ 'predicted_mb': value['predictedMb'],
244
+ 'prediction_source': value['predictionSource'],
245
+ 'predicted_compute_pct': value['predictedComputePct'],
246
+ 'compute_prediction_source': value['computePredictionSource'],
247
+ 'peak_memory_mb': value['peakMemoryMb'],
248
+ 'gpu_memory_total_mb': value['gpuMemoryTotalMb'],
249
+ 'util_mean_pct': value['utilMeanPct'],
250
+ 'busy_pct': value['busyPct'],
251
+ 'memory_source': value['memorySource'],
252
+ 'sharing_mode': value['sharingMode'],
253
+ 'gpu_seconds': value['gpuSeconds'],
254
+ 'attributed_cost_usd': value['attributedCostUsd'],
255
+ 'exit_code': value['exitCode'],
256
+ 'created_at': value['createdAt'].toISOString(),
257
+ 'started_at': value['startedAt'] == null ? value['startedAt'] : value['startedAt'].toISOString(),
258
+ 'finished_at': value['finishedAt'] == null ? value['finishedAt'] : value['finishedAt'].toISOString(),
259
+ 'sharing_hint': (0, JobSharingHint_1.JobSharingHintToJSON)(value['sharingHint']),
260
+ 'attempts': value['attempts'] == null ? undefined : (value['attempts'].map(JobAttempt_1.JobAttemptToJSON)),
261
+ };
262
+ }