runbios-sdk 0.2.1-dev.68 → 0.2.1-dev.74
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/models.d.ts +1 -2
- package/dist/resources/models.js +1 -4
- package/dist/resources/training.js +3 -18
- package/dist/types.d.ts +19 -22
- 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.74";
|
|
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.74';
|
|
38
38
|
export class RunBiOS {
|
|
39
39
|
/** Search models, fetch configs, check adapter compatibility. */
|
|
40
40
|
models;
|
|
@@ -73,8 +73,7 @@ export declare class Models {
|
|
|
73
73
|
* ```ts
|
|
74
74
|
* const compat = await client.models.getAdapterCompatibility({
|
|
75
75
|
* modelType: 'llama',
|
|
76
|
-
* trainingMethod: '
|
|
77
|
-
* rlhfAlgorithm: 'dpo',
|
|
76
|
+
* trainingMethod: 'sft',
|
|
78
77
|
* });
|
|
79
78
|
* const usable = compat.adapters.filter(a => a.compatible);
|
|
80
79
|
* console.log(`${usable.length} compatible adapters`);
|
package/dist/resources/models.js
CHANGED
|
@@ -99,8 +99,7 @@ export class Models {
|
|
|
99
99
|
* ```ts
|
|
100
100
|
* const compat = await client.models.getAdapterCompatibility({
|
|
101
101
|
* modelType: 'llama',
|
|
102
|
-
* trainingMethod: '
|
|
103
|
-
* rlhfAlgorithm: 'dpo',
|
|
102
|
+
* trainingMethod: 'sft',
|
|
104
103
|
* });
|
|
105
104
|
* const usable = compat.adapters.filter(a => a.compatible);
|
|
106
105
|
* console.log(`${usable.length} compatible adapters`);
|
|
@@ -114,8 +113,6 @@ export class Models {
|
|
|
114
113
|
q.set('model_type', params.modelType);
|
|
115
114
|
if (params.trainingMethod)
|
|
116
115
|
q.set('training_method', params.trainingMethod);
|
|
117
|
-
if (params.rlhfAlgorithm)
|
|
118
|
-
q.set('rlhf_algorithm', params.rlhfAlgorithm);
|
|
119
116
|
return this._http.fetchGet(`/api/public/adapter-compatibility?${q}`);
|
|
120
117
|
}
|
|
121
118
|
/**
|
|
@@ -9,6 +9,8 @@ function trainingIdempotencyKey(explicit) {
|
|
|
9
9
|
}
|
|
10
10
|
function buildTrainingRequest(params) {
|
|
11
11
|
let trainingMethod = params.method;
|
|
12
|
+
// Legacy alias from SDK versions that modeled VLM training as a method;
|
|
13
|
+
// vision-language models train through sft.
|
|
12
14
|
if (trainingMethod === 'vlm')
|
|
13
15
|
trainingMethod = 'sft';
|
|
14
16
|
const datasetIds = (params.datasetIds || []).filter((id) => id.trim() !== '');
|
|
@@ -25,8 +27,6 @@ function buildTrainingRequest(params) {
|
|
|
25
27
|
};
|
|
26
28
|
if (params.modelRevision !== undefined)
|
|
27
29
|
body.model_revision = params.modelRevision;
|
|
28
|
-
if (params.rlhfAlgorithm !== undefined)
|
|
29
|
-
body.rlhf_type = params.rlhfAlgorithm;
|
|
30
30
|
const queueEnabled = params.queueIfUnavailable ?? false;
|
|
31
31
|
const placement = normalizeGPUPlacement(params.gpuPriorities, queueEnabled, params.gpuType, params.gpuCount, 'queueIfUnavailable');
|
|
32
32
|
body.queue_if_unavailable = queueEnabled;
|
|
@@ -96,12 +96,8 @@ function buildTrainingRequest(params) {
|
|
|
96
96
|
config.max_grad_norm = params.maxGradNorm;
|
|
97
97
|
if (params.maxSeqLength !== undefined)
|
|
98
98
|
config.max_length = params.maxSeqLength;
|
|
99
|
-
if (params.gradientCheckpointing !== undefined)
|
|
100
|
-
config.gradient_checkpointing = params.gradientCheckpointing;
|
|
101
99
|
if (params.mixedPrecision !== undefined) {
|
|
102
|
-
config.torch_dtype = params.mixedPrecision === 'bf16'
|
|
103
|
-
? 'bfloat16'
|
|
104
|
-
: params.mixedPrecision === 'fp16' ? 'float16' : 'float32';
|
|
100
|
+
config.torch_dtype = params.mixedPrecision === 'bf16' ? 'bfloat16' : 'float32';
|
|
105
101
|
}
|
|
106
102
|
if (params.seed !== undefined)
|
|
107
103
|
config.seed = params.seed;
|
|
@@ -109,22 +105,12 @@ function buildTrainingRequest(params) {
|
|
|
109
105
|
config.lora_rank = params.loraRank;
|
|
110
106
|
if (params.loraAlpha !== undefined)
|
|
111
107
|
config.lora_alpha = params.loraAlpha;
|
|
112
|
-
if (params.loraDropout !== undefined)
|
|
113
|
-
config.lora_dropout = params.loraDropout;
|
|
114
108
|
if (params.loraTargetModules !== undefined)
|
|
115
109
|
config.target_modules = params.loraTargetModules;
|
|
116
110
|
if (params.quantizationBit !== undefined)
|
|
117
111
|
config.quant_bits = params.quantizationBit;
|
|
118
|
-
if (params.deepspeed !== undefined)
|
|
119
|
-
config.deepspeed = params.deepspeed;
|
|
120
112
|
if (params.saveSteps !== undefined)
|
|
121
113
|
config.save_steps = params.saveSteps;
|
|
122
|
-
if (params.saveEpochs !== undefined) {
|
|
123
|
-
if (params.saveEpochs !== 1) {
|
|
124
|
-
throw new Error('RunBiOS: saveEpochs only supports 1; use extraConfig.save_strategy for explicit checkpoint policy');
|
|
125
|
-
}
|
|
126
|
-
config.save_strategy = 'epoch';
|
|
127
|
-
}
|
|
128
114
|
if (params.maxCheckpoints !== undefined)
|
|
129
115
|
config.save_total_limit = params.maxCheckpoints;
|
|
130
116
|
if (params.evalSteps !== undefined)
|
|
@@ -239,7 +225,6 @@ export class Training {
|
|
|
239
225
|
model_revision: params.modelRevision,
|
|
240
226
|
training_method: trainingMethod,
|
|
241
227
|
train_type: params.adapter,
|
|
242
|
-
rlhf_type: params.rlhfAlgorithm,
|
|
243
228
|
dataset_ids: datasetIds,
|
|
244
229
|
gpu_type: params.gpuType,
|
|
245
230
|
gpu_count: params.gpuCount,
|
package/dist/types.d.ts
CHANGED
|
@@ -491,12 +491,21 @@ export interface DatasetStorageUsage {
|
|
|
491
491
|
pricing?: Record<string, number>;
|
|
492
492
|
recent_charges?: Array<Record<string, unknown>>;
|
|
493
493
|
}
|
|
494
|
-
/**
|
|
495
|
-
|
|
496
|
-
|
|
494
|
+
/**
|
|
495
|
+
* Supported training methods. `sft` (supervised fine-tuning on chat/instruct
|
|
496
|
+
* data, vision-language models included) and `pt` (continued pre-training on
|
|
497
|
+
* raw text). The authoritative list for the deployment you talk to is
|
|
498
|
+
* GET /api/training/capabilities (client.training.capabilities()).
|
|
499
|
+
*/
|
|
500
|
+
export type TrainingMethod = 'sft' | 'pt';
|
|
501
|
+
/** Supported adapter types: LoRA, quantized (NF4) QLoRA, or full fine-tune. */
|
|
502
|
+
export type AdapterType = 'lora' | 'qlora' | 'full';
|
|
503
|
+
/**
|
|
504
|
+
* Historical RLHF algorithm labels. RLHF is not offered by the training
|
|
505
|
+
* engine; this type remains only so jobs created on earlier platform
|
|
506
|
+
* versions still parse in list/get responses.
|
|
507
|
+
*/
|
|
497
508
|
export type RLHFAlgorithm = 'dpo' | 'simpo' | 'cpo' | 'orpo' | 'kto' | 'rm';
|
|
498
|
-
/** Supported adapter types. */
|
|
499
|
-
export type AdapterType = 'lora' | 'qlora' | 'adalora' | 'full' | 'loha' | 'lokr' | 'boft' | 'oft' | 'vera' | 'fourierft' | 'bone' | 'adapter' | 'reft' | 'llamapro' | 'longlora';
|
|
500
509
|
/** Training job status values. */
|
|
501
510
|
export type TrainingJobStatus = 'pending' | 'queued' | 'securing' | 'booked' | 'provisioning' | 'preparing' | 'starting' | 'downloading' | 'running' | 'completed' | 'failed' | 'interrupted' | 'saving' | 'stopped' | 'stopping' | 'resuming' | 'cancelled';
|
|
502
511
|
/** Status values accepted by GET /api/training/jobs?status=. */
|
|
@@ -540,8 +549,6 @@ export interface TrainingCreateParams {
|
|
|
540
549
|
method: TrainingMethod;
|
|
541
550
|
/** Adapter type. */
|
|
542
551
|
adapter: AdapterType;
|
|
543
|
-
/** RLHF algorithm (required when method is "rlhf"). */
|
|
544
|
-
rlhfAlgorithm?: RLHFAlgorithm;
|
|
545
552
|
/** GPU type identifier. */
|
|
546
553
|
gpuType?: string;
|
|
547
554
|
/** Number of GPUs to use. */
|
|
@@ -578,24 +585,18 @@ export interface TrainingCreateParams {
|
|
|
578
585
|
maxGradNorm?: number;
|
|
579
586
|
/** Maximum sequence length. */
|
|
580
587
|
maxSeqLength?: number;
|
|
581
|
-
/**
|
|
582
|
-
|
|
583
|
-
/** Enable mixed precision training (bf16/fp16). */
|
|
584
|
-
mixedPrecision?: 'bf16' | 'fp16' | 'no';
|
|
588
|
+
/** Training precision: bf16 (default) or full fp32. */
|
|
589
|
+
mixedPrecision?: 'bf16' | 'no';
|
|
585
590
|
/** Random seed. */
|
|
586
591
|
seed?: number;
|
|
587
592
|
/** LoRA rank. */
|
|
588
593
|
loraRank?: number;
|
|
589
594
|
/** LoRA alpha scaling factor. */
|
|
590
595
|
loraAlpha?: number;
|
|
591
|
-
/** LoRA dropout rate. */
|
|
592
|
-
loraDropout?: number;
|
|
593
596
|
/** LoRA target modules (comma-separated or array). */
|
|
594
597
|
loraTargetModules?: string | string[];
|
|
595
|
-
/** Quantization bit width (4
|
|
596
|
-
quantizationBit?: 4
|
|
597
|
-
/** DeepSpeed stage ("zero2" or "zero3"). */
|
|
598
|
-
deepspeed?: 'zero2' | 'zero3';
|
|
598
|
+
/** Quantization bit width (NF4 4-bit). */
|
|
599
|
+
quantizationBit?: 4;
|
|
599
600
|
/** Storage size in GB. */
|
|
600
601
|
storageGb?: number;
|
|
601
602
|
/** Number of checkpoints to retain at the platform level. */
|
|
@@ -614,10 +615,8 @@ export interface TrainingCreateParams {
|
|
|
614
615
|
datasetMixing?: 'shuffle' | 'sequential' | 'interleave' | 'random' | 'curriculum';
|
|
615
616
|
/** Structured multi-dataset mixing plan. */
|
|
616
617
|
mixing?: Record<string, unknown>;
|
|
617
|
-
/** Save checkpoint every N steps. */
|
|
618
|
+
/** Save checkpoint every N steps (checkpoints are step-interval based). */
|
|
618
619
|
saveSteps?: number;
|
|
619
|
-
/** Save checkpoint every N epochs. */
|
|
620
|
-
saveEpochs?: number;
|
|
621
620
|
/** Maximum number of checkpoints to keep. */
|
|
622
621
|
maxCheckpoints?: number;
|
|
623
622
|
/** Evaluate every N steps. */
|
|
@@ -1791,8 +1790,6 @@ export interface AdapterCompatibilityParams {
|
|
|
1791
1790
|
modelType?: string;
|
|
1792
1791
|
/** Training method. Defaults to "sft". */
|
|
1793
1792
|
trainingMethod?: TrainingMethod;
|
|
1794
|
-
/** RLHF algorithm (relevant when trainingMethod is "rlhf"). */
|
|
1795
|
-
rlhfAlgorithm?: RLHFAlgorithm;
|
|
1796
1793
|
}
|
|
1797
1794
|
/** An API key. */
|
|
1798
1795
|
export interface ApiKey {
|