runbios-sdk 0.2.1-dev.111 → 0.2.1-dev.113
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 +32 -2
- package/dist/index.d.ts +4 -1
- package/dist/index.js +5 -1
- package/dist/resources/datasets.js +4 -0
- package/dist/resources/integrations.d.ts +21 -0
- package/dist/resources/integrations.js +20 -0
- package/dist/resources/loop.d.ts +5 -1
- package/dist/resources/loop.js +5 -1
- package/dist/types.d.ts +5 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -239,17 +239,47 @@ const preview = await client.datasets.preview('ds_abc123', { pageSize: 5 });
|
|
|
239
239
|
|
|
240
240
|
// Import from HuggingFace
|
|
241
241
|
const imported = await client.datasets.importFromHuggingFace({
|
|
242
|
-
repoId: '
|
|
242
|
+
repoId: 'HuggingFaceH4/ultrachat_200k',
|
|
243
243
|
integrationId: 'int_abc123',
|
|
244
|
-
name: '
|
|
244
|
+
name: 'Ultrachat SFT',
|
|
245
|
+
subset: 'default',
|
|
246
|
+
split: 'train_sft',
|
|
245
247
|
});
|
|
246
248
|
|
|
247
249
|
// Validate before upload
|
|
248
250
|
const validation = await client.datasets.validate('./data.jsonl');
|
|
249
251
|
```
|
|
250
252
|
|
|
253
|
+
#### Connected Hub search and exact source selection
|
|
254
|
+
|
|
255
|
+
Use `client.integrations.list()` to discover connected accounts, then select the
|
|
256
|
+
returned ID explicitly. `client.integrations.browse(integrationId, { query,
|
|
257
|
+
page, limit })` searches with that account's access. Discovery returns account
|
|
258
|
+
metadata, never stored credentials.
|
|
259
|
+
|
|
260
|
+
Pass the same `integrationId` to `datasets.previewHub` and
|
|
261
|
+
`datasets.importFromHuggingFace`. Preview returns `available_configs` and
|
|
262
|
+
`available_splits`; choose the actual subset/split rather than assuming `train`.
|
|
263
|
+
A missing or unauthorized integration is an error, not anonymous fallback.
|
|
264
|
+
Public imports without an integration use `datasets.registerHuggingFace` and
|
|
265
|
+
require `workspaceId` on the client or method call.
|
|
266
|
+
|
|
267
|
+
Both import methods accept `revision`, `maxSamples`, `sampleStrategy` and
|
|
268
|
+
`importMode`. The service records immutable source metadata for resume. A Hub
|
|
269
|
+
preview does not prove readiness or preview an arbitrary older revision: inspect
|
|
270
|
+
the registered dataset when importing an explicit revision. Poll
|
|
271
|
+
`datasets.getStatus(id)` until `ready` before selecting it for training; a client
|
|
272
|
+
polling timeout does not cancel the background import.
|
|
273
|
+
|
|
251
274
|
### Training
|
|
252
275
|
|
|
276
|
+
`datasetIds` preserves source order. Pass the same `mixing` object to preflight
|
|
277
|
+
and create: `{ mode: 'interleave', weights: [3, 1], seed: 42 }`. Weights match the
|
|
278
|
+
ordered IDs. Modes are `sequential`, `shuffle`, `interleave`, and `phased`; phased
|
|
279
|
+
plans contain ordered `phases` with `name`, `portion`, optional `weights`, and
|
|
280
|
+
`shuffle`. The default composition seed is 42. Resume reconstructs data from
|
|
281
|
+
source pins and the stored plan and verifies the checksum.
|
|
282
|
+
|
|
253
283
|
```typescript
|
|
254
284
|
const request = {
|
|
255
285
|
idempotencyKey: 'training-create-20260711-0001',
|
package/dist/index.d.ts
CHANGED
|
@@ -26,6 +26,7 @@
|
|
|
26
26
|
import type { BiOSConfig, ApiKeyIntrospection } from './types.js';
|
|
27
27
|
import { Models } from './resources/models.js';
|
|
28
28
|
import { Datasets } from './resources/datasets.js';
|
|
29
|
+
import { Integrations } from './resources/integrations.js';
|
|
29
30
|
import { Training } from './resources/training.js';
|
|
30
31
|
import { Wallet } from './resources/wallet.js';
|
|
31
32
|
import { GPU } from './resources/gpu.js';
|
|
@@ -35,12 +36,13 @@ import { Loop } from './resources/loop.js';
|
|
|
35
36
|
* SDK version. Sent as part of the User-Agent header.
|
|
36
37
|
* Must match package.json "version" -- enforced by a contract test.
|
|
37
38
|
*/
|
|
38
|
-
export declare const VERSION = "0.2.1-dev.
|
|
39
|
+
export declare const VERSION = "0.2.1-dev.113";
|
|
39
40
|
export declare class RunBiOS {
|
|
40
41
|
/** Search models, fetch configs, check adapter compatibility. */
|
|
41
42
|
readonly models: Models;
|
|
42
43
|
/** Upload, import, preview, and manage training datasets. */
|
|
43
44
|
readonly datasets: Datasets;
|
|
45
|
+
readonly integrations: Integrations;
|
|
44
46
|
/** Create, monitor, stop, and resume fine-tuning jobs. */
|
|
45
47
|
readonly training: Training;
|
|
46
48
|
/** Check wallet balance. */
|
|
@@ -68,6 +70,7 @@ export { RunBiOS as BiOS };
|
|
|
68
70
|
export { ApiError, GpuRejectionError, CapacityUnavailableError, ComingSoonError, CAPACITY_UNAVAILABLE_CODE, COMING_SOON_CODES, PERMANENT_GPU_CODES, isPermanentGpuCode, gpuRejectionCodeForReason, } from './client.js';
|
|
69
71
|
export { Models } from './resources/models.js';
|
|
70
72
|
export { Datasets } from './resources/datasets.js';
|
|
73
|
+
export { Integrations, type HuggingFaceIntegration, type IntegrationBrowseParams } from './resources/integrations.js';
|
|
71
74
|
export { Training } from './resources/training.js';
|
|
72
75
|
export { Wallet } from './resources/wallet.js';
|
|
73
76
|
export { GPU, type GPURecommendation } from './resources/gpu.js';
|
package/dist/index.js
CHANGED
|
@@ -26,6 +26,7 @@
|
|
|
26
26
|
import { HttpClient, envInferenceKey } from './client.js';
|
|
27
27
|
import { Models } from './resources/models.js';
|
|
28
28
|
import { Datasets } from './resources/datasets.js';
|
|
29
|
+
import { Integrations } from './resources/integrations.js';
|
|
29
30
|
import { Training } from './resources/training.js';
|
|
30
31
|
import { Wallet } from './resources/wallet.js';
|
|
31
32
|
import { GPU } from './resources/gpu.js';
|
|
@@ -35,12 +36,13 @@ import { Loop } from './resources/loop.js';
|
|
|
35
36
|
* SDK version. Sent as part of the User-Agent header.
|
|
36
37
|
* Must match package.json "version" -- enforced by a contract test.
|
|
37
38
|
*/
|
|
38
|
-
export const VERSION = '0.2.1-dev.
|
|
39
|
+
export const VERSION = '0.2.1-dev.113';
|
|
39
40
|
export class RunBiOS {
|
|
40
41
|
/** Search models, fetch configs, check adapter compatibility. */
|
|
41
42
|
models;
|
|
42
43
|
/** Upload, import, preview, and manage training datasets. */
|
|
43
44
|
datasets;
|
|
45
|
+
integrations;
|
|
44
46
|
/** Create, monitor, stop, and resume fine-tuning jobs. */
|
|
45
47
|
training;
|
|
46
48
|
/** Check wallet balance. */
|
|
@@ -65,6 +67,7 @@ export class RunBiOS {
|
|
|
65
67
|
this._http = http;
|
|
66
68
|
this.models = new Models(http);
|
|
67
69
|
this.datasets = new Datasets(http);
|
|
70
|
+
this.integrations = new Integrations(http);
|
|
68
71
|
this.training = new Training(http);
|
|
69
72
|
this.wallet = new Wallet(http);
|
|
70
73
|
this.gpu = new GPU(http);
|
|
@@ -95,6 +98,7 @@ export { RunBiOS as BiOS };
|
|
|
95
98
|
export { ApiError, GpuRejectionError, CapacityUnavailableError, ComingSoonError, CAPACITY_UNAVAILABLE_CODE, COMING_SOON_CODES, PERMANENT_GPU_CODES, isPermanentGpuCode, gpuRejectionCodeForReason, } from './client.js';
|
|
96
99
|
export { Models } from './resources/models.js';
|
|
97
100
|
export { Datasets } from './resources/datasets.js';
|
|
101
|
+
export { Integrations } from './resources/integrations.js';
|
|
98
102
|
export { Training } from './resources/training.js';
|
|
99
103
|
export { Wallet } from './resources/wallet.js';
|
|
100
104
|
export { GPU } from './resources/gpu.js';
|
|
@@ -203,6 +203,7 @@ export class Datasets {
|
|
|
203
203
|
return normalizeDataset(await this._http.fetchPost(`/api/datasets/integrations/${encodeURIComponent(params.integrationId)}/import`, {
|
|
204
204
|
dataset_id: params.repoId,
|
|
205
205
|
name: params.name || params.repoId.split('/').pop() || params.repoId,
|
|
206
|
+
revision: params.revision,
|
|
206
207
|
subset: params.subset,
|
|
207
208
|
split: params.split,
|
|
208
209
|
max_samples: params.maxSamples,
|
|
@@ -239,6 +240,7 @@ export class Datasets {
|
|
|
239
240
|
description: raw.description,
|
|
240
241
|
hf_subset: raw.subset ?? raw.hf_subset,
|
|
241
242
|
hf_split: raw.split ?? raw.hf_split,
|
|
243
|
+
hf_revision: raw.revision ?? raw.hf_revision,
|
|
242
244
|
max_samples: raw.maxSamples ?? raw.max_samples,
|
|
243
245
|
sample_strategy: raw.sampleStrategy ?? raw.sample_strategy,
|
|
244
246
|
column_mapping: raw.columnMapping ?? raw.column_mapping,
|
|
@@ -348,6 +350,8 @@ export class Datasets {
|
|
|
348
350
|
q.set('subset', params.subset);
|
|
349
351
|
if (params.limit !== undefined)
|
|
350
352
|
q.set('limit', String(params.limit));
|
|
353
|
+
if (params.integrationId)
|
|
354
|
+
q.set('integration_id', params.integrationId);
|
|
351
355
|
return this._http.fetchGet(`/api/datasets/hub-preview?${q}`);
|
|
352
356
|
}
|
|
353
357
|
/**
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { HttpClient } from '../client.js';
|
|
2
|
+
export interface HuggingFaceIntegration {
|
|
3
|
+
id: string;
|
|
4
|
+
label: string;
|
|
5
|
+
provider: string;
|
|
6
|
+
status: string;
|
|
7
|
+
hf_username?: string;
|
|
8
|
+
scope?: string;
|
|
9
|
+
}
|
|
10
|
+
export interface IntegrationBrowseParams {
|
|
11
|
+
query?: string;
|
|
12
|
+
page?: number;
|
|
13
|
+
limit?: number;
|
|
14
|
+
sort?: 'downloads' | 'likes' | 'modified';
|
|
15
|
+
}
|
|
16
|
+
export declare class Integrations {
|
|
17
|
+
private readonly _http;
|
|
18
|
+
constructor(_http: HttpClient);
|
|
19
|
+
list(): Promise<HuggingFaceIntegration[]>;
|
|
20
|
+
browse(id: string, params?: IntegrationBrowseParams): Promise<Record<string, unknown>>;
|
|
21
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export class Integrations {
|
|
2
|
+
_http;
|
|
3
|
+
constructor(_http) {
|
|
4
|
+
this._http = _http;
|
|
5
|
+
}
|
|
6
|
+
async list() {
|
|
7
|
+
const result = await this._http.fetchGet('/api/datasets/integrations');
|
|
8
|
+
if (!Array.isArray(result.integrations))
|
|
9
|
+
throw new Error('The integration service did not return an account list');
|
|
10
|
+
return result.integrations;
|
|
11
|
+
}
|
|
12
|
+
async browse(id, params = {}) {
|
|
13
|
+
const query = new URLSearchParams({ page: String(params.page ?? 1), limit: String(params.limit ?? 20) });
|
|
14
|
+
if (params.query !== undefined)
|
|
15
|
+
query.set('search', params.query);
|
|
16
|
+
if (params.sort !== undefined)
|
|
17
|
+
query.set('sort', params.sort);
|
|
18
|
+
return this._http.fetchGet(`/api/datasets/integrations/${encodeURIComponent(id)}/browse?${query}`);
|
|
19
|
+
}
|
|
20
|
+
}
|
package/dist/resources/loop.d.ts
CHANGED
|
@@ -187,7 +187,11 @@ export declare class Loop {
|
|
|
187
187
|
* - `sft` -- answers you marked right, and answers you rewrote.
|
|
188
188
|
* - `dpo` -- answers you REWROTE, so a better and a worse version of the same
|
|
189
189
|
* reply exist. Nothing else produces a pair.
|
|
190
|
-
* - `grpo` -- answers with a value or fact they can be checked against
|
|
190
|
+
* - `grpo` -- answers with a value or fact they can be checked against, or
|
|
191
|
+
* a judge rubric, which scores answers the run has not written yet.
|
|
192
|
+
* - `kto` -- anything carrying a yes or a no, INCLUDING a thumbs-down with
|
|
193
|
+
* nothing written. That row trains nothing under the other three methods,
|
|
194
|
+
* which is why this one exists: it is the feedback people actually give.
|
|
191
195
|
*
|
|
192
196
|
* `holdout_percent` holds back your most recent work rather than a random
|
|
193
197
|
* slice, so the evaluation measures whether the model generalised instead of
|
package/dist/resources/loop.js
CHANGED
|
@@ -240,7 +240,11 @@ export class Loop {
|
|
|
240
240
|
* - `sft` -- answers you marked right, and answers you rewrote.
|
|
241
241
|
* - `dpo` -- answers you REWROTE, so a better and a worse version of the same
|
|
242
242
|
* reply exist. Nothing else produces a pair.
|
|
243
|
-
* - `grpo` -- answers with a value or fact they can be checked against
|
|
243
|
+
* - `grpo` -- answers with a value or fact they can be checked against, or
|
|
244
|
+
* a judge rubric, which scores answers the run has not written yet.
|
|
245
|
+
* - `kto` -- anything carrying a yes or a no, INCLUDING a thumbs-down with
|
|
246
|
+
* nothing written. That row trains nothing under the other three methods,
|
|
247
|
+
* which is why this one exists: it is the feedback people actually give.
|
|
244
248
|
*
|
|
245
249
|
* `holdout_percent` holds back your most recent work rather than a random
|
|
246
250
|
* slice, so the evaluation measures whether the model generalised instead of
|
package/dist/types.d.ts
CHANGED
|
@@ -396,8 +396,9 @@ export interface DatasetPreview {
|
|
|
396
396
|
}
|
|
397
397
|
/** Parameters for importing a dataset from HuggingFace Hub. */
|
|
398
398
|
export interface DatasetImportHFParams {
|
|
399
|
-
/** HuggingFace dataset repository ID (e.g. "
|
|
399
|
+
/** HuggingFace dataset repository ID (e.g. "HuggingFaceH4/ultrachat_200k"). */
|
|
400
400
|
repoId: string;
|
|
401
|
+
revision?: string;
|
|
401
402
|
/** Display name for the imported dataset. */
|
|
402
403
|
name?: string;
|
|
403
404
|
/** Dataset subset/config to import. */
|
|
@@ -418,6 +419,7 @@ export interface DatasetImportHFParams {
|
|
|
418
419
|
/** Parameters for registering a HuggingFace dataset without an integration. */
|
|
419
420
|
export interface DatasetRegisterHFParams {
|
|
420
421
|
repoId: string;
|
|
422
|
+
revision?: string;
|
|
421
423
|
name?: string;
|
|
422
424
|
workspaceId?: string;
|
|
423
425
|
description?: string;
|
|
@@ -441,6 +443,7 @@ export interface DatasetHubSearchParams {
|
|
|
441
443
|
export interface DatasetHubPreviewParams {
|
|
442
444
|
/** HuggingFace dataset ID. */
|
|
443
445
|
datasetId: string;
|
|
446
|
+
integrationId?: string;
|
|
444
447
|
/** Split to preview. Defaults to "train". */
|
|
445
448
|
split?: string;
|
|
446
449
|
/** Subset/config name. */
|
|
@@ -1956,7 +1959,7 @@ export interface ChatCompletionUsage {
|
|
|
1956
1959
|
prompt_tokens_details?: PromptTokensDetails;
|
|
1957
1960
|
}
|
|
1958
1961
|
/** What a training set is shaped for. The three need different things. */
|
|
1959
|
-
export type LoopMethod = 'sft' | 'dpo' | 'grpo';
|
|
1962
|
+
export type LoopMethod = 'sft' | 'dpo' | 'grpo' | 'kto';
|
|
1960
1963
|
/** Who judged an answer. */
|
|
1961
1964
|
export type LoopSource = 'human' | 'verifier' | 'judge' | 'behavioural';
|
|
1962
1965
|
/** The judgement itself. */
|