@gpuai/sdk 0.5.3 → 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 (218) hide show
  1. package/.openapi-generator/FILES +56 -0
  2. package/README.md +50 -2
  3. package/dist/apis/BillingApi.d.ts +2 -2
  4. package/dist/apis/BillingApi.js +2 -2
  5. package/dist/apis/EndpointsApi.d.ts +150 -0
  6. package/dist/apis/EndpointsApi.js +379 -0
  7. package/dist/apis/InstancesApi.d.ts +15 -0
  8. package/dist/apis/InstancesApi.js +45 -0
  9. package/dist/apis/JobsApi.d.ts +172 -0
  10. package/dist/apis/JobsApi.js +444 -0
  11. package/dist/apis/OperationsApi.d.ts +17 -0
  12. package/dist/apis/OperationsApi.js +48 -0
  13. package/dist/apis/SecretsApi.d.ts +123 -0
  14. package/dist/apis/SecretsApi.js +328 -0
  15. package/dist/apis/index.d.ts +3 -0
  16. package/dist/apis/index.js +3 -0
  17. package/dist/esm/apis/BillingApi.d.ts +2 -2
  18. package/dist/esm/apis/BillingApi.js +2 -2
  19. package/dist/esm/apis/EndpointsApi.d.ts +150 -0
  20. package/dist/esm/apis/EndpointsApi.js +375 -0
  21. package/dist/esm/apis/InstancesApi.d.ts +15 -0
  22. package/dist/esm/apis/InstancesApi.js +45 -0
  23. package/dist/esm/apis/JobsApi.d.ts +172 -0
  24. package/dist/esm/apis/JobsApi.js +440 -0
  25. package/dist/esm/apis/OperationsApi.d.ts +17 -0
  26. package/dist/esm/apis/OperationsApi.js +48 -0
  27. package/dist/esm/apis/SecretsApi.d.ts +123 -0
  28. package/dist/esm/apis/SecretsApi.js +324 -0
  29. package/dist/esm/apis/index.d.ts +3 -0
  30. package/dist/esm/apis/index.js +3 -0
  31. package/dist/esm/models/Balance.d.ts +6 -0
  32. package/dist/esm/models/Balance.js +2 -0
  33. package/dist/esm/models/CreateWebhookEndpointRequest.d.ts +3 -0
  34. package/dist/esm/models/CreateWebhookEndpointRequest.js +4 -1
  35. package/dist/esm/models/DedicatedIPOffer.d.ts +98 -0
  36. package/dist/esm/models/DedicatedIPOffer.js +87 -0
  37. package/dist/esm/models/Endpoint.d.ts +147 -0
  38. package/dist/esm/models/Endpoint.js +121 -0
  39. package/dist/esm/models/EndpointCreate.d.ts +80 -0
  40. package/dist/esm/models/EndpointCreate.js +63 -0
  41. package/dist/esm/models/EndpointList.d.ts +33 -0
  42. package/dist/esm/models/EndpointList.js +44 -0
  43. package/dist/esm/models/EndpointMachine.d.ts +90 -0
  44. package/dist/esm/models/EndpointMachine.js +84 -0
  45. package/dist/esm/models/EndpointReplicaCounts.d.ts +38 -0
  46. package/dist/esm/models/EndpointReplicaCounts.js +47 -0
  47. package/dist/esm/models/Job.d.ts +352 -0
  48. package/dist/esm/models/Job.js +254 -0
  49. package/dist/esm/models/JobAttempt.d.ts +176 -0
  50. package/dist/esm/models/JobAttempt.js +147 -0
  51. package/dist/esm/models/JobCreate.d.ts +153 -0
  52. package/dist/esm/models/JobCreate.js +84 -0
  53. package/dist/esm/models/JobGpuTypes.d.ts +39 -0
  54. package/dist/esm/models/JobGpuTypes.js +48 -0
  55. package/dist/esm/models/JobGpuTypesDataInner.d.ts +58 -0
  56. package/dist/esm/models/JobGpuTypesDataInner.js +59 -0
  57. package/dist/esm/models/JobLogChunk.d.ts +50 -0
  58. package/dist/esm/models/JobLogChunk.js +55 -0
  59. package/dist/esm/models/JobLogs.d.ts +39 -0
  60. package/dist/esm/models/JobLogs.js +48 -0
  61. package/dist/esm/models/JobPage.d.ts +39 -0
  62. package/dist/esm/models/JobPage.js +48 -0
  63. package/dist/esm/models/JobSharingHint.d.ts +46 -0
  64. package/dist/esm/models/JobSharingHint.js +51 -0
  65. package/dist/esm/models/JobTelemetry.d.ts +51 -0
  66. package/dist/esm/models/JobTelemetry.js +56 -0
  67. package/dist/esm/models/JobTelemetryPoint.d.ts +56 -0
  68. package/dist/esm/models/JobTelemetryPoint.js +59 -0
  69. package/dist/esm/models/JobTrial.d.ts +79 -0
  70. package/dist/esm/models/JobTrial.js +73 -0
  71. package/dist/esm/models/Secret.d.ts +62 -0
  72. package/dist/esm/models/Secret.js +63 -0
  73. package/dist/esm/models/SecretCreate.d.ts +44 -0
  74. package/dist/esm/models/SecretCreate.js +49 -0
  75. package/dist/esm/models/SecretImportItem.d.ts +38 -0
  76. package/dist/esm/models/SecretImportItem.js +47 -0
  77. package/dist/esm/models/SecretImportRequest.d.ts +39 -0
  78. package/dist/esm/models/SecretImportRequest.js +46 -0
  79. package/dist/esm/models/SecretImportResult.d.ts +44 -0
  80. package/dist/esm/models/SecretImportResult.js +51 -0
  81. package/dist/esm/models/SecretList.d.ts +33 -0
  82. package/dist/esm/models/SecretList.js +44 -0
  83. package/dist/esm/models/SecretPut.d.ts +38 -0
  84. package/dist/esm/models/SecretPut.js +45 -0
  85. package/dist/esm/models/WebhookEndpoint.d.ts +3 -0
  86. package/dist/esm/models/WebhookEndpoint.js +4 -1
  87. package/dist/esm/models/index.d.ts +25 -0
  88. package/dist/esm/models/index.js +25 -0
  89. package/dist/esm/runtime.js +1 -1
  90. package/dist/models/Balance.d.ts +6 -0
  91. package/dist/models/Balance.js +2 -0
  92. package/dist/models/CreateWebhookEndpointRequest.d.ts +3 -0
  93. package/dist/models/CreateWebhookEndpointRequest.js +4 -1
  94. package/dist/models/DedicatedIPOffer.d.ts +98 -0
  95. package/dist/models/DedicatedIPOffer.js +94 -0
  96. package/dist/models/Endpoint.d.ts +147 -0
  97. package/dist/models/Endpoint.js +129 -0
  98. package/dist/models/EndpointCreate.d.ts +80 -0
  99. package/dist/models/EndpointCreate.js +70 -0
  100. package/dist/models/EndpointList.d.ts +33 -0
  101. package/dist/models/EndpointList.js +51 -0
  102. package/dist/models/EndpointMachine.d.ts +90 -0
  103. package/dist/models/EndpointMachine.js +92 -0
  104. package/dist/models/EndpointReplicaCounts.d.ts +38 -0
  105. package/dist/models/EndpointReplicaCounts.js +54 -0
  106. package/dist/models/Job.d.ts +352 -0
  107. package/dist/models/Job.js +262 -0
  108. package/dist/models/JobAttempt.d.ts +176 -0
  109. package/dist/models/JobAttempt.js +155 -0
  110. package/dist/models/JobCreate.d.ts +153 -0
  111. package/dist/models/JobCreate.js +92 -0
  112. package/dist/models/JobGpuTypes.d.ts +39 -0
  113. package/dist/models/JobGpuTypes.js +55 -0
  114. package/dist/models/JobGpuTypesDataInner.d.ts +58 -0
  115. package/dist/models/JobGpuTypesDataInner.js +66 -0
  116. package/dist/models/JobLogChunk.d.ts +50 -0
  117. package/dist/models/JobLogChunk.js +62 -0
  118. package/dist/models/JobLogs.d.ts +39 -0
  119. package/dist/models/JobLogs.js +55 -0
  120. package/dist/models/JobPage.d.ts +39 -0
  121. package/dist/models/JobPage.js +55 -0
  122. package/dist/models/JobSharingHint.d.ts +46 -0
  123. package/dist/models/JobSharingHint.js +58 -0
  124. package/dist/models/JobTelemetry.d.ts +51 -0
  125. package/dist/models/JobTelemetry.js +63 -0
  126. package/dist/models/JobTelemetryPoint.d.ts +56 -0
  127. package/dist/models/JobTelemetryPoint.js +66 -0
  128. package/dist/models/JobTrial.d.ts +79 -0
  129. package/dist/models/JobTrial.js +81 -0
  130. package/dist/models/Secret.d.ts +62 -0
  131. package/dist/models/Secret.js +70 -0
  132. package/dist/models/SecretCreate.d.ts +44 -0
  133. package/dist/models/SecretCreate.js +56 -0
  134. package/dist/models/SecretImportItem.d.ts +38 -0
  135. package/dist/models/SecretImportItem.js +54 -0
  136. package/dist/models/SecretImportRequest.d.ts +39 -0
  137. package/dist/models/SecretImportRequest.js +53 -0
  138. package/dist/models/SecretImportResult.d.ts +44 -0
  139. package/dist/models/SecretImportResult.js +58 -0
  140. package/dist/models/SecretList.d.ts +33 -0
  141. package/dist/models/SecretList.js +51 -0
  142. package/dist/models/SecretPut.d.ts +38 -0
  143. package/dist/models/SecretPut.js +52 -0
  144. package/dist/models/WebhookEndpoint.d.ts +3 -0
  145. package/dist/models/WebhookEndpoint.js +4 -1
  146. package/dist/models/index.d.ts +25 -0
  147. package/dist/models/index.js +25 -0
  148. package/dist/runtime.js +1 -1
  149. package/docs/Balance.md +2 -0
  150. package/docs/BillingApi.md +2 -2
  151. package/docs/DedicatedIPOffer.md +56 -0
  152. package/docs/Endpoint.md +68 -0
  153. package/docs/EndpointCreate.md +50 -0
  154. package/docs/EndpointList.md +34 -0
  155. package/docs/EndpointMachine.md +50 -0
  156. package/docs/EndpointReplicaCounts.md +36 -0
  157. package/docs/EndpointsApi.md +544 -0
  158. package/docs/InstancesApi.md +68 -1
  159. package/docs/Job.md +125 -0
  160. package/docs/JobAttempt.md +69 -0
  161. package/docs/JobCreate.md +66 -0
  162. package/docs/JobGpuTypes.md +36 -0
  163. package/docs/JobGpuTypesDataInner.md +42 -0
  164. package/docs/JobLogChunk.md +40 -0
  165. package/docs/JobLogs.md +36 -0
  166. package/docs/JobPage.md +36 -0
  167. package/docs/JobSharingHint.md +39 -0
  168. package/docs/JobTelemetry.md +40 -0
  169. package/docs/JobTelemetryPoint.md +42 -0
  170. package/docs/JobTrial.md +46 -0
  171. package/docs/JobsApi.md +609 -0
  172. package/docs/OperationsApi.md +76 -0
  173. package/docs/Secret.md +45 -0
  174. package/docs/SecretCreate.md +38 -0
  175. package/docs/SecretImportItem.md +36 -0
  176. package/docs/SecretImportRequest.md +36 -0
  177. package/docs/SecretImportResult.md +38 -0
  178. package/docs/SecretList.md +34 -0
  179. package/docs/SecretPut.md +36 -0
  180. package/docs/SecretsApi.md +450 -0
  181. package/package.json +1 -1
  182. package/src/apis/BillingApi.ts +2 -2
  183. package/src/apis/EndpointsApi.ts +481 -0
  184. package/src/apis/InstancesApi.ts +52 -0
  185. package/src/apis/JobsApi.ts +551 -0
  186. package/src/apis/OperationsApi.ts +59 -0
  187. package/src/apis/SecretsApi.ts +413 -0
  188. package/src/apis/index.ts +3 -0
  189. package/src/models/Balance.ts +8 -0
  190. package/src/models/CreateWebhookEndpointRequest.ts +4 -1
  191. package/src/models/DedicatedIPOffer.ts +165 -0
  192. package/src/models/Endpoint.ts +247 -0
  193. package/src/models/EndpointCreate.ts +132 -0
  194. package/src/models/EndpointList.ts +74 -0
  195. package/src/models/EndpointMachine.ts +151 -0
  196. package/src/models/EndpointReplicaCounts.ts +75 -0
  197. package/src/models/Job.ts +538 -0
  198. package/src/models/JobAttempt.ts +267 -0
  199. package/src/models/JobCreate.ts +221 -0
  200. package/src/models/JobGpuTypes.ts +83 -0
  201. package/src/models/JobGpuTypesDataInner.ts +104 -0
  202. package/src/models/JobLogChunk.ts +93 -0
  203. package/src/models/JobLogs.ts +83 -0
  204. package/src/models/JobPage.ts +83 -0
  205. package/src/models/JobSharingHint.ts +86 -0
  206. package/src/models/JobTelemetry.ts +101 -0
  207. package/src/models/JobTelemetryPoint.ts +102 -0
  208. package/src/models/JobTrial.ts +132 -0
  209. package/src/models/Secret.ts +111 -0
  210. package/src/models/SecretCreate.ts +83 -0
  211. package/src/models/SecretImportItem.ts +75 -0
  212. package/src/models/SecretImportRequest.ts +82 -0
  213. package/src/models/SecretImportResult.ts +84 -0
  214. package/src/models/SecretList.ts +74 -0
  215. package/src/models/SecretPut.ts +74 -0
  216. package/src/models/WebhookEndpoint.ts +4 -1
  217. package/src/models/index.ts +25 -0
  218. package/src/runtime.ts +1 -1
