@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.
- package/.openapi-generator/FILES +8 -0
- package/README.md +7 -2
- package/dist/apis/InstancesApi.d.ts +18 -0
- package/dist/apis/InstancesApi.js +49 -0
- package/dist/esm/apis/InstancesApi.d.ts +18 -0
- package/dist/esm/apis/InstancesApi.js +49 -0
- package/dist/esm/models/GpuSuggestion.d.ts +82 -0
- package/dist/esm/models/GpuSuggestion.js +77 -0
- package/dist/esm/models/GpuSuggestionCheaper.d.ts +62 -0
- package/dist/esm/models/GpuSuggestionCheaper.js +63 -0
- package/dist/esm/models/GpuSuggestionGpu.d.ts +50 -0
- package/dist/esm/models/GpuSuggestionGpu.js +55 -0
- package/dist/esm/models/Instance.d.ts +22 -0
- package/dist/esm/models/Instance.js +13 -0
- package/dist/esm/models/InstanceGpuMemory.d.ts +51 -0
- package/dist/esm/models/InstanceGpuMemory.js +55 -0
- package/dist/esm/models/index.d.ts +4 -0
- package/dist/esm/models/index.js +4 -0
- package/dist/esm/runtime.js +1 -1
- package/dist/models/GpuSuggestion.d.ts +82 -0
- package/dist/models/GpuSuggestion.js +85 -0
- package/dist/models/GpuSuggestionCheaper.d.ts +62 -0
- package/dist/models/GpuSuggestionCheaper.js +70 -0
- package/dist/models/GpuSuggestionGpu.d.ts +50 -0
- package/dist/models/GpuSuggestionGpu.js +62 -0
- package/dist/models/Instance.d.ts +22 -0
- package/dist/models/Instance.js +14 -1
- package/dist/models/InstanceGpuMemory.d.ts +51 -0
- package/dist/models/InstanceGpuMemory.js +62 -0
- package/dist/models/index.d.ts +4 -0
- package/dist/models/index.js +4 -0
- package/dist/runtime.js +1 -1
- package/docs/GpuSuggestion.md +47 -0
- package/docs/GpuSuggestionCheaper.md +45 -0
- package/docs/GpuSuggestionGpu.md +41 -0
- package/docs/Instance.md +4 -0
- package/docs/InstanceGpuMemory.md +41 -0
- package/docs/InstancesApi.md +75 -0
- package/package.json +1 -1
- package/src/apis/InstancesApi.ts +64 -0
- package/src/models/GpuSuggestion.ts +150 -0
- package/src/models/GpuSuggestionCheaper.ts +111 -0
- package/src/models/GpuSuggestionGpu.ts +93 -0
- package/src/models/Instance.ts +33 -0
- package/src/models/InstanceGpuMemory.ts +94 -0
- package/src/models/index.ts +4 -0
- package/src/runtime.ts +1 -1
|
@@ -0,0 +1,62 @@
|
|
|
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.instanceOfGpuSuggestionGpu = instanceOfGpuSuggestionGpu;
|
|
17
|
+
exports.GpuSuggestionGpuFromJSON = GpuSuggestionGpuFromJSON;
|
|
18
|
+
exports.GpuSuggestionGpuFromJSONTyped = GpuSuggestionGpuFromJSONTyped;
|
|
19
|
+
exports.GpuSuggestionGpuToJSON = GpuSuggestionGpuToJSON;
|
|
20
|
+
exports.GpuSuggestionGpuToJSONTyped = GpuSuggestionGpuToJSONTyped;
|
|
21
|
+
/**
|
|
22
|
+
* Check if a given object implements the GpuSuggestionGpu interface.
|
|
23
|
+
*/
|
|
24
|
+
function instanceOfGpuSuggestionGpu(value) {
|
|
25
|
+
if ((!('gpuType' in value) && !('gpu_type' in value)) || (value['gpuType'] === undefined && value['gpu_type'] === undefined))
|
|
26
|
+
return false;
|
|
27
|
+
if ((!('gpuName' in value) && !('gpu_name' in value)) || (value['gpuName'] === undefined && value['gpu_name'] === undefined))
|
|
28
|
+
return false;
|
|
29
|
+
if ((!('vramGb' in value) && !('vram_gb' in value)) || (value['vramGb'] === undefined && value['vram_gb'] === undefined))
|
|
30
|
+
return false;
|
|
31
|
+
if ((!('pricePerHour' in value) && !('price_per_hour' in value)) || (value['pricePerHour'] === undefined && value['price_per_hour'] === undefined))
|
|
32
|
+
return false;
|
|
33
|
+
return true;
|
|
34
|
+
}
|
|
35
|
+
function GpuSuggestionGpuFromJSON(json) {
|
|
36
|
+
return GpuSuggestionGpuFromJSONTyped(json, false);
|
|
37
|
+
}
|
|
38
|
+
function GpuSuggestionGpuFromJSONTyped(json, ignoreDiscriminator) {
|
|
39
|
+
if (json == null) {
|
|
40
|
+
return json;
|
|
41
|
+
}
|
|
42
|
+
return {
|
|
43
|
+
'gpuType': json['gpu_type'],
|
|
44
|
+
'gpuName': json['gpu_name'],
|
|
45
|
+
'vramGb': json['vram_gb'],
|
|
46
|
+
'pricePerHour': json['price_per_hour'],
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
function GpuSuggestionGpuToJSON(json) {
|
|
50
|
+
return GpuSuggestionGpuToJSONTyped(json, false);
|
|
51
|
+
}
|
|
52
|
+
function GpuSuggestionGpuToJSONTyped(value, ignoreDiscriminator = false) {
|
|
53
|
+
if (value == null) {
|
|
54
|
+
return value;
|
|
55
|
+
}
|
|
56
|
+
return {
|
|
57
|
+
'gpu_type': value['gpuType'],
|
|
58
|
+
'gpu_name': value['gpuName'],
|
|
59
|
+
'vram_gb': value['vramGb'],
|
|
60
|
+
'price_per_hour': value['pricePerHour'],
|
|
61
|
+
};
|
|
62
|
+
}
|
|
@@ -10,6 +10,7 @@
|
|
|
10
10
|
* Do not edit the class manually.
|
|
11
11
|
*/
|
|
12
12
|
import type { InstanceConnection } from './InstanceConnection';
|
|
13
|
+
import type { InstanceGpuMemory } from './InstanceGpuMemory';
|
|
13
14
|
/**
|
|
14
15
|
*
|
|
15
16
|
* @export
|
|
@@ -64,6 +65,12 @@ export interface Instance {
|
|
|
64
65
|
* @memberof Instance
|
|
65
66
|
*/
|
|
66
67
|
pricePerHour: number;
|
|
68
|
+
/**
|
|
69
|
+
*
|
|
70
|
+
* @type {InstanceGpuMemory}
|
|
71
|
+
* @memberof Instance
|
|
72
|
+
*/
|
|
73
|
+
gpuMemory?: InstanceGpuMemory;
|
|
67
74
|
/**
|
|
68
75
|
*
|
|
69
76
|
* @type {InstanceConnection}
|
|
@@ -130,6 +137,12 @@ export interface Instance {
|
|
|
130
137
|
* @memberof Instance
|
|
131
138
|
*/
|
|
132
139
|
unreachableSince?: Date;
|
|
140
|
+
/**
|
|
141
|
+
* How far a launch that is not ready yet has got. machine_requested means the machine was requested and no image download has been reported yet; pulling_image means the image is downloading or unpacking; setting_up means the container is up and the platform is finishing SSH and the GPU check. Present only while status is allocating or starting and the platform is following the boot; absent otherwise. Lets a client with a fixed timeout tell a launch that is still moving from one that is stuck.
|
|
142
|
+
* @type {InstanceBootPhaseEnum}
|
|
143
|
+
* @memberof Instance
|
|
144
|
+
*/
|
|
145
|
+
bootPhase?: InstanceBootPhaseEnum;
|
|
133
146
|
}
|
|
134
147
|
/**
|
|
135
148
|
* @export
|
|
@@ -153,6 +166,15 @@ export declare const InstanceTierEnum: {
|
|
|
153
166
|
readonly OnDemand: "on_demand";
|
|
154
167
|
};
|
|
155
168
|
export type InstanceTierEnum = typeof InstanceTierEnum[keyof typeof InstanceTierEnum];
|
|
169
|
+
/**
|
|
170
|
+
* @export
|
|
171
|
+
*/
|
|
172
|
+
export declare const InstanceBootPhaseEnum: {
|
|
173
|
+
readonly MachineRequested: "machine_requested";
|
|
174
|
+
readonly PullingImage: "pulling_image";
|
|
175
|
+
readonly SettingUp: "setting_up";
|
|
176
|
+
};
|
|
177
|
+
export type InstanceBootPhaseEnum = typeof InstanceBootPhaseEnum[keyof typeof InstanceBootPhaseEnum];
|
|
156
178
|
/**
|
|
157
179
|
* Check if a given object implements the Instance interface.
|
|
158
180
|
*/
|
package/dist/models/Instance.js
CHANGED
|
@@ -13,13 +13,14 @@
|
|
|
13
13
|
* Do not edit the class manually.
|
|
14
14
|
*/
|
|
15
15
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
16
|
-
exports.InstanceTierEnum = exports.InstanceStatusEnum = void 0;
|
|
16
|
+
exports.InstanceBootPhaseEnum = exports.InstanceTierEnum = exports.InstanceStatusEnum = void 0;
|
|
17
17
|
exports.instanceOfInstance = instanceOfInstance;
|
|
18
18
|
exports.InstanceFromJSON = InstanceFromJSON;
|
|
19
19
|
exports.InstanceFromJSONTyped = InstanceFromJSONTyped;
|
|
20
20
|
exports.InstanceToJSON = InstanceToJSON;
|
|
21
21
|
exports.InstanceToJSONTyped = InstanceToJSONTyped;
|
|
22
22
|
const InstanceConnection_1 = require("./InstanceConnection");
|
|
23
|
+
const InstanceGpuMemory_1 = require("./InstanceGpuMemory");
|
|
23
24
|
/**
|
|
24
25
|
* @export
|
|
25
26
|
*/
|
|
@@ -40,6 +41,14 @@ exports.InstanceTierEnum = {
|
|
|
40
41
|
Spot: 'spot',
|
|
41
42
|
OnDemand: 'on_demand'
|
|
42
43
|
};
|
|
44
|
+
/**
|
|
45
|
+
* @export
|
|
46
|
+
*/
|
|
47
|
+
exports.InstanceBootPhaseEnum = {
|
|
48
|
+
MachineRequested: 'machine_requested',
|
|
49
|
+
PullingImage: 'pulling_image',
|
|
50
|
+
SettingUp: 'setting_up'
|
|
51
|
+
};
|
|
43
52
|
/**
|
|
44
53
|
* Check if a given object implements the Instance interface.
|
|
45
54
|
*/
|
|
@@ -78,6 +87,7 @@ function InstanceFromJSONTyped(json, ignoreDiscriminator) {
|
|
|
78
87
|
'region': json['region'],
|
|
79
88
|
'tier': json['tier'],
|
|
80
89
|
'pricePerHour': json['price_per_hour'],
|
|
90
|
+
'gpuMemory': json['gpu_memory'] == null ? undefined : (0, InstanceGpuMemory_1.InstanceGpuMemoryFromJSON)(json['gpu_memory']),
|
|
81
91
|
'connection': json['connection'] == null ? undefined : (0, InstanceConnection_1.InstanceConnectionFromJSON)(json['connection']),
|
|
82
92
|
'diskGb': json['disk_gb'] == null ? undefined : json['disk_gb'],
|
|
83
93
|
'image': json['image'] == null ? undefined : json['image'],
|
|
@@ -89,6 +99,7 @@ function InstanceFromJSONTyped(json, ignoreDiscriminator) {
|
|
|
89
99
|
'terminatedAt': json['terminated_at'] == null ? undefined : (new Date(json['terminated_at'])),
|
|
90
100
|
'lastReachableAt': json['last_reachable_at'] == null ? undefined : (new Date(json['last_reachable_at'])),
|
|
91
101
|
'unreachableSince': json['unreachable_since'] == null ? undefined : (new Date(json['unreachable_since'])),
|
|
102
|
+
'bootPhase': json['boot_phase'] == null ? undefined : json['boot_phase'],
|
|
92
103
|
};
|
|
93
104
|
}
|
|
94
105
|
function InstanceToJSON(json) {
|
|
@@ -107,6 +118,7 @@ function InstanceToJSONTyped(value, ignoreDiscriminator = false) {
|
|
|
107
118
|
'region': value['region'],
|
|
108
119
|
'tier': value['tier'],
|
|
109
120
|
'price_per_hour': value['pricePerHour'],
|
|
121
|
+
'gpu_memory': (0, InstanceGpuMemory_1.InstanceGpuMemoryToJSON)(value['gpuMemory']),
|
|
110
122
|
'connection': (0, InstanceConnection_1.InstanceConnectionToJSON)(value['connection']),
|
|
111
123
|
'disk_gb': value['diskGb'],
|
|
112
124
|
'image': value['image'],
|
|
@@ -118,5 +130,6 @@ function InstanceToJSONTyped(value, ignoreDiscriminator = false) {
|
|
|
118
130
|
'terminated_at': value['terminatedAt'] == null ? value['terminatedAt'] : value['terminatedAt'].toISOString(),
|
|
119
131
|
'last_reachable_at': value['lastReachableAt'] == null ? value['lastReachableAt'] : value['lastReachableAt'].toISOString(),
|
|
120
132
|
'unreachable_since': value['unreachableSince'] == null ? value['unreachableSince'] : value['unreachableSince'].toISOString(),
|
|
133
|
+
'boot_phase': value['bootPhase'],
|
|
121
134
|
};
|
|
122
135
|
}
|
|
@@ -0,0 +1,51 @@
|
|
|
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 highest GPU memory use seen on an instance since launch, from the telemetry every instance reports about every two minutes. On an instance with several GPUs it is the busiest GPU. Absent on an instance until its first sample arrives.
|
|
14
|
+
*
|
|
15
|
+
* @export
|
|
16
|
+
* @interface InstanceGpuMemory
|
|
17
|
+
*/
|
|
18
|
+
export interface InstanceGpuMemory {
|
|
19
|
+
/**
|
|
20
|
+
* Highest memory in use on the GPU, in MiB.
|
|
21
|
+
* @type {number}
|
|
22
|
+
* @memberof InstanceGpuMemory
|
|
23
|
+
*/
|
|
24
|
+
peakUsedMb: number;
|
|
25
|
+
/**
|
|
26
|
+
* The GPU's total memory, in MiB.
|
|
27
|
+
* @type {number}
|
|
28
|
+
* @memberof InstanceGpuMemory
|
|
29
|
+
*/
|
|
30
|
+
totalMb: number;
|
|
31
|
+
/**
|
|
32
|
+
* How many telemetry samples the peak is taken from.
|
|
33
|
+
* @type {number}
|
|
34
|
+
* @memberof InstanceGpuMemory
|
|
35
|
+
*/
|
|
36
|
+
samples: number;
|
|
37
|
+
/**
|
|
38
|
+
*
|
|
39
|
+
* @type {Date}
|
|
40
|
+
* @memberof InstanceGpuMemory
|
|
41
|
+
*/
|
|
42
|
+
lastSampleAt: Date;
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Check if a given object implements the InstanceGpuMemory interface.
|
|
46
|
+
*/
|
|
47
|
+
export declare function instanceOfInstanceGpuMemory(value: object): value is InstanceGpuMemory;
|
|
48
|
+
export declare function InstanceGpuMemoryFromJSON(json: any): InstanceGpuMemory;
|
|
49
|
+
export declare function InstanceGpuMemoryFromJSONTyped(json: any, ignoreDiscriminator: boolean): InstanceGpuMemory;
|
|
50
|
+
export declare function InstanceGpuMemoryToJSON(json: any): InstanceGpuMemory;
|
|
51
|
+
export declare function InstanceGpuMemoryToJSONTyped(value?: InstanceGpuMemory | null, ignoreDiscriminator?: boolean): any;
|
|
@@ -0,0 +1,62 @@
|
|
|
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.instanceOfInstanceGpuMemory = instanceOfInstanceGpuMemory;
|
|
17
|
+
exports.InstanceGpuMemoryFromJSON = InstanceGpuMemoryFromJSON;
|
|
18
|
+
exports.InstanceGpuMemoryFromJSONTyped = InstanceGpuMemoryFromJSONTyped;
|
|
19
|
+
exports.InstanceGpuMemoryToJSON = InstanceGpuMemoryToJSON;
|
|
20
|
+
exports.InstanceGpuMemoryToJSONTyped = InstanceGpuMemoryToJSONTyped;
|
|
21
|
+
/**
|
|
22
|
+
* Check if a given object implements the InstanceGpuMemory interface.
|
|
23
|
+
*/
|
|
24
|
+
function instanceOfInstanceGpuMemory(value) {
|
|
25
|
+
if ((!('peakUsedMb' in value) && !('peak_used_mb' in value)) || (value['peakUsedMb'] === undefined && value['peak_used_mb'] === undefined))
|
|
26
|
+
return false;
|
|
27
|
+
if ((!('totalMb' in value) && !('total_mb' in value)) || (value['totalMb'] === undefined && value['total_mb'] === undefined))
|
|
28
|
+
return false;
|
|
29
|
+
if (!('samples' in value) || value['samples'] === undefined)
|
|
30
|
+
return false;
|
|
31
|
+
if ((!('lastSampleAt' in value) && !('last_sample_at' in value)) || (value['lastSampleAt'] === undefined && value['last_sample_at'] === undefined))
|
|
32
|
+
return false;
|
|
33
|
+
return true;
|
|
34
|
+
}
|
|
35
|
+
function InstanceGpuMemoryFromJSON(json) {
|
|
36
|
+
return InstanceGpuMemoryFromJSONTyped(json, false);
|
|
37
|
+
}
|
|
38
|
+
function InstanceGpuMemoryFromJSONTyped(json, ignoreDiscriminator) {
|
|
39
|
+
if (json == null) {
|
|
40
|
+
return json;
|
|
41
|
+
}
|
|
42
|
+
return {
|
|
43
|
+
'peakUsedMb': json['peak_used_mb'],
|
|
44
|
+
'totalMb': json['total_mb'],
|
|
45
|
+
'samples': json['samples'],
|
|
46
|
+
'lastSampleAt': (new Date(json['last_sample_at'])),
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
function InstanceGpuMemoryToJSON(json) {
|
|
50
|
+
return InstanceGpuMemoryToJSONTyped(json, false);
|
|
51
|
+
}
|
|
52
|
+
function InstanceGpuMemoryToJSONTyped(value, ignoreDiscriminator = false) {
|
|
53
|
+
if (value == null) {
|
|
54
|
+
return value;
|
|
55
|
+
}
|
|
56
|
+
return {
|
|
57
|
+
'peak_used_mb': value['peakUsedMb'],
|
|
58
|
+
'total_mb': value['totalMb'],
|
|
59
|
+
'samples': value['samples'],
|
|
60
|
+
'last_sample_at': value['lastSampleAt'].toISOString(),
|
|
61
|
+
};
|
|
62
|
+
}
|
package/dist/models/index.d.ts
CHANGED
|
@@ -53,6 +53,9 @@ export * from './FunctionVersion';
|
|
|
53
53
|
export * from './GPUType';
|
|
54
54
|
export * from './GPUTypePage';
|
|
55
55
|
export * from './GetHealth200Response';
|
|
56
|
+
export * from './GpuSuggestion';
|
|
57
|
+
export * from './GpuSuggestionCheaper';
|
|
58
|
+
export * from './GpuSuggestionGpu';
|
|
56
59
|
export * from './ImagesGenerationsRequest';
|
|
57
60
|
export * from './ImagesResponse';
|
|
58
61
|
export * from './ImagesResponseDataInner';
|
|
@@ -60,6 +63,7 @@ export * from './ImagesResponseUsage';
|
|
|
60
63
|
export * from './IncludeItem';
|
|
61
64
|
export * from './Instance';
|
|
62
65
|
export * from './InstanceConnection';
|
|
66
|
+
export * from './InstanceGpuMemory';
|
|
63
67
|
export * from './InstancePage';
|
|
64
68
|
export * from './Invoice';
|
|
65
69
|
export * from './InvoiceList';
|
package/dist/models/index.js
CHANGED
|
@@ -71,6 +71,9 @@ __exportStar(require("./FunctionVersion"), exports);
|
|
|
71
71
|
__exportStar(require("./GPUType"), exports);
|
|
72
72
|
__exportStar(require("./GPUTypePage"), exports);
|
|
73
73
|
__exportStar(require("./GetHealth200Response"), exports);
|
|
74
|
+
__exportStar(require("./GpuSuggestion"), exports);
|
|
75
|
+
__exportStar(require("./GpuSuggestionCheaper"), exports);
|
|
76
|
+
__exportStar(require("./GpuSuggestionGpu"), exports);
|
|
74
77
|
__exportStar(require("./ImagesGenerationsRequest"), exports);
|
|
75
78
|
__exportStar(require("./ImagesResponse"), exports);
|
|
76
79
|
__exportStar(require("./ImagesResponseDataInner"), exports);
|
|
@@ -78,6 +81,7 @@ __exportStar(require("./ImagesResponseUsage"), exports);
|
|
|
78
81
|
__exportStar(require("./IncludeItem"), exports);
|
|
79
82
|
__exportStar(require("./Instance"), exports);
|
|
80
83
|
__exportStar(require("./InstanceConnection"), exports);
|
|
84
|
+
__exportStar(require("./InstanceGpuMemory"), exports);
|
|
81
85
|
__exportStar(require("./InstancePage"), exports);
|
|
82
86
|
__exportStar(require("./Invoice"), exports);
|
|
83
87
|
__exportStar(require("./InvoiceList"), exports);
|
package/dist/runtime.js
CHANGED
|
@@ -69,7 +69,7 @@ class Configuration {
|
|
|
69
69
|
return undefined;
|
|
70
70
|
}
|
|
71
71
|
get headers() {
|
|
72
|
-
return Object.assign({ 'User-Agent': 'gpuai-sdk-ts/0.4.
|
|
72
|
+
return Object.assign({ 'User-Agent': 'gpuai-sdk-ts/0.4.2' }, this.configuration.headers);
|
|
73
73
|
}
|
|
74
74
|
get credentials() {
|
|
75
75
|
return this.configuration.credentials;
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
|
|
2
|
+
# GpuSuggestion
|
|
3
|
+
|
|
4
|
+
Whether a lower-priced GPU model would have fit an instance\'s observed peak GPU memory. It names GPU models and prices only.
|
|
5
|
+
|
|
6
|
+
## Properties
|
|
7
|
+
|
|
8
|
+
Name | Type
|
|
9
|
+
------------ | -------------
|
|
10
|
+
`status` | string
|
|
11
|
+
`peakUsedMb` | number
|
|
12
|
+
`requiredMb` | number
|
|
13
|
+
`samples` | number
|
|
14
|
+
`observedMinutes` | number
|
|
15
|
+
`current` | [GpuSuggestionGpu](GpuSuggestionGpu.md)
|
|
16
|
+
`suggestion` | [GpuSuggestionCheaper](GpuSuggestionCheaper.md)
|
|
17
|
+
|
|
18
|
+
## Example
|
|
19
|
+
|
|
20
|
+
```typescript
|
|
21
|
+
import type { GpuSuggestion } from '@gpuai/sdk'
|
|
22
|
+
|
|
23
|
+
// TODO: Update the object below with actual values
|
|
24
|
+
const example = {
|
|
25
|
+
"status": null,
|
|
26
|
+
"peakUsedMb": null,
|
|
27
|
+
"requiredMb": null,
|
|
28
|
+
"samples": null,
|
|
29
|
+
"observedMinutes": null,
|
|
30
|
+
"current": null,
|
|
31
|
+
"suggestion": null,
|
|
32
|
+
} satisfies GpuSuggestion
|
|
33
|
+
|
|
34
|
+
console.log(example)
|
|
35
|
+
|
|
36
|
+
// Convert the instance to a JSON string
|
|
37
|
+
const exampleJSON: string = JSON.stringify(example)
|
|
38
|
+
console.log(exampleJSON)
|
|
39
|
+
|
|
40
|
+
// Parse the JSON string back to an object
|
|
41
|
+
const exampleParsed = JSON.parse(exampleJSON) as GpuSuggestion
|
|
42
|
+
console.log(exampleParsed)
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
46
|
+
|
|
47
|
+
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
|
|
2
|
+
# GpuSuggestionCheaper
|
|
3
|
+
|
|
4
|
+
The suggested GPU model and what it would save.
|
|
5
|
+
|
|
6
|
+
## Properties
|
|
7
|
+
|
|
8
|
+
Name | Type
|
|
9
|
+
------------ | -------------
|
|
10
|
+
`gpuType` | string
|
|
11
|
+
`gpuName` | string
|
|
12
|
+
`vramGb` | number
|
|
13
|
+
`pricePerHour` | number
|
|
14
|
+
`savingPerHour` | number
|
|
15
|
+
`savingPct` | number
|
|
16
|
+
|
|
17
|
+
## Example
|
|
18
|
+
|
|
19
|
+
```typescript
|
|
20
|
+
import type { GpuSuggestionCheaper } from '@gpuai/sdk'
|
|
21
|
+
|
|
22
|
+
// TODO: Update the object below with actual values
|
|
23
|
+
const example = {
|
|
24
|
+
"gpuType": null,
|
|
25
|
+
"gpuName": null,
|
|
26
|
+
"vramGb": null,
|
|
27
|
+
"pricePerHour": null,
|
|
28
|
+
"savingPerHour": null,
|
|
29
|
+
"savingPct": null,
|
|
30
|
+
} satisfies GpuSuggestionCheaper
|
|
31
|
+
|
|
32
|
+
console.log(example)
|
|
33
|
+
|
|
34
|
+
// Convert the instance to a JSON string
|
|
35
|
+
const exampleJSON: string = JSON.stringify(example)
|
|
36
|
+
console.log(exampleJSON)
|
|
37
|
+
|
|
38
|
+
// Parse the JSON string back to an object
|
|
39
|
+
const exampleParsed = JSON.parse(exampleJSON) as GpuSuggestionCheaper
|
|
40
|
+
console.log(exampleParsed)
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
44
|
+
|
|
45
|
+
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
|
|
2
|
+
# GpuSuggestionGpu
|
|
3
|
+
|
|
4
|
+
A GPU model at an hourly price.
|
|
5
|
+
|
|
6
|
+
## Properties
|
|
7
|
+
|
|
8
|
+
Name | Type
|
|
9
|
+
------------ | -------------
|
|
10
|
+
`gpuType` | string
|
|
11
|
+
`gpuName` | string
|
|
12
|
+
`vramGb` | number
|
|
13
|
+
`pricePerHour` | number
|
|
14
|
+
|
|
15
|
+
## Example
|
|
16
|
+
|
|
17
|
+
```typescript
|
|
18
|
+
import type { GpuSuggestionGpu } from '@gpuai/sdk'
|
|
19
|
+
|
|
20
|
+
// TODO: Update the object below with actual values
|
|
21
|
+
const example = {
|
|
22
|
+
"gpuType": null,
|
|
23
|
+
"gpuName": null,
|
|
24
|
+
"vramGb": null,
|
|
25
|
+
"pricePerHour": null,
|
|
26
|
+
} satisfies GpuSuggestionGpu
|
|
27
|
+
|
|
28
|
+
console.log(example)
|
|
29
|
+
|
|
30
|
+
// Convert the instance to a JSON string
|
|
31
|
+
const exampleJSON: string = JSON.stringify(example)
|
|
32
|
+
console.log(exampleJSON)
|
|
33
|
+
|
|
34
|
+
// Parse the JSON string back to an object
|
|
35
|
+
const exampleParsed = JSON.parse(exampleJSON) as GpuSuggestionGpu
|
|
36
|
+
console.log(exampleParsed)
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
40
|
+
|
|
41
|
+
|
package/docs/Instance.md
CHANGED
|
@@ -14,6 +14,7 @@ Name | Type
|
|
|
14
14
|
`region` | string
|
|
15
15
|
`tier` | string
|
|
16
16
|
`pricePerHour` | number
|
|
17
|
+
`gpuMemory` | [InstanceGpuMemory](InstanceGpuMemory.md)
|
|
17
18
|
`connection` | [InstanceConnection](InstanceConnection.md)
|
|
18
19
|
`diskGb` | number
|
|
19
20
|
`image` | string
|
|
@@ -25,6 +26,7 @@ Name | Type
|
|
|
25
26
|
`terminatedAt` | Date
|
|
26
27
|
`lastReachableAt` | Date
|
|
27
28
|
`unreachableSince` | Date
|
|
29
|
+
`bootPhase` | string
|
|
28
30
|
|
|
29
31
|
## Example
|
|
30
32
|
|
|
@@ -41,6 +43,7 @@ const example = {
|
|
|
41
43
|
"region": null,
|
|
42
44
|
"tier": null,
|
|
43
45
|
"pricePerHour": null,
|
|
46
|
+
"gpuMemory": null,
|
|
44
47
|
"connection": null,
|
|
45
48
|
"diskGb": null,
|
|
46
49
|
"image": null,
|
|
@@ -52,6 +55,7 @@ const example = {
|
|
|
52
55
|
"terminatedAt": null,
|
|
53
56
|
"lastReachableAt": null,
|
|
54
57
|
"unreachableSince": null,
|
|
58
|
+
"bootPhase": null,
|
|
55
59
|
} satisfies Instance
|
|
56
60
|
|
|
57
61
|
console.log(example)
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
|
|
2
|
+
# InstanceGpuMemory
|
|
3
|
+
|
|
4
|
+
The highest GPU memory use seen on an instance since launch, from the telemetry every instance reports about every two minutes. On an instance with several GPUs it is the busiest GPU. Absent on an instance until its first sample arrives.
|
|
5
|
+
|
|
6
|
+
## Properties
|
|
7
|
+
|
|
8
|
+
Name | Type
|
|
9
|
+
------------ | -------------
|
|
10
|
+
`peakUsedMb` | number
|
|
11
|
+
`totalMb` | number
|
|
12
|
+
`samples` | number
|
|
13
|
+
`lastSampleAt` | Date
|
|
14
|
+
|
|
15
|
+
## Example
|
|
16
|
+
|
|
17
|
+
```typescript
|
|
18
|
+
import type { InstanceGpuMemory } from '@gpuai/sdk'
|
|
19
|
+
|
|
20
|
+
// TODO: Update the object below with actual values
|
|
21
|
+
const example = {
|
|
22
|
+
"peakUsedMb": null,
|
|
23
|
+
"totalMb": null,
|
|
24
|
+
"samples": null,
|
|
25
|
+
"lastSampleAt": null,
|
|
26
|
+
} satisfies InstanceGpuMemory
|
|
27
|
+
|
|
28
|
+
console.log(example)
|
|
29
|
+
|
|
30
|
+
// Convert the instance to a JSON string
|
|
31
|
+
const exampleJSON: string = JSON.stringify(example)
|
|
32
|
+
console.log(exampleJSON)
|
|
33
|
+
|
|
34
|
+
// Parse the JSON string back to an object
|
|
35
|
+
const exampleParsed = JSON.parse(exampleJSON) as InstanceGpuMemory
|
|
36
|
+
console.log(exampleParsed)
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
40
|
+
|
|
41
|
+
|
package/docs/InstancesApi.md
CHANGED
|
@@ -7,6 +7,7 @@ All URIs are relative to *https://api.gpu.ai/v1*
|
|
|
7
7
|
| [**createInstance**](InstancesApi.md#createinstanceoperation) | **POST** /instances | Create an instance (async — returns 202 + Operation-Id header) |
|
|
8
8
|
| [**deleteInstance**](InstancesApi.md#deleteinstance) | **DELETE** /instances/{id} | Terminate an instance (idempotent) |
|
|
9
9
|
| [**getInstance**](InstancesApi.md#getinstance) | **GET** /instances/{id} | Get an instance |
|
|
10
|
+
| [**getInstanceGpuSuggestion**](InstancesApi.md#getinstancegpusuggestion) | **GET** /instances/{id}/gpu-suggestion | Suggest a lower-priced GPU for an instance |
|
|
10
11
|
| [**listInstances**](InstancesApi.md#listinstances) | **GET** /instances | List instances |
|
|
11
12
|
| [**updateInstance**](InstancesApi.md#updateinstanceoperation) | **PATCH** /instances/{id} | Update an instance (rename only in v1) |
|
|
12
13
|
|
|
@@ -238,6 +239,80 @@ example().catch(console.error);
|
|
|
238
239
|
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
239
240
|
|
|
240
241
|
|
|
242
|
+
## getInstanceGpuSuggestion
|
|
243
|
+
|
|
244
|
+
> GpuSuggestion getInstanceGpuSuggestion(id)
|
|
245
|
+
|
|
246
|
+
Suggest a lower-priced GPU for an instance
|
|
247
|
+
|
|
248
|
+
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.
|
|
249
|
+
|
|
250
|
+
### Example
|
|
251
|
+
|
|
252
|
+
```ts
|
|
253
|
+
import {
|
|
254
|
+
Configuration,
|
|
255
|
+
InstancesApi,
|
|
256
|
+
} from '@gpuai/sdk';
|
|
257
|
+
import type { GetInstanceGpuSuggestionRequest } from '@gpuai/sdk';
|
|
258
|
+
|
|
259
|
+
async function example() {
|
|
260
|
+
console.log("🚀 Testing @gpuai/sdk SDK...");
|
|
261
|
+
const config = new Configuration({
|
|
262
|
+
// Configure HTTP bearer authorization: bearerAuth
|
|
263
|
+
accessToken: "YOUR BEARER TOKEN",
|
|
264
|
+
});
|
|
265
|
+
const api = new InstancesApi(config);
|
|
266
|
+
|
|
267
|
+
const body = {
|
|
268
|
+
// string
|
|
269
|
+
id: id_example,
|
|
270
|
+
} satisfies GetInstanceGpuSuggestionRequest;
|
|
271
|
+
|
|
272
|
+
try {
|
|
273
|
+
const data = await api.getInstanceGpuSuggestion(body);
|
|
274
|
+
console.log(data);
|
|
275
|
+
} catch (error) {
|
|
276
|
+
console.error(error);
|
|
277
|
+
}
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
// Run the test
|
|
281
|
+
example().catch(console.error);
|
|
282
|
+
```
|
|
283
|
+
|
|
284
|
+
### Parameters
|
|
285
|
+
|
|
286
|
+
|
|
287
|
+
| Name | Type | Description | Notes |
|
|
288
|
+
|------------- | ------------- | ------------- | -------------|
|
|
289
|
+
| **id** | `string` | | [Defaults to `undefined`] |
|
|
290
|
+
|
|
291
|
+
### Return type
|
|
292
|
+
|
|
293
|
+
[**GpuSuggestion**](GpuSuggestion.md)
|
|
294
|
+
|
|
295
|
+
### Authorization
|
|
296
|
+
|
|
297
|
+
[bearerAuth](../README.md#bearerAuth)
|
|
298
|
+
|
|
299
|
+
### HTTP request headers
|
|
300
|
+
|
|
301
|
+
- **Content-Type**: Not defined
|
|
302
|
+
- **Accept**: `application/json`, `application/problem+json`
|
|
303
|
+
|
|
304
|
+
|
|
305
|
+
### HTTP response details
|
|
306
|
+
| Status code | Description | Response headers |
|
|
307
|
+
|-------------|-------------|------------------|
|
|
308
|
+
| **200** | OK | - |
|
|
309
|
+
| **404** | The instance does not exist or is not owned by the caller\'s organization. | - |
|
|
310
|
+
| **429** | Rate limit exceeded (RFC 7807). Retry-After header indicates seconds to wait. | * Retry-After - Seconds the client should wait before retrying. <br> |
|
|
311
|
+
| **0** | Error response (RFC 7807) | - |
|
|
312
|
+
|
|
313
|
+
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
314
|
+
|
|
315
|
+
|
|
241
316
|
## listInstances
|
|
242
317
|
|
|
243
318
|
> InstancePage listInstances(cursor, limit, status)
|