@gpuai/sdk 0.4.0 → 0.4.2

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 (47) hide show
  1. package/.openapi-generator/FILES +8 -0
  2. package/README.md +7 -2
  3. package/dist/apis/InstancesApi.d.ts +18 -0
  4. package/dist/apis/InstancesApi.js +49 -0
  5. package/dist/esm/apis/InstancesApi.d.ts +18 -0
  6. package/dist/esm/apis/InstancesApi.js +49 -0
  7. package/dist/esm/models/GpuSuggestion.d.ts +82 -0
  8. package/dist/esm/models/GpuSuggestion.js +77 -0
  9. package/dist/esm/models/GpuSuggestionCheaper.d.ts +62 -0
  10. package/dist/esm/models/GpuSuggestionCheaper.js +63 -0
  11. package/dist/esm/models/GpuSuggestionGpu.d.ts +50 -0
  12. package/dist/esm/models/GpuSuggestionGpu.js +55 -0
  13. package/dist/esm/models/Instance.d.ts +22 -0
  14. package/dist/esm/models/Instance.js +13 -0
  15. package/dist/esm/models/InstanceGpuMemory.d.ts +51 -0
  16. package/dist/esm/models/InstanceGpuMemory.js +55 -0
  17. package/dist/esm/models/index.d.ts +4 -0
  18. package/dist/esm/models/index.js +4 -0
  19. package/dist/esm/runtime.js +1 -1
  20. package/dist/models/GpuSuggestion.d.ts +82 -0
  21. package/dist/models/GpuSuggestion.js +85 -0
  22. package/dist/models/GpuSuggestionCheaper.d.ts +62 -0
  23. package/dist/models/GpuSuggestionCheaper.js +70 -0
  24. package/dist/models/GpuSuggestionGpu.d.ts +50 -0
  25. package/dist/models/GpuSuggestionGpu.js +62 -0
  26. package/dist/models/Instance.d.ts +22 -0
  27. package/dist/models/Instance.js +14 -1
  28. package/dist/models/InstanceGpuMemory.d.ts +51 -0
  29. package/dist/models/InstanceGpuMemory.js +62 -0
  30. package/dist/models/index.d.ts +4 -0
  31. package/dist/models/index.js +4 -0
  32. package/dist/runtime.js +1 -1
  33. package/docs/GpuSuggestion.md +47 -0
  34. package/docs/GpuSuggestionCheaper.md +45 -0
  35. package/docs/GpuSuggestionGpu.md +41 -0
  36. package/docs/Instance.md +4 -0
  37. package/docs/InstanceGpuMemory.md +41 -0
  38. package/docs/InstancesApi.md +75 -0
  39. package/package.json +1 -1
  40. package/src/apis/InstancesApi.ts +64 -0
  41. package/src/models/GpuSuggestion.ts +150 -0
  42. package/src/models/GpuSuggestionCheaper.ts +111 -0
  43. package/src/models/GpuSuggestionGpu.ts +93 -0
  44. package/src/models/Instance.ts +33 -0
  45. package/src/models/InstanceGpuMemory.ts +94 -0
  46. package/src/models/index.ts +4 -0
  47. package/src/runtime.ts +1 -1
@@ -62,6 +62,9 @@ docs/FunctionsApi.md
62
62
  docs/GPUType.md
63
63
  docs/GPUTypePage.md
64
64
  docs/GetHealth200Response.md
65
+ docs/GpuSuggestion.md
66
+ docs/GpuSuggestionCheaper.md
67
+ docs/GpuSuggestionGpu.md
65
68
  docs/GpuTypesApi.md
66
69
  docs/ImagesGenerationsRequest.md
67
70
  docs/ImagesResponse.md
@@ -71,6 +74,7 @@ docs/IncludeItem.md
71
74
  docs/InferenceApi.md
72
75
  docs/Instance.md
73
76
  docs/InstanceConnection.md
77
+ docs/InstanceGpuMemory.md
74
78
  docs/InstancePage.md
75
79
  docs/InstancesApi.md
76
80
  docs/Invoice.md
@@ -208,6 +212,9 @@ src/models/FunctionVersion.ts
208
212
  src/models/GPUType.ts
209
213
  src/models/GPUTypePage.ts
210
214
  src/models/GetHealth200Response.ts
215
+ src/models/GpuSuggestion.ts
216
+ src/models/GpuSuggestionCheaper.ts
217
+ src/models/GpuSuggestionGpu.ts
211
218
  src/models/ImagesGenerationsRequest.ts
