runbios-sdk 0.2.1-dev.100 → 0.2.1-dev.104
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/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/resources/datasets.d.ts +8 -4
- package/dist/resources/datasets.js +11 -4
- package/dist/resources/training.d.ts +11 -7
- package/dist/resources/training.js +13 -9
- package/dist/types.d.ts +4 -2
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -34,7 +34,7 @@ import { Inference } from './resources/inference.js';
|
|
|
34
34
|
* SDK version. Sent as part of the User-Agent header.
|
|
35
35
|
* Must match package.json "version" -- enforced by a contract test.
|
|
36
36
|
*/
|
|
37
|
-
export declare const VERSION = "0.2.1-dev.
|
|
37
|
+
export declare const VERSION = "0.2.1-dev.104";
|
|
38
38
|
export declare class RunBiOS {
|
|
39
39
|
/** Search models, fetch configs, check adapter compatibility. */
|
|
40
40
|
readonly models: Models;
|
package/dist/index.js
CHANGED
|
@@ -34,7 +34,7 @@ import { Inference } from './resources/inference.js';
|
|
|
34
34
|
* SDK version. Sent as part of the User-Agent header.
|
|
35
35
|
* Must match package.json "version" -- enforced by a contract test.
|
|
36
36
|
*/
|
|
37
|
-
export const VERSION = '0.2.1-dev.
|
|
37
|
+
export const VERSION = '0.2.1-dev.104';
|
|
38
38
|
export class RunBiOS {
|
|
39
39
|
/** Search models, fetch configs, check adapter compatibility. */
|
|
40
40
|
models;
|
|
@@ -84,10 +84,14 @@ export declare class Datasets {
|
|
|
84
84
|
*
|
|
85
85
|
* @example
|
|
86
86
|
* ```ts
|
|
87
|
+
* The selected split must already expose canonical rows: a `messages` array
|
|
88
|
+
* for SFT or a `text` field for CPT. Legacy layouts are rejected with
|
|
89
|
+
* conversion guidance rather than remapped silently.
|
|
90
|
+
*
|
|
87
91
|
* const imported = await client.datasets.importFromHuggingFace({
|
|
88
|
-
* repoId: '
|
|
92
|
+
* repoId: 'your-org/dataset-with-messages',
|
|
89
93
|
* integrationId: 'int_abc123',
|
|
90
|
-
* name: '
|
|
94
|
+
* name: 'Canonical SFT data',
|
|
91
95
|
* });
|
|
92
96
|
* console.log(`Imported: ${imported.id}`);
|
|
93
97
|
* ```
|
|
@@ -99,8 +103,8 @@ export declare class Datasets {
|
|
|
99
103
|
* @example
|
|
100
104
|
* ```ts
|
|
101
105
|
* const ds = await client.datasets.registerHuggingFace({
|
|
102
|
-
* repo_id: '
|
|
103
|
-
* name: '
|
|
106
|
+
* repo_id: 'your-org/dataset-with-text',
|
|
107
|
+
* name: 'Canonical CPT corpus',
|
|
104
108
|
* split: 'train',
|
|
105
109
|
* });
|
|
106
110
|
* ```
|
|
@@ -114,6 +114,9 @@ export class Datasets {
|
|
|
114
114
|
const message = err instanceof Error ? err.message : String(err);
|
|
115
115
|
throw new Error(`Failed to read file at "${params.filePath}": ${message}`);
|
|
116
116
|
}
|
|
117
|
+
if (!fileName.toLowerCase().endsWith('.jsonl')) {
|
|
118
|
+
throw new Error('RunBiOS: dataset uploads accept .jsonl only — one JSON object per line, with "messages" for SFT or "text" for CPT');
|
|
119
|
+
}
|
|
117
120
|
const blob = new Blob([fileData]);
|
|
118
121
|
const formData = new FormData();
|
|
119
122
|
formData.append('file', blob, fileName);
|
|
@@ -181,10 +184,14 @@ export class Datasets {
|
|
|
181
184
|
*
|
|
182
185
|
* @example
|
|
183
186
|
* ```ts
|
|
187
|
+
* The selected split must already expose canonical rows: a `messages` array
|
|
188
|
+
* for SFT or a `text` field for CPT. Legacy layouts are rejected with
|
|
189
|
+
* conversion guidance rather than remapped silently.
|
|
190
|
+
*
|
|
184
191
|
* const imported = await client.datasets.importFromHuggingFace({
|
|
185
|
-
* repoId: '
|
|
192
|
+
* repoId: 'your-org/dataset-with-messages',
|
|
186
193
|
* integrationId: 'int_abc123',
|
|
187
|
-
* name: '
|
|
194
|
+
* name: 'Canonical SFT data',
|
|
188
195
|
* });
|
|
189
196
|
* console.log(`Imported: ${imported.id}`);
|
|
190
197
|
* ```
|
|
@@ -210,8 +217,8 @@ export class Datasets {
|
|
|
210
217
|
* @example
|
|
211
218
|
* ```ts
|
|
212
219
|
* const ds = await client.datasets.registerHuggingFace({
|
|
213
|
-
* repo_id: '
|
|
214
|
-
* name: '
|
|
220
|
+
* repo_id: 'your-org/dataset-with-text',
|
|
221
|
+
* name: 'Canonical CPT corpus',
|
|
215
222
|
* split: 'train',
|
|
216
223
|
* });
|
|
217
224
|
* ```
|
|
@@ -12,8 +12,11 @@ export declare class Training {
|
|
|
12
12
|
/**
|
|
13
13
|
* Create a new training job (book-before-reveal).
|
|
14
14
|
*
|
|
15
|
-
*
|
|
16
|
-
*
|
|
15
|
+
* Choose method, adapter, datasets and the complete hyperparameter config
|
|
16
|
+
* first, call {@link preflight}, then choose one returned GPU configuration
|
|
17
|
+
* last. Its minimum is derived from every earlier choice. This call blocks
|
|
18
|
+
* while that placement is booked (~40s typical). A training id and the
|
|
19
|
+
* "training started" email exist only once a real machine is
|
|
17
20
|
* secured, so the returned `status` is one of:
|
|
18
21
|
*
|
|
19
22
|
* - `"booked"` — a GPU was secured (booked == secured); the job then
|
|
@@ -25,11 +28,12 @@ export declare class Training {
|
|
|
25
28
|
* (`queueIfUnavailable: true`); waits for stock at zero charge and books
|
|
26
29
|
* via the same path.
|
|
27
30
|
*
|
|
28
|
-
* If
|
|
29
|
-
*
|
|
30
|
-
*
|
|
31
|
-
*
|
|
32
|
-
*
|
|
31
|
+
* If booking fails, this rejects with `CAPACITY_UNAVAILABLE` (HTTP 409)
|
|
32
|
+
* carrying fresh qualifying alternatives — no phantom job and no charge.
|
|
33
|
+
* Keep every earlier field unchanged, select one alternative and retry. The
|
|
34
|
+
* rejected type is never recommended back. Queue consent is appropriate only
|
|
35
|
+
* when the alternatives list is empty; waiting is unbilled. The SDK never
|
|
36
|
+
* auto-substitutes a GPU; a transient 503 is a retry, never a capacity verdict.
|
|
33
37
|
*
|
|
34
38
|
* @example
|
|
35
39
|
* ```ts
|
|
@@ -67,8 +67,6 @@ function buildTrainingRequest(params) {
|
|
|
67
67
|
body.integration_id = params.integrationId;
|
|
68
68
|
if (params.networkVolumeId !== undefined)
|
|
69
69
|
body.network_volume_id = params.networkVolumeId;
|
|
70
|
-
if (params.cacheDataset !== undefined)
|
|
71
|
-
body.cache_dataset = params.cacheDataset;
|
|
72
70
|
if (params.datasetSampleLimits !== undefined)
|
|
73
71
|
body.dataset_sample_limits = params.datasetSampleLimits;
|
|
74
72
|
if (params.datasetMixing !== undefined)
|
|
@@ -78,6 +76,8 @@ function buildTrainingRequest(params) {
|
|
|
78
76
|
const config = {};
|
|
79
77
|
if (params.epochs !== undefined)
|
|
80
78
|
config.num_train_epochs = params.epochs;
|
|
79
|
+
if (params.maxSteps !== undefined)
|
|
80
|
+
config.max_steps = params.maxSteps;
|
|
81
81
|
if (params.batchSize !== undefined)
|
|
82
82
|
config.per_device_train_batch_size = params.batchSize;
|
|
83
83
|
if (params.gradientAccumulation !== undefined)
|
|
@@ -183,8 +183,11 @@ export class Training {
|
|
|
183
183
|
/**
|
|
184
184
|
* Create a new training job (book-before-reveal).
|
|
185
185
|
*
|
|
186
|
-
*
|
|
187
|
-
*
|
|
186
|
+
* Choose method, adapter, datasets and the complete hyperparameter config
|
|
187
|
+
* first, call {@link preflight}, then choose one returned GPU configuration
|
|
188
|
+
* last. Its minimum is derived from every earlier choice. This call blocks
|
|
189
|
+
* while that placement is booked (~40s typical). A training id and the
|
|
190
|
+
* "training started" email exist only once a real machine is
|
|
188
191
|
* secured, so the returned `status` is one of:
|
|
189
192
|
*
|
|
190
193
|
* - `"booked"` — a GPU was secured (booked == secured); the job then
|
|
@@ -196,11 +199,12 @@ export class Training {
|
|
|
196
199
|
* (`queueIfUnavailable: true`); waits for stock at zero charge and books
|
|
197
200
|
* via the same path.
|
|
198
201
|
*
|
|
199
|
-
* If
|
|
200
|
-
*
|
|
201
|
-
*
|
|
202
|
-
*
|
|
203
|
-
*
|
|
202
|
+
* If booking fails, this rejects with `CAPACITY_UNAVAILABLE` (HTTP 409)
|
|
203
|
+
* carrying fresh qualifying alternatives — no phantom job and no charge.
|
|
204
|
+
* Keep every earlier field unchanged, select one alternative and retry. The
|
|
205
|
+
* rejected type is never recommended back. Queue consent is appropriate only
|
|
206
|
+
* when the alternatives list is empty; waiting is unbilled. The SDK never
|
|
207
|
+
* auto-substitutes a GPU; a transient 503 is a retry, never a capacity verdict.
|
|
204
208
|
*
|
|
205
209
|
* @example
|
|
206
210
|
* ```ts
|
package/dist/types.d.ts
CHANGED
|
@@ -565,8 +565,10 @@ export interface TrainingCreateParams {
|
|
|
565
565
|
name?: string;
|
|
566
566
|
/** Target workspace ID. */
|
|
567
567
|
workspaceId?: string;
|
|
568
|
-
/** Number of training epochs. */
|
|
568
|
+
/** Number of training epochs. Governs the full run when maxSteps is omitted. */
|
|
569
569
|
epochs?: number;
|
|
570
|
+
/** Optional hard step cap that overrides epochs. Omit for no cap and all configured epochs. */
|
|
571
|
+
maxSteps?: number;
|
|
570
572
|
/** Training batch size per device. */
|
|
571
573
|
batchSize?: number;
|
|
572
574
|
/** Gradient accumulation steps. */
|
|
@@ -609,7 +611,7 @@ export interface TrainingCreateParams {
|
|
|
609
611
|
integrationId?: string;
|
|
610
612
|
/** Existing network volume to attach. */
|
|
611
613
|
networkVolumeId?: string;
|
|
612
|
-
/**
|
|
614
|
+
/** @deprecated No effect. Prepared data is transient; exact resume rebuilds it from pinned source metadata and verifies its checksum. */
|
|
613
615
|
cacheDataset?: boolean;
|
|
614
616
|
/** Legacy dataset ordering mode. Prefer mixing for weighted/phased plans. */
|
|
615
617
|
datasetMixing?: 'shuffle' | 'sequential' | 'interleave' | 'random' | 'curriculum';
|