@@ -0,0 +1,538 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+ /**
4
+ * GPU.ai Public Developer API
5
+ * Programmatic API for GPU.ai. Authenticate with API keys minted from the dashboard. See https://gpu.ai/docs for details.
6
+ *
7
+ * The version of the OpenAPI document: 1.0.0
8
+ * Contact: support@gpu.ai
9
+ *
10
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
11
+ * https://openapi-generator.tech
12
+ * Do not edit the class manually.
13
+ */
14
+
15
+ import { mapValues } from '../runtime';
16
+ import type { JobAttempt } from './JobAttempt';
17
+ import {
18
+ JobAttemptFromJSON,
19
+ JobAttemptFromJSONTyped,
20
+ JobAttemptToJSON,
21
+ JobAttemptToJSONTyped,
22
+ } from './JobAttempt';
23
+ import type { JobSharingHint } from './JobSharingHint';
24
+ import {
25
+ JobSharingHintFromJSON,
26
+ JobSharingHintFromJSONTyped,
27
+ JobSharingHintToJSON,
28
+ JobSharingHintToJSONTyped,
29
+ } from './JobSharingHint';
30
+
31
+ /**
32
+ * A batch job. It names no machine: the machines a job runs on are instances of your organization and appear in the instance list.
33
+ *
34
+ * @export
35
+ * @interface Job
36
+ */
37
+ export interface Job {
38
+ /**
39
+ *
40
+ * @type {string}
41
+ * @memberof Job
42
+ */
43
+ id: string;
44
+ /**
45
+ *
46
+ * @type {string}
47
+ * @memberof Job
48
+ */
49
+ name: string;
50
+ /**
51
+ *
52
+ * @type {string}
53
+ * @memberof Job
54
+ */
55
+ image: string;
56
+ /**
57
+ *
58
+ * @type {Array<string>}
59
+ * @memberof Job
60
+ */
61
+ command: Array<string>;
62
+ /**
63
+ * The names of the job's environment variables. Values are never returned.
64
+ * @type {Array<string>}
65
+ * @memberof Job
66
+ */
67
+ envNames: Array<string>;
68
+ /**
69
+ * Names of the organization secrets the job receives. Empty when none.
70
+ * @type {Array<string>}
71
+ * @memberof Job
72
+ */
73
+ secrets: Array<string>;
74
+ /**
75
+ * The requested GPU model, or an empty string when the job asked for `min_vram_gb` only.
76
+ * @type {string}
77
+ * @memberof Job
78
+ */
79
+ gpuType: string;
80
+ /**
81
+ *
82
+ * @type {number}
83
+ * @memberof Job
84
+ */
85
+ minVramGb: number;
86
+ /**
87
+ *
88
+ * @type {number}
89
+ * @memberof Job
90
+ */
91
+ memoryHintMb: number | null;
92
+ /**
93
+ *
94
+ * @type {number}
95
+ * @memberof Job
96
+ */
97
+ computeHintPct: number | null;
98
+ /**
99
+ *
100
+ * @type {number}
101
+ * @memberof Job
102
+ */
103
+ timeoutSeconds: number;
104
+ /**
105
+ *
106
+ * @type {number}
107
+ * @memberof Job
108
+ */
109
+ maxWaitSeconds: number;
110
+ /**
111
+ *
112
+ * @type {boolean}
113
+ * @memberof Job
114
+ */
115
+ allowSharing: boolean;
116
+ /**
117
+ *
118
+ * @type {boolean}
119
+ * @memberof Job
120
+ */
121
+ allowRestart: boolean;
122
+ /**
123
+ *
124
+ * @type {JobIsolationEnum}
125
+ * @memberof Job
126
+ */
127
+ isolation: JobIsolationEnum;
128
+ /**
129
+ * 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.
130
+ *
131
+ * @type {string}
132
+ * @memberof Job
133
+ */
134
+ migProfile: string | null;
135
+ /**
136
+ *
137
+ * @type {string}
138
+ * @memberof Job
139
+ */
140
+ checkpointPath: string | null;
141
+ /**
142
+ *
143
+ * @type {number}
144
+ * @memberof Job
145
+ */
146
+ maxRetries: number;
147
+ /**
148
+ *
149
+ * @type {number}
150
+ * @memberof Job
151
+ */
152
+ maxPricePerHour: number | null;
153
+ /**
154
+ * `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`.
155
+ *
156
+ * @type {JobStatusEnum}
157
+ * @memberof Job
158
+ */
159
+ status: JobStatusEnum;
160
+ /**
161
+ * Why the job is waiting, or why it failed or was retried.
162
+ * @type {string}
163
+ * @memberof Job
164
+ */
165
+ statusReason: string | null;
166
+ /**
167
+ * True once a cancel has been asked for and until the job stops.
168
+ * @type {boolean}
169
+ * @memberof Job
170
+ */
171
+ cancelRequested: boolean;
172
+ /**
173
+ * The number of the current or last attempt. 0 before the job is first placed.
174
+ * @type {number}
175
+ * @memberof Job
176
+ */
177
+ attempt: number;
178
+ /**
179
+ * Reruns after a memory failure, counted against `max_retries`.
180
+ * @type {number}
181
+ * @memberof Job
182
+ */
183
+ retries: number;
184
+ /**
185
+ * Times the job was stopped for outgrowing its reservation on a full GPU.
186
+ * @type {number}
187
+ * @memberof Job
188
+ */
189
+ evictions: number;
190
+ /**
191
+ * Times the job exited out of GPU memory.
192
+ * @type {number}
193
+ * @memberof Job
194
+ */
195
+ oomExits: number;
196
+ /**
197
+ * 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.
198
+ *
199
+ * @type {number}
200
+ * @memberof Job
201
+ */
202
+ reservationMb: number | null;
203
+ /**
204
+ * Whether the current or last attempt has a GPU to itself. Null before the job is first placed.
205
+ * @type {boolean}
206
+ * @memberof Job
207
+ */
208
+ wholeGpu: boolean | null;
209
+ /**
210
+ * The estimate behind the reservation, from the hint or from history, with headroom.
211
+ * @type {number}
212
+ * @memberof Job
213
+ */
214
+ predictedMb: number | null;
215
+ /**
216
+ * 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.
217
+ *
218
+ * @type {string}
219
+ * @memberof Job
220
+ */
221
+ predictionSource: string | null;
222
+ /**
223
+ * The compute duty the current or last attempt was charged on its GPU, 1 to 100. 100 when the job's compute is unknown.
224
+ *
225
+ * @type {number}
226
+ * @memberof Job
227
+ */
228
+ predictedComputePct: number | null;
229
+ /**
230
+ * Where the compute duty came from: `hint`, `history:org+name`, `history:org+image`, `history:image` or `none` (unknown, counted as 100).
231
+ *
232
+ * @type {string}
233
+ * @memberof Job
234
+ */
235
+ computePredictionSource: string | null;
236
+ /**
237
+ * The job's highest GPU memory use so far, across attempts, in MiB.
238
+ * @type {number}
239
+ * @memberof Job
240
+ */
241
+ peakMemoryMb: number | null;
242
+ /**
243
+ * Total memory of the GPU the current or last attempt runs on, in MiB.
244
+ * @type {number}
245
+ * @memberof Job
246
+ */
247
+ gpuMemoryTotalMb: number | null;
248
+ /**
249
+ * Mean GPU utilization measured during the last finished attempt. See `compute_source` on the attempt for how it was attributed.
250
+ *
251
+ * @type {number}
252
+ * @memberof Job
253
+ */
254
+ utilMeanPct: number | null;
255
+ /**
256
+ * 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.
257
+ *
258
+ * @type {number}
259
+ * @memberof Job
260
+ */
261
+ busyPct: number | null;
262
+ /**
263
+ * 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.
264
+ *
265
+ * @type {JobMemorySourceEnum}
266
+ * @memberof Job
267
+ */
268
+ memorySource: JobMemorySourceEnum | null;
269
+ /**
270
+ * How the GPU was shared during the last attempt. `mig` is a GPU slice of the job's own.
271
+ * @type {JobSharingModeEnum}
272
+ * @memberof Job
273
+ */
274
+ sharingMode: JobSharingModeEnum | null;
275
+ /**
276
+ * Seconds the job has spent running on a GPU, across attempts.
277
+ * @type {number}
278
+ * @memberof Job
279
+ */
280
+ gpuSeconds: number;
281
+ /**
282
+ * 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.
283
+ *
284
+ * @type {number}
285
+ * @memberof Job
286
+ */
287
+ attributedCostUsd: number;
288
+ /**
289
+ *
290
+ * @type {number}
291
+ * @memberof Job
292
+ */
293
+ exitCode: number | null;
294
+ /**
295
+ *
296
+ * @type {Date}
297
+ * @memberof Job
298
+ */
299
+ createdAt: Date;
300
+ /**
301
+ * When the current or last attempt started.
302
+ * @type {Date}
303
+ * @memberof Job
304
+ */
305
+ startedAt: Date | null;
306
+ /**
307
+ *
308
+ * @type {Date}
309
+ * @memberof Job
310
+ */
311
+ finishedAt: Date | null;
312
+ /**
313
+ *
314
+ * @type {JobSharingHint}
315
+ * @memberof Job
316
+ */
317
+ sharingHint?: JobSharingHint;
318
+ /**
319
+ * The job's attempts, oldest first. Returned by GET /v1/jobs/{id} only.
320
+ * @type {Array<JobAttempt>}
321
+ * @memberof Job
322
+ */
323
+ attempts?: Array<JobAttempt>;
324
+ }
325
+
326
+
327
+ /**
328
+ * @export
329
+ */
330
+ export const JobIsolationEnum = {
331
+ Soft: 'soft',
332
+ Hard: 'hard'
333
+ } as const;
334
+ export type JobIsolationEnum = typeof JobIsolationEnum[keyof typeof JobIsolationEnum];
335
+
336
+ /**
337
+ * @export
338
+ */
339
+ export const JobStatusEnum = {
340
+ Queued: 'queued',
341
+ Assigned: 'assigned',
342
+ Running: 'running',
343
+ Succeeded: 'succeeded',
344
+ Failed: 'failed',
345
+ Cancelled: 'cancelled'
346
+ } as const;
347
+ export type JobStatusEnum = typeof JobStatusEnum[keyof typeof JobStatusEnum];
348
+
349
+ /**
350
+ * @export
351
+ */
352
+ export const JobMemorySourceEnum = {
353
+ Process: 'process',
354
+ Limit: 'limit'
355
+ } as const;
356
+ export type JobMemorySourceEnum = typeof JobMemorySourceEnum[keyof typeof JobMemorySourceEnum];
357
+
358
+ /**
359
+ * @export
360
+ */
361
+ export const JobSharingModeEnum = {
362
+ TimeSlicing: 'time_slicing',
363
+ Mps: 'mps',
364
+ Mig: 'mig'
365
+ } as const;
366
+ export type JobSharingModeEnum = typeof JobSharingModeEnum[keyof typeof JobSharingModeEnum];
367
+
368
+
369
+ /**
370
+ * Check if a given object implements the Job interface.
371
+ */
372
+ export function instanceOfJob(value: object): value is Job {
373
+ if (!('id' in value) || value['id'] === undefined) return false;
374
+ if (!('name' in value) || value['name'] === undefined) return false;
375
+ if (!('image' in value) || value['image'] === undefined) return false;
376
+ if (!('command' in value) || value['command'] === undefined) return false;
377
+ if ((!('envNames' in (value as Record<string, any>)) && !('env_names' in (value as Record<string, any>))) || ((value as Record<string, any>)['envNames'] === undefined && (value as Record<string, any>)['env_names'] === undefined)) return false;
378
+ if (!('secrets' in value) || value['secrets'] === undefined) return false;
379
+ if ((!('gpuType' in (value as Record<string, any>)) && !('gpu_type' in (value as Record<string, any>))) || ((value as Record<string, any>)['gpuType'] === undefined && (value as Record<string, any>)['gpu_type'] === undefined)) return false;
380
+ if ((!('minVramGb' in (value as Record<string, any>)) && !('min_vram_gb' in (value as Record<string, any>))) || ((value as Record<string, any>)['minVramGb'] === undefined && (value as Record<string, any>)['min_vram_gb'] === undefined)) return false;
381
+ if ((!('memoryHintMb' in (value as Record<string, any>)) && !('memory_hint_mb' in (value as Record<string, any>))) || ((value as Record<string, any>)['memoryHintMb'] === undefined && (value as Record<string, any>)['memory_hint_mb'] === undefined)) return false;
382
+ if ((!('computeHintPct' in (value as Record<string, any>)) && !('compute_hint_pct' in (value as Record<string, any>))) || ((value as Record<string, any>)['computeHintPct'] === undefined && (value as Record<string, any>)['compute_hint_pct'] === undefined)) return false;
383
+ if ((!('timeoutSeconds' in (value as Record<string, any>)) && !('timeout_seconds' in (value as Record<string, any>))) || ((value as Record<string, any>)['timeoutSeconds'] === undefined && (value as Record<string, any>)['timeout_seconds'] === undefined)) return false;
384
+ if ((!('maxWaitSeconds' in (value as Record<string, any>)) && !('max_wait_seconds' in (value as Record<string, any>))) || ((value as Record<string, any>)['maxWaitSeconds'] === undefined && (value as Record<string, any>)['max_wait_seconds'] === undefined)) return false;
385
+ if ((!('allowSharing' in (value as Record<string, any>)) && !('allow_sharing' in (value as Record<string, any>))) || ((value as Record<string, any>)['allowSharing'] === undefined && (value as Record<string, any>)['allow_sharing'] === undefined)) return false;
386
+ if ((!('allowRestart' in (value as Record<string, any>)) && !('allow_restart' in (value as Record<string, any>))) || ((value as Record<string, any>)['allowRestart'] === undefined && (value as Record<string, any>)['allow_restart'] === undefined)) return false;
387
+ if (!('isolation' in value) || value['isolation'] === undefined) return false;
388
+ if ((!('migProfile' in (value as Record<string, any>)) && !('mig_profile' in (value as Record<string, any>))) || ((value as Record<string, any>)['migProfile'] === undefined && (value as Record<string, any>)['mig_profile'] === undefined)) return false;
389
+ if ((!('checkpointPath' in (value as Record<string, any>)) && !('checkpoint_path' in (value as Record<string, any>))) || ((value as Record<string, any>)['checkpointPath'] === undefined && (value as Record<string, any>)['checkpoint_path'] === undefined)) return false;
390
+ if ((!('maxRetries' in (value as Record<string, any>)) && !('max_retries' in (value as Record<string, any>))) || ((value as Record<string, any>)['maxRetries'] === undefined && (value as Record<string, any>)['max_retries'] === undefined)) return false;
391
+ if ((!('maxPricePerHour' in (value as Record<string, any>)) && !('max_price_per_hour' in (value as Record<string, any>))) || ((value as Record<string, any>)['maxPricePerHour'] === undefined && (value as Record<string, any>)['max_price_per_hour'] === undefined)) return false;
392
+ if (!('status' in value) || value['status'] === undefined) return false;
393
+ if ((!('statusReason' in (value as Record<string, any>)) && !('status_reason' in (value as Record<string, any>))) || ((value as Record<string, any>)['statusReason'] === undefined && (value as Record<string, any>)['status_reason'] === undefined)) return false;
394
+ if ((!('cancelRequested' in (value as Record<string, any>)) && !('cancel_requested' in (value as Record<string, any>))) || ((value as Record<string, any>)['cancelRequested'] === undefined && (value as Record<string, any>)['cancel_requested'] === undefined)) return false;
395
+ if (!('attempt' in value) || value['attempt'] === undefined) return false;
396
+ if (!('retries' in value) || value['retries'] === undefined) return false;
397
+ if (!('evictions' in value) || value['evictions'] === undefined) return false;
398
+ if ((!('oomExits' in (value as Record<string, any>)) && !('oom_exits' in (value as Record<string, any>))) || ((value as Record<string, any>)['oomExits'] === undefined && (value as Record<string, any>)['oom_exits'] === undefined)) return false;
399
+ if ((!('reservationMb' in (value as Record<string, any>)) && !('reservation_mb' in (value as Record<string, any>))) || ((value as Record<string, any>)['reservationMb'] === undefined && (value as Record<string, any>)['reservation_mb'] === undefined)) return false;
400
+ if ((!('wholeGpu' in (value as Record<string, any>)) && !('whole_gpu' in (value as Record<string, any>))) || ((value as Record<string, any>)['wholeGpu'] === undefined && (value as Record<string, any>)['whole_gpu'] === undefined)) return false;
401
+ if ((!('predictedMb' in (value as Record<string, any>)) && !('predicted_mb' in (value as Record<string, any>))) || ((value as Record<string, any>)['predictedMb'] === undefined && (value as Record<string, any>)['predicted_mb'] === undefined)) return false;
402
+ if ((!('predictionSource' in (value as Record<string, any>)) && !('prediction_source' in (value as Record<string, any>))) || ((value as Record<string, any>)['predictionSource'] === undefined && (value as Record<string, any>)['prediction_source'] === undefined)) return false;
403
+ if ((!('predictedComputePct' in (value as Record<string, any>)) && !('predicted_compute_pct' in (value as Record<string, any>))) || ((value as Record<string, any>)['predictedComputePct'] === undefined && (value as Record<string, any>)['predicted_compute_pct'] === undefined)) return false;
404
+ if ((!('computePredictionSource' in (value as Record<string, any>)) && !('compute_prediction_source' in (value as Record<string, any>))) || ((value as Record<string, any>)['computePredictionSource'] === undefined && (value as Record<string, any>)['compute_prediction_source'] === undefined)) return false;
405
+ if ((!('peakMemoryMb' in (value as Record<string, any>)) && !('peak_memory_mb' in (value as Record<string, any>))) || ((value as Record<string, any>)['peakMemoryMb'] === undefined && (value as Record<string, any>)['peak_memory_mb'] === undefined)) return false;
406
+ if ((!('gpuMemoryTotalMb' in (value as Record<string, any>)) && !('gpu_memory_total_mb' in (value as Record<string, any>))) || ((value as Record<string, any>)['gpuMemoryTotalMb'] === undefined && (value as Record<string, any>)['gpu_memory_total_mb'] === undefined)) return false;
407
+ if ((!('utilMeanPct' in (value as Record<string, any>)) && !('util_mean_pct' in (value as Record<string, any>))) || ((value as Record<string, any>)['utilMeanPct'] === undefined && (value as Record<string, any>)['util_mean_pct'] === undefined)) return false;
408
+ if ((!('busyPct' in (value as Record<string, any>)) && !('busy_pct' in (value as Record<string, any>))) || ((value as Record<string, any>)['busyPct'] === undefined && (value as Record<string, any>)['busy_pct'] === undefined)) return false;
409
+ if ((!('memorySource' in (value as Record<string, any>)) && !('memory_source' in (value as Record<string, any>))) || ((value as Record<string, any>)['memorySource'] === undefined && (value as Record<string, any>)['memory_source'] === undefined)) return false;
410
+ if ((!('sharingMode' in (value as Record<string, any>)) && !('sharing_mode' in (value as Record<string, any>))) || ((value as Record<string, any>)['sharingMode'] === undefined && (value as Record<string, any>)['sharing_mode'] === undefined)) return false;
411
+ if ((!('gpuSeconds' in (value as Record<string, any>)) && !('gpu_seconds' in (value as Record<string, any>))) || ((value as Record<string, any>)['gpuSeconds'] === undefined && (value as Record<string, any>)['gpu_seconds'] === undefined)) return false;
412
+ if ((!('attributedCostUsd' in (value as Record<string, any>)) && !('attributed_cost_usd' in (value as Record<string, any>))) || ((value as Record<string, any>)['attributedCostUsd'] === undefined && (value as Record<string, any>)['attributed_cost_usd'] === undefined)) return false;
413
+ if ((!('exitCode' in (value as Record<string, any>)) && !('exit_code' in (value as Record<string, any>))) || ((value as Record<string, any>)['exitCode'] === undefined && (value as Record<string, any>)['exit_code'] === undefined)) return false;
414
+ if ((!('createdAt' in (value as Record<string, any>)) && !('created_at' in (value as Record<string, any>))) || ((value as Record<string, any>)['createdAt'] === undefined && (value as Record<string, any>)['created_at'] === undefined)) return false;
415
+ if ((!('startedAt' in (value as Record<string, any>)) && !('started_at' in (value as Record<string, any>))) || ((value as Record<string, any>)['startedAt'] === undefined && (value as Record<string, any>)['started_at'] === undefined)) return false;
416
+ if ((!('finishedAt' in (value as Record<string, any>)) && !('finished_at' in (value as Record<string, any>))) || ((value as Record<string, any>)['finishedAt'] === undefined && (value as Record<string, any>)['finished_at'] === undefined)) return false;
417
+ return true;
418
+ }
419
+
420
+ export function JobFromJSON(json: any): Job {
421
+ return JobFromJSONTyped(json, false);
422
+ }
423
+
424
+ export function JobFromJSONTyped(json: any, ignoreDiscriminator: boolean): Job {
425
+ if (json == null) {
426
+ return json;
427
+ }
428
+ return {
429
+
430
+ 'id': json['id'],
431
+ 'name': json['name'],
432
+ 'image': json['image'],
433
+ 'command': json['command'],
434
+ 'envNames': json['env_names'],
435
+ 'secrets': json['secrets'],
436
+ 'gpuType': json['gpu_type'],
437
+ 'minVramGb': json['min_vram_gb'],
438
+ 'memoryHintMb': json['memory_hint_mb'],
439
+ 'computeHintPct': json['compute_hint_pct'],
440
+ 'timeoutSeconds': json['timeout_seconds'],
441
+ 'maxWaitSeconds': json['max_wait_seconds'],
442
+ 'allowSharing': json['allow_sharing'],
443
+ 'allowRestart': json['allow_restart'],
444
+ 'isolation': json['isolation'],
445
+ 'migProfile': json['mig_profile'],
446
+ 'checkpointPath': json['checkpoint_path'],
447
+ 'maxRetries': json['max_retries'],
448
+ 'maxPricePerHour': json['max_price_per_hour'],
449
+ 'status': json['status'],
450
+ 'statusReason': json['status_reason'],
451
+ 'cancelRequested': json['cancel_requested'],
452
+ 'attempt': json['attempt'],
453
+ 'retries': json['retries'],
454
+ 'evictions': json['evictions'],
455
+ 'oomExits': json['oom_exits'],
456
+ 'reservationMb': json['reservation_mb'],
457
+ 'wholeGpu': json['whole_gpu'],
458
+ 'predictedMb': json['predicted_mb'],
459
+ 'predictionSource': json['prediction_source'],
460
+ 'predictedComputePct': json['predicted_compute_pct'],
461
+ 'computePredictionSource': json['compute_prediction_source'],
462
+ 'peakMemoryMb': json['peak_memory_mb'],
463
+ 'gpuMemoryTotalMb': json['gpu_memory_total_mb'],
464
+ 'utilMeanPct': json['util_mean_pct'],
465
+ 'busyPct': json['busy_pct'],
466
+ 'memorySource': json['memory_source'],
467
+ 'sharingMode': json['sharing_mode'],
468
+ 'gpuSeconds': json['gpu_seconds'],
469
+ 'attributedCostUsd': json['attributed_cost_usd'],
470
+ 'exitCode': json['exit_code'],
471
+ 'createdAt': (new Date(json['created_at'])),
472
+ 'startedAt': (json['started_at'] == null ? null : new Date(json['started_at'])),
473
+ 'finishedAt': (json['finished_at'] == null ? null : new Date(json['finished_at'])),
474
+ 'sharingHint': json['sharing_hint'] == null ? undefined : JobSharingHintFromJSON(json['sharing_hint']),
475
+ 'attempts': json['attempts'] == null ? undefined : ((json['attempts'] as Array<any>).map(JobAttemptFromJSON)),
476
+ };
477
+ }
478
+
479
+ export function JobToJSON(json: any): Job {
480
+ return JobToJSONTyped(json, false);
481
+ }
482
+
483
+ export function JobToJSONTyped(value?: Job | null, ignoreDiscriminator: boolean = false): any {
484
+ if (value == null) {
485
+ return value;
486
+ }
487
+
488
+ return {
489
+
490
+ 'id': value['id'],
491
+ 'name': value['name'],
492
+ 'image': value['image'],
493
+ 'command': value['command'],
494
+ 'env_names': value['envNames'],
495
+ 'secrets': value['secrets'],
496
+ 'gpu_type': value['gpuType'],
497
+ 'min_vram_gb': value['minVramGb'],
498
+ 'memory_hint_mb': value['memoryHintMb'],
499
+ 'compute_hint_pct': value['computeHintPct'],
500
+ 'timeout_seconds': value['timeoutSeconds'],
501
+ 'max_wait_seconds': value['maxWaitSeconds'],
502
+ 'allow_sharing': value['allowSharing'],
503
+ 'allow_restart': value['allowRestart'],
504
+ 'isolation': value['isolation'],
505
+ 'mig_profile': value['migProfile'],
506
+ 'checkpoint_path': value['checkpointPath'],
507
+ 'max_retries': value['maxRetries'],
508
+ 'max_price_per_hour': value['maxPricePerHour'],
509
+ 'status': value['status'],
510
+ 'status_reason': value['statusReason'],
511
+ 'cancel_requested': value['cancelRequested'],
512
+ 'attempt': value['attempt'],
513
+ 'retries': value['retries'],
514
+ 'evictions': value['evictions'],
515
+ 'oom_exits': value['oomExits'],
516
+ 'reservation_mb': value['reservationMb'],
517
+ 'whole_gpu': value['wholeGpu'],
518
+ 'predicted_mb': value['predictedMb'],
519
+ 'prediction_source': value['predictionSource'],
520
+ 'predicted_compute_pct': value['predictedComputePct'],
521
+ 'compute_prediction_source': value['computePredictionSource'],
522
+ 'peak_memory_mb': value['peakMemoryMb'],
523
+ 'gpu_memory_total_mb': value['gpuMemoryTotalMb'],
524
+ 'util_mean_pct': value['utilMeanPct'],
525
+ 'busy_pct': value['busyPct'],
526
+ 'memory_source': value['memorySource'],
527
+ 'sharing_mode': value['sharingMode'],
528
+ 'gpu_seconds': value['gpuSeconds'],
529
+ 'attributed_cost_usd': value['attributedCostUsd'],
530
+ 'exit_code': value['exitCode'],
531
+ 'created_at': value['createdAt'].toISOString(),
532
+ 'started_at': value['startedAt'] == null ? value['startedAt'] : value['startedAt'].toISOString(),
533
+ 'finished_at': value['finishedAt'] == null ? value['finishedAt'] : value['finishedAt'].toISOString(),
534
+ 'sharing_hint': JobSharingHintToJSON(value['sharingHint']),
535
+ 'attempts': value['attempts'] == null ? undefined : ((value['attempts'] as Array<any>).map(JobAttemptToJSON)),
536
+ };
537
+ }
538
+