212
219
  src/models/ImagesResponse.ts
213
220
  src/models/ImagesResponseDataInner.ts
@@ -215,6 +222,7 @@ src/models/ImagesResponseUsage.ts
215
222
  src/models/IncludeItem.ts
216
223
  src/models/Instance.ts
217
224
  src/models/InstanceConnection.ts
225
+ src/models/InstanceGpuMemory.ts
218
226
  src/models/InstancePage.ts
219
227
  src/models/Invoice.ts
220
228
  src/models/InvoiceList.ts
package/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # @gpuai/sdk@0.4.0
1
+ # @gpuai/sdk@0.4.2
2
2
 
3
3
  A TypeScript SDK client for the api.gpu.ai API.
4
4
 
@@ -110,6 +110,7 @@ All URIs are relative to *https://api.gpu.ai/v1*
110
110
  *InstancesApi* | [**createInstance**](docs/InstancesApi.md#createinstanceoperation) | **POST** /instances | Create an instance (async — returns 202 + Operation-Id header)
111
111
  *InstancesApi* | [**deleteInstance**](docs/InstancesApi.md#deleteinstance) | **DELETE** /instances/{id} | Terminate an instance (idempotent)
112
112
  *InstancesApi* | [**getInstance**](docs/InstancesApi.md#getinstance) | **GET** /instances/{id} | Get an instance
113
+ *InstancesApi* | [**getInstanceGpuSuggestion**](docs/InstancesApi.md#getinstancegpusuggestion) | **GET** /instances/{id}/gpu-suggestion | Suggest a lower-priced GPU for an instance
113
114
  *InstancesApi* | [**listInstances**](docs/InstancesApi.md#listinstances) | **GET** /instances | List instances
114
115
  *InstancesApi* | [**updateInstance**](docs/InstancesApi.md#updateinstanceoperation) | **PATCH** /instances/{id} | Update an instance (rename only in v1)
115
116
  *MarketApi* | [**getMarketHistory**](docs/MarketApi.md#getmarkethistory) | **GET** /market-history | Get a GPU\'s price and availability over time
@@ -195,6 +196,9 @@ All URIs are relative to *https://api.gpu.ai/v1*
195
196
  - [GPUType](docs/GPUType.md)
196
197
  - [GPUTypePage](docs/GPUTypePage.md)
197
198
  - [GetHealth200Response](docs/GetHealth200Response.md)
199
+ - [GpuSuggestion](docs/GpuSuggestion.md)
200
+ - [GpuSuggestionCheaper](docs/GpuSuggestionCheaper.md)
201
+ - [GpuSuggestionGpu](docs/GpuSuggestionGpu.md)
198
202
  - [ImagesGenerationsRequest](docs/ImagesGenerationsRequest.md)
199
203
  - [ImagesResponse](docs/ImagesResponse.md)
200
204
  - [ImagesResponseDataInner](docs/ImagesResponseDataInner.md)
@@ -202,6 +206,7 @@ All URIs are relative to *https://api.gpu.ai/v1*
202
206
  - [IncludeItem](docs/IncludeItem.md)
203
207
  - [Instance](docs/Instance.md)
204
208
  - [InstanceConnection](docs/InstanceConnection.md)
209
+ - [InstanceGpuMemory](docs/InstanceGpuMemory.md)
205
210
  - [InstancePage](docs/InstancePage.md)
206
211
  - [Invoice](docs/Invoice.md)
207
212
  - [InvoiceList](docs/InvoiceList.md)
@@ -269,7 +274,7 @@ and is automatically generated by the
269
274
  [OpenAPI Generator](https://openapi-generator.tech) project:
270
275
 
271
276
  - API version: `1.0.0`
272
- - Package version: `0.4.0`
277
+ - Package version: `0.4.2`
273
278
  - Generator version: `7.24.0`
274
279
  - Build package: `org.openapitools.codegen.languages.TypeScriptFetchClientCodegen`
275
280
 
@@ -11,6 +11,7 @@
11
11
  */
12
12
  import * as runtime from '../runtime';
13
13
  import { type CreateInstanceRequest } from '../models/CreateInstanceRequest';
14
+ import { type GpuSuggestion } from '../models/GpuSuggestion';
14
15
  import { type Instance } from '../models/Instance';
15
16
  import { type InstancePage } from '../models/InstancePage';
16
17
  import { type Operation } from '../models/Operation';
@@ -27,6 +28,9 @@ export interface GetInstanceRequest {
27
28
  id: string;
28
29
  include?: GetInstanceIncludeEnum;
29
30
  }
31
+ export interface GetInstanceGpuSuggestionRequest {
32
+ id: string;
33
+ }
30
34
  export interface ListInstancesRequest {
31
35
  cursor?: string;
32
36
  limit?: number;
@@ -79,6 +83,20 @@ export declare class InstancesApi extends runtime.BaseAPI {
79
83
  * Get an instance
80
84
  */
81
85
  getInstance(requestParameters: GetInstanceRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Instance>;
86
+ /**
87
+ * Creates request options for getInstanceGpuSuggestion without sending the request
88
+ */
89
+ getInstanceGpuSuggestionRequestOpts(requestParameters: GetInstanceGpuSuggestionRequest): Promise<runtime.RequestOpts>;
90
+ /**
91
+ * Compares the highest GPU memory this instance has used (its `gpu_memory` peak, plus headroom) with the GPU models currently listed, and names the cheapest model that would have fit when the saving is worth a look. It never changes anything: it reports what the telemetry shows. Memory use can grow later, so treat it as a starting point. `status` is `insufficient_data` until the instance has about an hour of telemetry, `no_cheaper_fit` when no cheaper listed model covers the peak, and `suggestion` when one does. Requires the `instances:read` scope. An instance owned by another organization returns 404.
92
+ * Suggest a lower-priced GPU for an instance
93
+ */
94
+ getInstanceGpuSuggestionRaw(requestParameters: GetInstanceGpuSuggestionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<GpuSuggestion>>;
95
+ /**
96
+ * Compares the highest GPU memory this instance has used (its `gpu_memory` peak, plus headroom) with the GPU models currently listed, and names the cheapest model that would have fit when the saving is worth a look. It never changes anything: it reports what the telemetry shows. Memory use can grow later, so treat it as a starting point. `status` is `insufficient_data` until the instance has about an hour of telemetry, `no_cheaper_fit` when no cheaper listed model covers the peak, and `suggestion` when one does. Requires the `instances:read` scope. An instance owned by another organization returns 404.
97
+ * Suggest a lower-priced GPU for an instance
98
+ */
99
+ getInstanceGpuSuggestion(requestParameters: GetInstanceGpuSuggestionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<GpuSuggestion>;
82
100
  /**
83
101
  * Creates request options for listInstances without sending the request
84
102
  */
@@ -25,6 +25,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
25
25
  exports.ListInstancesStatusEnum = exports.GetInstanceIncludeEnum = exports.InstancesApi = void 0;
26
26
  const runtime = require("../runtime");
27
27
  const CreateInstanceRequest_1 = require("../models/CreateInstanceRequest");
28
+ const GpuSuggestion_1 = require("../models/GpuSuggestion");
28
29
  const Instance_1 = require("../models/Instance");
29
30
  const InstancePage_1 = require("../models/InstancePage");
30
31
  const Operation_1 = require("../models/Operation");
@@ -183,6 +184,54 @@ class InstancesApi extends runtime.BaseAPI {
183
184
  return yield response.value();
184
185
  });
185
186
  }
187
+ /**
188
+ * Creates request options for getInstanceGpuSuggestion without sending the request
189
+ */
190
+ getInstanceGpuSuggestionRequestOpts(requestParameters) {
191
+ return __awaiter(this, void 0, void 0, function* () {
192
+ if (requestParameters['id'] == null) {
193
+ throw new runtime.RequiredError('id', 'Required parameter "id" was null or undefined when calling getInstanceGpuSuggestion().');
194
+ }
195
+ const queryParameters = {};
196
+ const headerParameters = {};
197
+ if (this.configuration && this.configuration.accessToken) {
198
+ const token = this.configuration.accessToken;
199
+ const tokenString = yield token("bearerAuth", []);
200
+ if (tokenString) {
201
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
202
+ }
203
+ }
204
+ let urlPath = `/instances/{id}/gpu-suggestion`;
205
+ urlPath = urlPath.replace('{id}', encodeURIComponent(String(requestParameters['id'])));
206
+ return {
207
+ path: urlPath,
208
+ method: 'GET',
209
+ headers: headerParameters,
210
+ query: queryParameters,
211
+ };
212
+ });
213
+ }
214
+ /**
215
+ * Compares the highest GPU memory this instance has used (its `gpu_memory` peak, plus headroom) with the GPU models currently listed, and names the cheapest model that would have fit when the saving is worth a look. It never changes anything: it reports what the telemetry shows. Memory use can grow later, so treat it as a starting point. `status` is `insufficient_data` until the instance has about an hour of telemetry, `no_cheaper_fit` when no cheaper listed model covers the peak, and `suggestion` when one does. Requires the `instances:read` scope. An instance owned by another organization returns 404.
216
+ * Suggest a lower-priced GPU for an instance
217
+ */
218
+ getInstanceGpuSuggestionRaw(requestParameters, initOverrides) {
219
+ return __awaiter(this, void 0, void 0, function* () {
220
+ const requestOptions = yield this.getInstanceGpuSuggestionRequestOpts(requestParameters);
221
+ const response = yield this.request(requestOptions, initOverrides);
222
+ return new runtime.JSONApiResponse(response, (jsonValue) => (0, GpuSuggestion_1.GpuSuggestionFromJSON)(jsonValue));
223
+ });
224
+ }
225
+ /**
226
+ * Compares the highest GPU memory this instance has used (its `gpu_memory` peak, plus headroom) with the GPU models currently listed, and names the cheapest model that would have fit when the saving is worth a look. It never changes anything: it reports what the telemetry shows. Memory use can grow later, so treat it as a starting point. `status` is `insufficient_data` until the instance has about an hour of telemetry, `no_cheaper_fit` when no cheaper listed model covers the peak, and `suggestion` when one does. Requires the `instances:read` scope. An instance owned by another organization returns 404.
227
+ * Suggest a lower-priced GPU for an instance
228
+ */
229
+ getInstanceGpuSuggestion(requestParameters, initOverrides) {
230
+ return __awaiter(this, void 0, void 0, function* () {
231
+ const response = yield this.getInstanceGpuSuggestionRaw(requestParameters, initOverrides);
232
+ return yield response.value();
233
+ });
234
+ }
186
235
  /**
187
236
  * Creates request options for listInstances without sending the request
188
237
  */
@@ -11,6 +11,7 @@
11
11
  */
12
12
  import * as runtime from '../runtime';
13
13
  import { type CreateInstanceRequest } from '../models/CreateInstanceRequest';
14
+ import { type GpuSuggestion } from '../models/GpuSuggestion';
14
15
  import { type Instance } from '../models/Instance';
15
16
  import { type InstancePage } from '../models/InstancePage';
16
17
  import { type Operation } from '../models/Operation';
@@ -27,6 +28,9 @@ export interface GetInstanceRequest {
27
28
  id: string;
28
29
  include?: GetInstanceIncludeEnum;
29
30
  }
31
+ export interface GetInstanceGpuSuggestionRequest {
32
+ id: string;
33
+ }
30
34
  export interface ListInstancesRequest {
31
35
  cursor?: string;
32
36
  limit?: number;
@@ -79,6 +83,20 @@ export declare class InstancesApi extends runtime.BaseAPI {
79
83
  * Get an instance
80
84
  */
81
85
  getInstance(requestParameters: GetInstanceRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Instance>;
86
+ /**
87
+ * Creates request options for getInstanceGpuSuggestion without sending the request
88
+ */
89
+ getInstanceGpuSuggestionRequestOpts(requestParameters: GetInstanceGpuSuggestionRequest): Promise<runtime.RequestOpts>;
90
+ /**
91
+ * Compares the highest GPU memory this instance has used (its `gpu_memory` peak, plus headroom) with the GPU models currently listed, and names the cheapest model that would have fit when the saving is worth a look. It never changes anything: it reports what the telemetry shows. Memory use can grow later, so treat it as a starting point. `status` is `insufficient_data` until the instance has about an hour of telemetry, `no_cheaper_fit` when no cheaper listed model covers the peak, and `suggestion` when one does. Requires the `instances:read` scope. An instance owned by another organization returns 404.
92
+ * Suggest a lower-priced GPU for an instance
93
+ */
94
+ getInstanceGpuSuggestionRaw(requestParameters: GetInstanceGpuSuggestionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<GpuSuggestion>>;
95
+ /**
96
+ * Compares the highest GPU memory this instance has used (its `gpu_memory` peak, plus headroom) with the GPU models currently listed, and names the cheapest model that would have fit when the saving is worth a look. It never changes anything: it reports what the telemetry shows. Memory use can grow later, so treat it as a starting point. `status` is `insufficient_data` until the instance has about an hour of telemetry, `no_cheaper_fit` when no cheaper listed model covers the peak, and `suggestion` when one does. Requires the `instances:read` scope. An instance owned by another organization returns 404.
97
+ * Suggest a lower-priced GPU for an instance
98
+ */
99
+ getInstanceGpuSuggestion(requestParameters: GetInstanceGpuSuggestionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<GpuSuggestion>;
82
100
  /**
83
101
  * Creates request options for listInstances without sending the request
84
102
  */
@@ -22,6 +22,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
22
22
  };
23
23
  import * as runtime from '../runtime';
24
24
  import { CreateInstanceRequestToJSON, } from '../models/CreateInstanceRequest';
25
+ import { GpuSuggestionFromJSON, } from '../models/GpuSuggestion';
25
26
  import { InstanceFromJSON, } from '../models/Instance';
26
27
  import { InstancePageFromJSON, } from '../models/InstancePage';
27
28
  import { OperationFromJSON, } from '../models/Operation';
@@ -180,6 +181,54 @@ export class InstancesApi extends runtime.BaseAPI {
180
181
  return yield response.value();
181
182
  });
182
183
  }
184
+ /**
185
+ * Creates request options for getInstanceGpuSuggestion without sending the request
186
+ */
187
+ getInstanceGpuSuggestionRequestOpts(requestParameters) {
188
+ return __awaiter(this, void 0, void 0, function* () {
189
+ if (requestParameters['id'] == null) {
190
+ throw new runtime.RequiredError('id', 'Required parameter "id" was null or undefined when calling getInstanceGpuSuggestion().');
191
+ }
192
+ const queryParameters = {};
193
+ const headerParameters = {};
194
+ if (this.configuration && this.configuration.accessToken) {
195
+ const token = this.configuration.accessToken;
196
+ const tokenString = yield token("bearerAuth", []);
197
+ if (tokenString) {
198
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
199
+ }
200
+ }
201
+ let urlPath = `/instances/{id}/gpu-suggestion`;
202
+ urlPath = urlPath.replace('{id}', encodeURIComponent(String(requestParameters['id'])));
203
+ return {
204
+ path: urlPath,
205
+ method: 'GET',
206
+ headers: headerParameters,
207
+ query: queryParameters,
208
+ };
209
+ });
210
+ }
211
+ /**
212
+ * Compares the highest GPU memory this instance has used (its `gpu_memory` peak, plus headroom) with the GPU models currently listed, and names the cheapest model that would have fit when the saving is worth a look. It never changes anything: it reports what the telemetry shows. Memory use can grow later, so treat it as a starting point. `status` is `insufficient_data` until the instance has about an hour of telemetry, `no_cheaper_fit` when no cheaper listed model covers the peak, and `suggestion` when one does. Requires the `instances:read` scope. An instance owned by another organization returns 404.
213
+ * Suggest a lower-priced GPU for an instance
214
+ */
215
+ getInstanceGpuSuggestionRaw(requestParameters, initOverrides) {
216
+ return __awaiter(this, void 0, void 0, function* () {
217
+ const requestOptions = yield this.getInstanceGpuSuggestionRequestOpts(requestParameters);
218
+ const response = yield this.request(requestOptions, initOverrides);
219
+ return new runtime.JSONApiResponse(response, (jsonValue) => GpuSuggestionFromJSON(jsonValue));
220
+ });
221
+ }
222
+ /**
223
+ * Compares the highest GPU memory this instance has used (its `gpu_memory` peak, plus headroom) with the GPU models currently listed, and names the cheapest model that would have fit when the saving is worth a look. It never changes anything: it reports what the telemetry shows. Memory use can grow later, so treat it as a starting point. `status` is `insufficient_data` until the instance has about an hour of telemetry, `no_cheaper_fit` when no cheaper listed model covers the peak, and `suggestion` when one does. Requires the `instances:read` scope. An instance owned by another organization returns 404.
224
+ * Suggest a lower-priced GPU for an instance
225
+ */
226
+ getInstanceGpuSuggestion(requestParameters, initOverrides) {
227
+ return __awaiter(this, void 0, void 0, function* () {
228
+ const response = yield this.getInstanceGpuSuggestionRaw(requestParameters, initOverrides);
229
+ return yield response.value();
230
+ });
231
+ }
183
232
  /**
184
233
  * Creates request options for listInstances without sending the request
185
234
  */
@@ -0,0 +1,82 @@
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 { GpuSuggestionCheaper } from './GpuSuggestionCheaper';
13
+ import type { GpuSuggestionGpu } from './GpuSuggestionGpu';
14
+ /**
15
+ * Whether a lower-priced GPU model would have fit an instance's observed peak GPU memory. It names GPU models and prices only.
16
+ *
17
+ * @export
18
+ * @interface GpuSuggestion
19
+ */
20
+ export interface GpuSuggestion {
21
+ /**
22
+ * `suggestion` when a cheaper model fits and the saving is at least 10% and $0.05 per hour. `insufficient_data` until the instance has at least 30 samples over at least an hour. `no_cheaper_fit` otherwise.
23
+ *
24
+ * @type {GpuSuggestionStatusEnum}
25
+ * @memberof GpuSuggestion
26
+ */
27
+ status: GpuSuggestionStatusEnum;
28
+ /**
29
+ * Highest GPU memory seen, in MiB. Null with no telemetry.
30
+ * @type {number}
31
+ * @memberof GpuSuggestion
32
+ */
33
+ peakUsedMb: number | null;
34
+ /**
35
+ * The peak plus headroom (25% and 1024 MiB), in MiB: the memory a suggested model must have. Null until there is enough telemetry.
36
+ *
37
+ * @type {number}
38
+ * @memberof GpuSuggestion
39
+ */
40
+ requiredMb: number | null;
41
+ /**
42
+ *
43
+ * @type {number}
44
+ * @memberof GpuSuggestion
45
+ */
46
+ samples: number;
47
+ /**
48
+ * Minutes between the first and the latest telemetry sample.
49
+ * @type {number}
50
+ * @memberof GpuSuggestion
51
+ */
52
+ observedMinutes: number;
53
+ /**
54
+ *
55
+ * @type {GpuSuggestionGpu}
56
+ * @memberof GpuSuggestion
57
+ */
58
+ current: GpuSuggestionGpu;
59
+ /**
60
+ * Set only when status is `suggestion`.
61
+ * @type {GpuSuggestionCheaper}
62
+ * @memberof GpuSuggestion
63
+ */
64
+ suggestion: GpuSuggestionCheaper | null;
65
+ }
66
+ /**
67
+ * @export
68
+ */
69
+ export declare const GpuSuggestionStatusEnum: {
70
+ readonly Suggestion: "suggestion";
71
+ readonly InsufficientData: "insufficient_data";
72
+ readonly NoCheaperFit: "no_cheaper_fit";
73
+ };
74
+ export type GpuSuggestionStatusEnum = typeof GpuSuggestionStatusEnum[keyof typeof GpuSuggestionStatusEnum];
75
+ /**
76
+ * Check if a given object implements the GpuSuggestion interface.
77
+ */
78
+ export declare function instanceOfGpuSuggestion(value: object): value is GpuSuggestion;
79
+ export declare function GpuSuggestionFromJSON(json: any): GpuSuggestion;
80
+ export declare function GpuSuggestionFromJSONTyped(json: any, ignoreDiscriminator: boolean): GpuSuggestion;
81
+ export declare function GpuSuggestionToJSON(json: any): GpuSuggestion;
82
+ export declare function GpuSuggestionToJSONTyped(value?: GpuSuggestion | null, ignoreDiscriminator?: boolean): any;
@@ -0,0 +1,77 @@
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
+ import { GpuSuggestionCheaperFromJSON, GpuSuggestionCheaperToJSON, } from './GpuSuggestionCheaper';
15
+ import { GpuSuggestionGpuFromJSON, GpuSuggestionGpuToJSON, } from './GpuSuggestionGpu';
16
+ /**
17
+ * @export
18
+ */
19
+ export const GpuSuggestionStatusEnum = {
20
+ Suggestion: 'suggestion',
21
+ InsufficientData: 'insufficient_data',
22
+ NoCheaperFit: 'no_cheaper_fit'
23
+ };
24
+ /**
25
+ * Check if a given object implements the GpuSuggestion interface.
26
+ */
27
+ export function instanceOfGpuSuggestion(value) {
28
+ if (!('status' in value) || value['status'] === undefined)
29
+ return false;
30
+ if ((!('peakUsedMb' in value) && !('peak_used_mb' in value)) || (value['peakUsedMb'] === undefined && value['peak_used_mb'] === undefined))
31
+ return false;
32
+ if ((!('requiredMb' in value) && !('required_mb' in value)) || (value['requiredMb'] === undefined && value['required_mb'] === undefined))
33
+ return false;
34
+ if (!('samples' in value) || value['samples'] === undefined)
35
+ return false;
36
+ if ((!('observedMinutes' in value) && !('observed_minutes' in value)) || (value['observedMinutes'] === undefined && value['observed_minutes'] === undefined))
37
+ return false;
38
+ if (!('current' in value) || value['current'] === undefined)
39
+ return false;
40
+ if (!('suggestion' in value) || value['suggestion'] === undefined)
41
+ return false;
42
+ return true;
43
+ }
44
+ export function GpuSuggestionFromJSON(json) {
45
+ return GpuSuggestionFromJSONTyped(json, false);
46
+ }
47
+ export function GpuSuggestionFromJSONTyped(json, ignoreDiscriminator) {
48
+ if (json == null) {
49
+ return json;
50
+ }
51
+ return {
52
+ 'status': json['status'],
53
+ 'peakUsedMb': json['peak_used_mb'],
54
+ 'requiredMb': json['required_mb'],
55
+ 'samples': json['samples'],
56
+ 'observedMinutes': json['observed_minutes'],
57
+ 'current': GpuSuggestionGpuFromJSON(json['current']),
58
+ 'suggestion': GpuSuggestionCheaperFromJSON(json['suggestion']),
59
+ };
60
+ }
61
+ export function GpuSuggestionToJSON(json) {
62
+ return GpuSuggestionToJSONTyped(json, false);
63
+ }
64
+ export function GpuSuggestionToJSONTyped(value, ignoreDiscriminator = false) {
65
+ if (value == null) {
66
+ return value;
67
+ }
68
+ return {
69
+ 'status': value['status'],
70
+ 'peak_used_mb': value['peakUsedMb'],
71
+ 'required_mb': value['requiredMb'],
72
+ 'samples': value['samples'],
73
+ 'observed_minutes': value['observedMinutes'],
74
+ 'current': GpuSuggestionGpuToJSON(value['current']),
75
+ 'suggestion': GpuSuggestionCheaperToJSON(value['suggestion']),
76
+ };
77
+ }
@@ -0,0 +1,62 @@
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
+ /**
13
+ * The suggested GPU model and what it would save.
14
+ * @export
15
+ * @interface GpuSuggestionCheaper
16
+ */
17
+ export interface GpuSuggestionCheaper {
18
+ /**
19
+ *
20
+ * @type {string}
21
+ * @memberof GpuSuggestionCheaper
22
+ */
23
+ gpuType: string;
24
+ /**
25
+ *
26
+ * @type {string}
27
+ * @memberof GpuSuggestionCheaper
28
+ */
29
+ gpuName: string;
30
+ /**
31
+ *
32
+ * @type {number}
33
+ * @memberof GpuSuggestionCheaper
34
+ */
35
+ vramGb: number;
36
+ /**
37
+ * The cheapest current listing for this model, per hour.
38
+ * @type {number}
39
+ * @memberof GpuSuggestionCheaper
40
+ */
41
+ pricePerHour: number;
42
+ /**
43
+ * The instance's hourly price minus this model's.
44
+ * @type {number}
45
+ * @memberof GpuSuggestionCheaper
46
+ */
47
+ savingPerHour: number;
48
+ /**
49
+ * The saving as a percentage of the instance's hourly price.
50
+ * @type {number}
51
+ * @memberof GpuSuggestionCheaper
52
+ */
53
+ savingPct: number;
54
+ }
55
+ /**
56
+ * Check if a given object implements the GpuSuggestionCheaper interface.
57
+ */
58
+ export declare function instanceOfGpuSuggestionCheaper(value: object): value is GpuSuggestionCheaper;
59
+ export declare function GpuSuggestionCheaperFromJSON(json: any): GpuSuggestionCheaper;
60
+ export declare function GpuSuggestionCheaperFromJSONTyped(json: any, ignoreDiscriminator: boolean): GpuSuggestionCheaper;
61
+ export declare function GpuSuggestionCheaperToJSON(json: any): GpuSuggestionCheaper;
62
+ export declare function GpuSuggestionCheaperToJSONTyped(value?: GpuSuggestionCheaper | null, ignoreDiscriminator?: boolean): any;
@@ -0,0 +1,63 @@
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
+ * Check if a given object implements the GpuSuggestionCheaper interface.
16
+ */
17
+ export function instanceOfGpuSuggestionCheaper(value) {
18
+ if ((!('gpuType' in value) && !('gpu_type' in value)) || (value['gpuType'] === undefined && value['gpu_type'] === undefined))
19
+ return false;
20
+ if ((!('gpuName' in value) && !('gpu_name' in value)) || (value['gpuName'] === undefined && value['gpu_name'] === undefined))
21
+ return false;
22
+ if ((!('vramGb' in value) && !('vram_gb' in value)) || (value['vramGb'] === undefined && value['vram_gb'] === undefined))
23
+ return false;
24
+ if ((!('pricePerHour' in value) && !('price_per_hour' in value)) || (value['pricePerHour'] === undefined && value['price_per_hour'] === undefined))
25
+ return false;
26
+ if ((!('savingPerHour' in value) && !('saving_per_hour' in value)) || (value['savingPerHour'] === undefined && value['saving_per_hour'] === undefined))
27
+ return false;
28
+ if ((!('savingPct' in value) && !('saving_pct' in value)) || (value['savingPct'] === undefined && value['saving_pct'] === undefined))
29
+ return false;
30
+ return true;
31
+ }
32
+ export function GpuSuggestionCheaperFromJSON(json) {
33
+ return GpuSuggestionCheaperFromJSONTyped(json, false);
34
+ }
35
+ export function GpuSuggestionCheaperFromJSONTyped(json, ignoreDiscriminator) {
36
+ if (json == null) {
37
+ return json;
38
+ }
39
+ return {
40
+ 'gpuType': json['gpu_type'],
41
+ 'gpuName': json['gpu_name'],
42
+ 'vramGb': json['vram_gb'],
43
+ 'pricePerHour': json['price_per_hour'],
44
+ 'savingPerHour': json['saving_per_hour'],
45
+ 'savingPct': json['saving_pct'],
46
+ };
47
+ }
48
+ export function GpuSuggestionCheaperToJSON(json) {
49
+ return GpuSuggestionCheaperToJSONTyped(json, false);
50
+ }
51
+ export function GpuSuggestionCheaperToJSONTyped(value, ignoreDiscriminator = false) {
52
+ if (value == null) {
53
+ return value;
54
+ }
55
+ return {
56
+ 'gpu_type': value['gpuType'],
57
+ 'gpu_name': value['gpuName'],
58
+ 'vram_gb': value['vramGb'],
59
+ 'price_per_hour': value['pricePerHour'],
60
+ 'saving_per_hour': value['savingPerHour'],
61
+ 'saving_pct': value['savingPct'],
62
+ };
63
+ }
@@ -0,0 +1,50 @@
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
+ /**
13
+ * A GPU model at an hourly price.
14
+ * @export
15
+ * @interface GpuSuggestionGpu
16
+ */
17
+ export interface GpuSuggestionGpu {
18
+ /**
19
+ * The GPU model id, as in GET /v1/gpu-types.
20
+ * @type {string}
21
+ * @memberof GpuSuggestionGpu
22
+ */
23
+ gpuType: string;
24
+ /**
25
+ * The GPU model's display name.
26
+ * @type {string}
27
+ * @memberof GpuSuggestionGpu
28
+ */
29
+ gpuName: string;
30
+ /**
31
+ * Memory per GPU, in GB.
32
+ * @type {number}
33
+ * @memberof GpuSuggestionGpu
34
+ */
35
+ vramGb: number;
36
+ /**
37
+ * Hourly price for the same number of GPUs as the instance.
38
+ * @type {number}
39
+ * @memberof GpuSuggestionGpu
40
+ */
41
+ pricePerHour: number;
42
+ }
43
+ /**
44
+ * Check if a given object implements the GpuSuggestionGpu interface.
45
+ */
46
+ export declare function instanceOfGpuSuggestionGpu(value: object): value is GpuSuggestionGpu;
47
+ export declare function GpuSuggestionGpuFromJSON(json: any): GpuSuggestionGpu;
48
+ export declare function GpuSuggestionGpuFromJSONTyped(json: any, ignoreDiscriminator: boolean): GpuSuggestionGpu;
49
+ export declare function GpuSuggestionGpuToJSON(json: any): GpuSuggestionGpu;
50
+ export declare function GpuSuggestionGpuToJSONTyped(value?: GpuSuggestionGpu | null, ignoreDiscriminator?: boolean): any;