runbios-sdk 0.2.5-rc.194 → 0.2.6-dev.196
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/README.md +15 -3
- package/dist/client.js +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/resources/datasets.d.ts +8 -0
- package/dist/resources/datasets.js +16 -0
- package/dist/resources/inference.js +1 -1
- package/dist/resources/training.js +4 -0
- package/dist/types.d.ts +6 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -248,6 +248,12 @@ const imported = await client.datasets.importFromHuggingFace({
|
|
|
248
248
|
|
|
249
249
|
// Validate before upload
|
|
250
250
|
const validation = await client.datasets.validate('./data.jsonl');
|
|
251
|
+
|
|
252
|
+
// Maintain an existing dataset explicitly
|
|
253
|
+
await client.datasets.updateColumnMapping('ds_abc123', { conversation: 'messages' });
|
|
254
|
+
await client.datasets.revalidate('ds_abc123');
|
|
255
|
+
await client.datasets.updateSource('ds_abc123'); // reference-mode Hub datasets only
|
|
256
|
+
await client.datasets.setIntegration('ds_abc123', 'int_replacement'); // null detaches
|
|
251
257
|
```
|
|
252
258
|
|
|
253
259
|
#### Connected Hub search and exact source selection
|
|
@@ -273,9 +279,14 @@ polling timeout does not cancel the background import.
|
|
|
273
279
|
|
|
274
280
|
### Training
|
|
275
281
|
|
|
276
|
-
`datasetIds` preserves source order.
|
|
277
|
-
and
|
|
278
|
-
|
|
282
|
+
`datasetIds` preserves source order. `evalDatasetIds` selects separate held-out
|
|
283
|
+
datasets and is mutually exclusive with `evalSplit`; evaluation datasets are
|
|
284
|
+
composed sequentially and are never optimization rows. Both sets are frozen at
|
|
285
|
+
job creation—launch a new job to change them; an active run cannot accept more
|
|
286
|
+
data. Pass the same `mixing`
|
|
287
|
+
object to preflight and create: `{ mode: 'interleave', weights: [3, 1], seed: 42 }`.
|
|
288
|
+
Weights match the ordered training IDs. Modes are `sequential`, `shuffle`,
|
|
289
|
+
`interleave`, and `phased`; phased
|
|
279
290
|
plans contain ordered `phases` with `name`, `portion`, optional `weights`, and
|
|
280
291
|
`shuffle`. The default composition seed is 42. Resume reconstructs data from
|
|
281
292
|
source pins and the stored plan and verifies the checksum.
|
|
@@ -285,6 +296,7 @@ const request = {
|
|
|
285
296
|
idempotencyKey: 'training-create-20260711-0001',
|
|
286
297
|
model: 'meta-llama/Llama-3.1-8B-Instruct',
|
|
287
298
|
datasetIds: ['ds_abc123', 'ds_def456'],
|
|
299
|
+
evalDatasetIds: ['ds_holdout'],
|
|
288
300
|
method: 'sft' as const,
|
|
289
301
|
adapter: 'lora' as const,
|
|
290
302
|
queueIfUnavailable: true,
|
package/dist/client.js
CHANGED
|
@@ -340,7 +340,7 @@ export class HttpClient {
|
|
|
340
340
|
constructor(config) {
|
|
341
341
|
// Default host stays api.runbios.ai for now; cutover to api.runbios.ai is
|
|
342
342
|
// planned once its DNS exists.
|
|
343
|
-
this.baseUrl = (config.baseUrl || envBaseUrl() || 'https://api-
|
|
343
|
+
this.baseUrl = (config.baseUrl || envBaseUrl() || 'https://api-dev.runbios.ai').replace(/\/+$/, '');
|
|
344
344
|
this.apiKey = config.apiKey ?? envApiKey();
|
|
345
345
|
this.accessToken = config.accessToken;
|
|
346
346
|
this.orgId = config.orgId;
|
package/dist/index.d.ts
CHANGED
|
@@ -36,7 +36,7 @@ import { Loop } from './resources/loop.js';
|
|
|
36
36
|
* SDK version. Sent as part of the User-Agent header.
|
|
37
37
|
* Must match package.json "version" -- enforced by a contract test.
|
|
38
38
|
*/
|
|
39
|
-
export declare const VERSION = "0.2.
|
|
39
|
+
export declare const VERSION = "0.2.6-dev.196";
|
|
40
40
|
export declare class RunBiOS {
|
|
41
41
|
/** Search models, fetch configs, check adapter compatibility. */
|
|
42
42
|
readonly models: Models;
|
package/dist/index.js
CHANGED
|
@@ -36,7 +36,7 @@ import { Loop } from './resources/loop.js';
|
|
|
36
36
|
* SDK version. Sent as part of the User-Agent header.
|
|
37
37
|
* Must match package.json "version" -- enforced by a contract test.
|
|
38
38
|
*/
|
|
39
|
-
export const VERSION = '0.2.
|
|
39
|
+
export const VERSION = '0.2.6-dev.196';
|
|
40
40
|
export class RunBiOS {
|
|
41
41
|
/** Search models, fetch configs, check adapter compatibility. */
|
|
42
42
|
models;
|
|
@@ -76,6 +76,14 @@ export declare class Datasets {
|
|
|
76
76
|
* ```
|
|
77
77
|
*/
|
|
78
78
|
delete(id: string): Promise<void>;
|
|
79
|
+
/** Replace the source mapping and immediately revalidate the dataset. */
|
|
80
|
+
updateColumnMapping(id: string, columnMapping: Record<string, string>): Promise<Record<string, unknown>>;
|
|
81
|
+
/** Revalidate an existing dataset against its pinned source. */
|
|
82
|
+
revalidate(id: string): Promise<Record<string, unknown>>;
|
|
83
|
+
/** Adopt a compatible newer revision of a reference-mode Hub dataset. */
|
|
84
|
+
updateSource(id: string): Promise<Record<string, unknown>>;
|
|
85
|
+
/** Attach another connected Hub integration, or detach it with null. */
|
|
86
|
+
setIntegration(id: string, integrationId: string | null): Promise<Record<string, unknown>>;
|
|
79
87
|
/**
|
|
80
88
|
* Import a dataset from HuggingFace Hub via a connected integration.
|
|
81
89
|
*
|
|
@@ -173,6 +173,22 @@ export class Datasets {
|
|
|
173
173
|
async delete(id) {
|
|
174
174
|
await this._http.fetchDelete(`/api/datasets/${encodeURIComponent(id)}`);
|
|
175
175
|
}
|
|
176
|
+
/** Replace the source mapping and immediately revalidate the dataset. */
|
|
177
|
+
async updateColumnMapping(id, columnMapping) {
|
|
178
|
+
return this._http.fetchPatch(`/api/datasets/${encodeURIComponent(id)}/column-mapping`, columnMapping);
|
|
179
|
+
}
|
|
180
|
+
/** Revalidate an existing dataset against its pinned source. */
|
|
181
|
+
async revalidate(id) {
|
|
182
|
+
return this._http.fetchPost(`/api/datasets/${encodeURIComponent(id)}/revalidate`, {});
|
|
183
|
+
}
|
|
184
|
+
/** Adopt a compatible newer revision of a reference-mode Hub dataset. */
|
|
185
|
+
async updateSource(id) {
|
|
186
|
+
return this._http.fetchPost(`/api/datasets/${encodeURIComponent(id)}/update-source`, {});
|
|
187
|
+
}
|
|
188
|
+
/** Attach another connected Hub integration, or detach it with null. */
|
|
189
|
+
async setIntegration(id, integrationId) {
|
|
190
|
+
return this._http.fetchPost(`/api/datasets/${encodeURIComponent(id)}/integration`, { integration_id: integrationId });
|
|
191
|
+
}
|
|
176
192
|
/**
|
|
177
193
|
* Import a dataset from HuggingFace Hub via a connected integration.
|
|
178
194
|
*
|
|
@@ -326,7 +326,7 @@ export class Inference {
|
|
|
326
326
|
this.key = config.inferenceKey || envInferenceKey() || envApiKey();
|
|
327
327
|
// Same default host as HttpClient (api.runbios.ai); api.runbios.ai cutover
|
|
328
328
|
// is planned once its DNS exists — update both call sites together.
|
|
329
|
-
this.baseUrl = (config.baseUrl || envBaseUrl() || 'https://api-
|
|
329
|
+
this.baseUrl = (config.baseUrl || envBaseUrl() || 'https://api-dev.runbios.ai').replace(/\/+$/, '');
|
|
330
330
|
this.timeout = config.timeout ?? 900_000;
|
|
331
331
|
this._http = http;
|
|
332
332
|
}
|
|
@@ -19,12 +19,15 @@ function buildTrainingRequest(params) {
|
|
|
19
19
|
if (datasetIds.length === 0) {
|
|
20
20
|
throw new Error('RunBiOS: datasetId or datasetIds must contain at least one dataset');
|
|
21
21
|
}
|
|
22
|
+
const evalDatasetIds = [...new Set((params.evalDatasetIds || []).map((id) => id.trim()).filter(Boolean))];
|
|
22
23
|
const body = {
|
|
23
24
|
model_id: params.model,
|
|
24
25
|
dataset_ids: datasetIds,
|
|
25
26
|
training_method: trainingMethod,
|
|
26
27
|
train_type: params.adapter,
|
|
27
28
|
};
|
|
29
|
+
if (evalDatasetIds.length > 0)
|
|
30
|
+
body.eval_dataset_ids = evalDatasetIds;
|
|
28
31
|
if (params.modelRevision !== undefined)
|
|
29
32
|
body.model_revision = params.modelRevision;
|
|
30
33
|
const queueEnabled = params.queueIfUnavailable ?? false;
|
|
@@ -238,6 +241,7 @@ export class Training {
|
|
|
238
241
|
training_method: trainingMethod,
|
|
239
242
|
train_type: params.adapter,
|
|
240
243
|
dataset_ids: datasetIds,
|
|
244
|
+
eval_dataset_ids: [...new Set((params.evalDatasetIds || []).map((id) => id.trim()).filter(Boolean))],
|
|
241
245
|
gpu_type: params.gpuType,
|
|
242
246
|
gpu_count: params.gpuCount,
|
|
243
247
|
status: 'pending',
|
package/dist/types.d.ts
CHANGED
|
@@ -8,13 +8,13 @@ export interface BiOSConfig {
|
|
|
8
8
|
orgId?: string;
|
|
9
9
|
/** Workspace ID. Optional when using API keys (resolved from the key). Can override for multi-workspace keys. */
|
|
10
10
|
workspaceId?: string;
|
|
11
|
-
/** Base URL for the API. Falls back to the RUNBIOS_BASE_URL environment variable (legacy: BIOS_BASE_URL), then the canonical https://api-
|
|
11
|
+
/** Base URL for the API. Falls back to the RUNBIOS_BASE_URL environment variable (legacy: BIOS_BASE_URL), then the canonical https://api-dev.runbios.ai hostname. */
|
|
12
12
|
baseUrl?: string;
|
|
13
13
|
/** Request timeout in milliseconds. Defaults to 30000. */
|
|
14
14
|
timeout?: number;
|
|
15
15
|
/** Default per-deployment inference key. Can be overridden per inference call. */
|
|
16
16
|
inferenceKey?: string;
|
|
17
|
-
/** Inference base URL. Defaults to baseUrl, then https://api-
|
|
17
|
+
/** Inference base URL. Defaults to baseUrl, then https://api-dev.runbios.ai. */
|
|
18
18
|
inferenceBaseUrl?: string;
|
|
19
19
|
/** End-to-end inference timeout in milliseconds. Defaults to 15 minutes. */
|
|
20
20
|
inferenceTimeout?: number;
|
|
@@ -555,6 +555,8 @@ export interface TrainingCreateParams {
|
|
|
555
555
|
datasetId?: string;
|
|
556
556
|
/** Ordered dataset IDs for multi-dataset training. */
|
|
557
557
|
datasetIds?: string[];
|
|
558
|
+
/** Separate evaluation datasets, composed sequentially. Mutually exclusive with evalSplit. */
|
|
559
|
+
evalDatasetIds?: string[];
|
|
558
560
|
/**
|
|
559
561
|
* Optional per-dataset row cap: keep only the first N rows of a dataset
|
|
560
562
|
* (key = a dataset ID from datasetIds, value = row count). Omit an entry, or
|
|
@@ -709,6 +711,7 @@ export interface TrainingJob {
|
|
|
709
711
|
train_type?: AdapterType;
|
|
710
712
|
rlhf_type?: RLHFAlgorithm | null;
|
|
711
713
|
dataset_ids?: string[];
|
|
714
|
+
eval_dataset_ids?: string[];
|
|
712
715
|
gpu_type?: string;
|
|
713
716
|
gpu_count?: number;
|
|
714
717
|
storage_gb?: number;
|
|
@@ -903,6 +906,7 @@ export interface CanonicalTrainingRequest {
|
|
|
903
906
|
name: string;
|
|
904
907
|
dataset_id: string;
|
|
905
908
|
dataset_ids: string[];
|
|
909
|
+
eval_dataset_ids?: string[];
|
|
906
910
|
hf_dataset_ids?: string;
|
|
907
911
|
dataset_mixing?: string;
|
|
908
912
|
mixing?: Record<string, unknown>;
|