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 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.100";
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.100';
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: 'databricks/dolly-15k',
92
+ * repoId: 'your-org/dataset-with-messages',
89
93
  * integrationId: 'int_abc123',
90
- * name: 'Dolly 15k',
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: 'databricks/dolly-15k',
103
- * name: 'Dolly 15k',
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: 'databricks/dolly-15k',
192
+ * repoId: 'your-org/dataset-with-messages',
186
193
  * integrationId: 'int_abc123',
187
- * name: 'Dolly 15k',
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: 'databricks/dolly-15k',
214
- * name: 'Dolly 15k',
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
- * The call blocks while the ranked GPU ladder is booked (~40s typical). A
16
- * training id and the "training started" email exist only once a real machine is
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 the ladder is exhausted at booking time without queue consent, this
29
- * rejects with a `CAPACITY_UNAVAILABLE` (HTTP 409) carrying neutral
30
- * alternatives — no phantom job remains and nothing is billed. The SDK never
31
- * auto-substitutes a GPU; a transient 503 is a retry, never a capacity
32
- * verdict.
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
- * The call blocks while the ranked GPU ladder is booked (~40s typical). A
187
- * training id and the "training started" email exist only once a real machine is
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 the ladder is exhausted at booking time without queue consent, this
200
- * rejects with a `CAPACITY_UNAVAILABLE` (HTTP 409) carrying neutral
201
- * alternatives — no phantom job remains and nothing is billed. The SDK never
202
- * auto-substitutes a GPU; a transient 503 is a retry, never a capacity
203
- * verdict.
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
- /** Cache the composed dataset for retry/resume. Defaults to true server-side. */
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';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "runbios-sdk",
3
- "version": "0.2.1-dev.100",
3
+ "version": "0.2.1-dev.104",
4
4
  "description": "Official TypeScript SDK for the Run BiOS training and deployment platform API",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",