runbios-sdk 0.2.22 → 0.3.0-dev.322
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/CHANGELOG.md +53 -0
- package/README.md +48 -1
- package/dist/client.d.ts +11 -0
- package/dist/client.js +29 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.js +2 -2
- package/dist/resources/inference.d.ts +68 -2
- package/dist/resources/inference.js +71 -5
- package/dist/resources/loop.d.ts +63 -71
- package/dist/resources/loop.js +112 -18
- package/dist/resources/training.js +12 -2
- package/dist/types.d.ts +209 -69
- package/package.json +3 -2
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.runbios.ai hostname. */
|
|
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.runbios.ai. */
|
|
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;
|
|
@@ -565,6 +565,11 @@ export interface GPUChoice {
|
|
|
565
565
|
* adapter merged into one model: a checkpoint of format `merged`, which is
|
|
566
566
|
* what deploys (the job's own adapters are not deployable alone).
|
|
567
567
|
*
|
|
568
|
+
* `exportStep` says which of this job's steps that merged model is made of:
|
|
569
|
+
* `'best'` (the default) is the step the validation loss picked, `'final'`
|
|
570
|
+
* the last step trained. It needs `exportMerged: true`; without it the SDK
|
|
571
|
+
* refuses before sending, as the API does (400 on `start_from.export_step`).
|
|
572
|
+
*
|
|
568
573
|
* Refusals, all before anything is charged: 404 for an unknown, deleted or
|
|
569
574
|
* other-workspace checkpoint; 422 START_FROM_BASE_MISMATCH,
|
|
570
575
|
* START_FROM_CHAIN_BROKEN or START_FROM_LINK_UNREADABLE naming the `index`;
|
|
@@ -579,14 +584,22 @@ export interface TrainingStartFromParams {
|
|
|
579
584
|
checkpointId: string;
|
|
580
585
|
}[];
|
|
581
586
|
exportMerged?: boolean;
|
|
587
|
+
exportStep?: TrainingExportStep;
|
|
582
588
|
}
|
|
583
|
-
/** `start_from`
|
|
589
|
+
/** Which step of a `start_from` job its merged model is made of: the step validation picked, or the last one trained. */
|
|
590
|
+
export type TrainingExportStep = 'best' | 'final';
|
|
591
|
+
/**
|
|
592
|
+
* `start_from` as the API echoes it on create, preflight and the job, with the
|
|
593
|
+
* digest of the chain's exact bytes. `export_step` is echoed only when the
|
|
594
|
+
* request named it; absent, the merged model is of the `'best'` step.
|
|
595
|
+
*/
|
|
584
596
|
export interface TrainingStartFrom {
|
|
585
597
|
adapters: {
|
|
586
598
|
job_id: string;
|
|
587
599
|
checkpoint_id: string;
|
|
588
600
|
}[];
|
|
589
601
|
export_merged: boolean;
|
|
602
|
+
export_step?: TrainingExportStep;
|
|
590
603
|
chain_digest?: string;
|
|
591
604
|
}
|
|
592
605
|
/** Parameters for creating a training job. */
|
|
@@ -2403,7 +2416,11 @@ export interface ChatCompletionUsage {
|
|
|
2403
2416
|
total_tokens: number;
|
|
2404
2417
|
prompt_tokens_details?: PromptTokensDetails;
|
|
2405
2418
|
}
|
|
2406
|
-
/**
|
|
2419
|
+
/**
|
|
2420
|
+
* Who gave a verdict a sample carries. Feedback you send is always `human`:
|
|
2421
|
+
* `verifier`, `judge` and `behavioural` are written by the platform's own
|
|
2422
|
+
* scoring, and the feedback route refuses them (400).
|
|
2423
|
+
*/
|
|
2407
2424
|
export type LoopSource = 'human' | 'verifier' | 'judge' | 'behavioural';
|
|
2408
2425
|
/**
|
|
2409
2426
|
* The judgement recorded on an answer.
|
|
@@ -2414,8 +2431,11 @@ export type LoopSource = 'human' | 'verifier' | 'judge' | 'behavioural';
|
|
|
2414
2431
|
* trained on in place of the model's.
|
|
2415
2432
|
* `gold` records the reference answer for the question, making no claim about
|
|
2416
2433
|
* whether the model was right; it is trained on the same way.
|
|
2434
|
+
* `scored` is a score the platform's own scoring wrote; it is read, never sent.
|
|
2417
2435
|
*/
|
|
2418
2436
|
export type LoopVerdict = 'accepted' | 'rejected' | 'edited' | 'scored' | 'gold';
|
|
2437
|
+
/** The verdicts feedback can send: a person's good, bad, correction or reference answer. */
|
|
2438
|
+
export type LoopFeedbackVerdict = 'accepted' | 'rejected' | 'edited' | 'gold';
|
|
2419
2439
|
/** A function an assistant turn asked to invoke. `arguments` is JSON-encoded. */
|
|
2420
2440
|
export interface LoopToolCall {
|
|
2421
2441
|
id?: string;
|
|
@@ -2642,12 +2662,11 @@ export interface LoopSignal {
|
|
|
2642
2662
|
created_at: string;
|
|
2643
2663
|
}
|
|
2644
2664
|
export interface LoopSignalParams {
|
|
2645
|
-
verdict:
|
|
2646
|
-
|
|
2647
|
-
|
|
2665
|
+
verdict: LoopFeedbackVerdict;
|
|
2666
|
+
/** Always `human` when sent: feedback is a person's. Other sources are refused 400. */
|
|
2667
|
+
source?: 'human';
|
|
2668
|
+
/** Required when verdict is `edited` or `gold`. The answer the model should have given. */
|
|
2648
2669
|
correction?: string;
|
|
2649
|
-
/** Required when verdict is `scored`: above zero trains the answer as it stands, otherwise it is left out. */
|
|
2650
|
-
score?: number;
|
|
2651
2670
|
/** A value or fact the answer can be checked against. Kept with the verdict; a pipeline trains on `correction`, not on this. */
|
|
2652
2671
|
ground_truth?: string;
|
|
2653
2672
|
reason?: string;
|
|
@@ -2771,12 +2790,23 @@ export interface LoopTraceListParams {
|
|
|
2771
2790
|
signal?: 'good' | 'bad' | 'corrected';
|
|
2772
2791
|
/** Only the conversations nobody has given feedback on yet. */
|
|
2773
2792
|
unsignalled?: boolean;
|
|
2793
|
+
/**
|
|
2794
|
+
* Text search: 2 to 200 characters, case-insensitive, matched as written
|
|
2795
|
+
* (`%` and `_` are plain characters) in every message, the answer and the
|
|
2796
|
+
* answer's tool calls. Combines with every other filter.
|
|
2797
|
+
*/
|
|
2798
|
+
q?: string;
|
|
2774
2799
|
}
|
|
2775
2800
|
export interface LoopTraceListResponse {
|
|
2776
2801
|
traces: LoopTrace[];
|
|
2777
2802
|
total: number;
|
|
2778
2803
|
limit: number;
|
|
2779
2804
|
offset: number;
|
|
2805
|
+
/**
|
|
2806
|
+
* Present only when `q` was sent: how many of the samples the other filters
|
|
2807
|
+
* select keep their text in your own storage and so were not searched.
|
|
2808
|
+
*/
|
|
2809
|
+
unsearched?: number;
|
|
2780
2810
|
}
|
|
2781
2811
|
export interface LoopConfig {
|
|
2782
2812
|
deployment_id: string;
|
|
@@ -2982,8 +3012,9 @@ export type TrainingTrigger = 'rows' | 'cadence' | 'both' | 'manual' | 'variant'
|
|
|
2982
3012
|
* What it trained on (`train_rows`) is `new_samples` (new since the attempt
|
|
2983
3013
|
* before it) + `carried_samples` (trained by the attempts in
|
|
2984
3014
|
* `carried_from_attempts`, which did not go live) + `replayed_samples` (about
|
|
2985
|
-
*
|
|
2986
|
-
* builds on
|
|
3015
|
+
* half of what it trained on -- as many as it had not learned, or all the
|
|
3016
|
+
* versions it builds on learned when that is fewer -- drawn at random from
|
|
3017
|
+
* what they already learned, so it does not forget them). `learned_before` is
|
|
2987
3018
|
* how many samples those versions had learned: they are not trained again,
|
|
2988
3019
|
* except the replayed ones. An attempt from the base trains on every sample
|
|
2989
3020
|
* it can: `new_samples` is all of them, and the other three counts are 0.
|
|
@@ -2994,8 +3025,9 @@ export type TrainingTrigger = 'rows' | 'cadence' | 'both' | 'manual' | 'variant'
|
|
|
2994
3025
|
* `served_as` is `adapter` for an attempt from the base and `merged` for one
|
|
2995
3026
|
* built on versions (one model with every version merged in). A winner is
|
|
2996
3027
|
* merged in and served as one model. `learned_deleted_conversation` is true
|
|
2997
|
-
* when a
|
|
2998
|
-
*
|
|
3028
|
+
* when it -- or a version it was built on, whose model is merged into it --
|
|
3029
|
+
* learned a conversation that has since been deleted: a rebuild without it is
|
|
3030
|
+
* on its way, and it can no longer be rolled back to.
|
|
2999
3031
|
*/
|
|
3000
3032
|
export interface Lineage {
|
|
3001
3033
|
trained_from: 'base' | 'versions';
|
|
@@ -3022,6 +3054,12 @@ export interface TrainingRecipe {
|
|
|
3022
3054
|
num_train_epochs: number | null;
|
|
3023
3055
|
lora_rank: number | null;
|
|
3024
3056
|
lora_alpha: number | null;
|
|
3057
|
+
/**
|
|
3058
|
+
* True when one of the pipeline's own training settings ({@link Pipeline.training})
|
|
3059
|
+
* was applied over the automatic recipe for this run, frozen when it started;
|
|
3060
|
+
* false when it trained on automatic settings throughout.
|
|
3061
|
+
*/
|
|
3062
|
+
custom: boolean;
|
|
3025
3063
|
}
|
|
3026
3064
|
export type TrainingRunState = 'built' | 'registering' | 'dataset_validating' | 'preflighting' | 'job_creating' | 'training' | 'checkpoint_ready' | 'candidate_booking' | 'candidate_running' | 'evaluating' | 'reported' | 'awaiting_review' | 'promoting' | 'waiting_funds'
|
|
3027
3065
|
/**
|
|
@@ -3249,6 +3287,15 @@ export interface TrainingRun {
|
|
|
3249
3287
|
candidate_name: string | null;
|
|
3250
3288
|
candidate_seq: number;
|
|
3251
3289
|
candidate_status: string | null;
|
|
3290
|
+
/**
|
|
3291
|
+
* One boot window after the comparison machine was first seen on a GPU, set
|
|
3292
|
+
* once per booking (a booking after a wait for GPUs sets its own). Not
|
|
3293
|
+
* always the deadline the boot is held to: time the machine has no pod while
|
|
3294
|
+
* it waits for another GPU is not counted (except while a base model's
|
|
3295
|
+
* machine bills beside it), so the attempt can stay in candidate_booking
|
|
3296
|
+
* past this time, by at most one more window. An attempt that ran out
|
|
3297
|
+
* gives the deadline it was held to on its expiry event (deadline_at).
|
|
3298
|
+
*/
|
|
3252
3299
|
candidate_deadline_at: string | null;
|
|
3253
3300
|
candidate_cleanup_at: string | null;
|
|
3254
3301
|
evaluation_id: string | null;
|
|
@@ -3916,6 +3963,8 @@ export interface BenchmarkItemListParams {
|
|
|
3916
3963
|
offset?: number;
|
|
3917
3964
|
}
|
|
3918
3965
|
export interface BenchmarkHistoryParams {
|
|
3966
|
+
/** Only the points of this pipeline's attempts (its id, `rule_id`). */
|
|
3967
|
+
pipeline?: string;
|
|
3919
3968
|
/** 50 when absent; at most 200. */
|
|
3920
3969
|
limit?: number;
|
|
3921
3970
|
offset?: number;
|
|
@@ -3944,10 +3993,10 @@ export interface BenchmarkRetireParams {
|
|
|
3944
3993
|
* after a deleted conversation (`chain.rebuild`) is not held by the limit:
|
|
3945
3994
|
* Train now starts it, and each one that goes live is a version, so the
|
|
3946
3995
|
* pipeline can end past its limit.
|
|
3947
|
-
* - `MONTHLY_LIMIT_REACHED` (409): the
|
|
3948
|
-
*
|
|
3949
|
-
*
|
|
3950
|
-
* see {@link TrainingRuleMonthlyLimitRefusal}.
|
|
3996
|
+
* - `MONTHLY_LIMIT_REACHED` (409): the pipeline has reached its monthly
|
|
3997
|
+
* safety limit. The body carries `resumes_at`, and `error.message` says
|
|
3998
|
+
* what holds the pipeline and when the next attempt can start, with no
|
|
3999
|
+
* amount: see {@link TrainingRuleMonthlyLimitRefusal}.
|
|
3951
4000
|
* - `SCORING_CAPPED` (409): the key the comparison runs under is at its
|
|
3952
4001
|
* monthly cap, so what this attempt trained could not be scored. The body
|
|
3953
4002
|
* carries `resumes_at`, when the cap lifts (the next UTC month, or sooner
|
|
@@ -4002,6 +4051,8 @@ export type TrainingRuleRunRefusalCode = 'NOT_ENOUGH_SAMPLES' | 'PIPELINE_NEEDS_
|
|
|
4002
4051
|
* pipeline's current one (ignoring case) is kept, and whether it can still
|
|
4003
4052
|
* be trained is checked when an attempt starts.
|
|
4004
4053
|
* - `NO_GPU_FITS` (422): no machines can train or serve the model right now.
|
|
4054
|
+
* - `TRAINING_SETTING_OUT_OF_RANGE` (422): a `training` setting is outside its
|
|
4055
|
+
* range; the message names the field and the range. Nothing was saved.
|
|
4005
4056
|
* - `MODEL_REVISION_UNAVAILABLE` (422): the model could not be pinned to an
|
|
4006
4057
|
* exact revision because the training service did not answer. Try again
|
|
4007
4058
|
* once it does.
|
|
@@ -4028,37 +4079,25 @@ export type TrainingRuleRunRefusalCode = 'NOT_ENOUGH_SAMPLES' | 'PIPELINE_NEEDS_
|
|
|
4028
4079
|
* the key every comparison is scored with) did not answer just then. Try
|
|
4029
4080
|
* again in a minute.
|
|
4030
4081
|
*/
|
|
4031
|
-
export type TrainingRuleSaveRefusalCode = 'PIPELINE_NAME_TAKEN' | 'OWN_TAG_TAKEN' | 'REVISION_MISMATCH' | 'RUN_ACTIVE' | 'NOT_A_SIMPLE_PIPELINE' | 'MODEL_NOT_TRAINABLE' | 'NO_GPU_FITS' | 'MODEL_REVISION_UNAVAILABLE' | 'NO_JUDGE_MODEL' | 'PROMOTION_POLICY_UNKNOWN' | 'PROMOTION_K_REQUIRED' | 'PROMOTION_K_UNREACHABLE' | 'PROMOTION_POLICY_NEEDS_BENCHMARK' | 'TRAINING_NOT_ENABLED' | 'METHOD_NOT_ENABLED' | 'CEILING_TOO_LOW' | 'MODELS_UNAVAILABLE' | 'GPU_OPTIONS_UNAVAILABLE' | 'AGENT_COULD_NOT_START';
|
|
4082
|
+
export type TrainingRuleSaveRefusalCode = 'PIPELINE_NAME_TAKEN' | 'OWN_TAG_TAKEN' | 'REVISION_MISMATCH' | 'RUN_ACTIVE' | 'NOT_A_SIMPLE_PIPELINE' | 'MODEL_NOT_TRAINABLE' | 'NO_GPU_FITS' | 'TRAINING_SETTING_OUT_OF_RANGE' | 'MODEL_REVISION_UNAVAILABLE' | 'NO_JUDGE_MODEL' | 'PROMOTION_POLICY_UNKNOWN' | 'PROMOTION_K_REQUIRED' | 'PROMOTION_K_UNREACHABLE' | 'PROMOTION_POLICY_NEEDS_BENCHMARK' | 'TRAINING_NOT_ENABLED' | 'METHOD_NOT_ENABLED' | 'CEILING_TOO_LOW' | 'MODELS_UNAVAILABLE' | 'GPU_OPTIONS_UNAVAILABLE' | 'AGENT_COULD_NOT_START';
|
|
4032
4083
|
/**
|
|
4033
4084
|
* The body of a manual run refused `409 MONTHLY_LIMIT_REACHED`, as
|
|
4034
|
-
* `ApiError.body` carries it.
|
|
4035
|
-
*
|
|
4036
|
-
*
|
|
4037
|
-
*
|
|
4038
|
-
*
|
|
4039
|
-
* (`run_max_cents`), fits under the limit.
|
|
4085
|
+
* `ApiError.body` carries it: the pipeline's monthly safety limit holds it.
|
|
4086
|
+
* The limit is the platform's guard, set from the model's prices; the member
|
|
4087
|
+
* never sets it, so its figures are neither fields of the answer nor in
|
|
4088
|
+
* `message`, which says what holds the pipeline and when the next attempt can
|
|
4089
|
+
* start.
|
|
4040
4090
|
*/
|
|
4041
4091
|
export interface TrainingRuleMonthlyLimitRefusal {
|
|
4042
4092
|
error: {
|
|
4043
4093
|
code: 'MONTHLY_LIMIT_REACHED';
|
|
4044
4094
|
message: string;
|
|
4045
4095
|
};
|
|
4046
|
-
/** What this rule's runs have cost at most this UTC calendar month; see {@link Pipeline.month_spent_cents}. */
|
|
4047
|
-
month_spent_cents: number;
|
|
4048
|
-
/** The rule's monthly limit. */
|
|
4049
|
-
monthly_ceiling_cents: number;
|
|
4050
|
-
/**
|
|
4051
|
-
* The most one attempt of this rule may spend: its training, its comparison
|
|
4052
|
-
* machine and its judging. While no version is live that machine also
|
|
4053
|
-
* answers as the base model, so a pipeline's own attempt counts one; a
|
|
4054
|
-
* challenger's attempt also counts the base model's own machine beside it.
|
|
4055
|
-
*/
|
|
4056
|
-
run_max_cents: number;
|
|
4057
4096
|
/**
|
|
4058
|
-
* The first instant of the next UTC month, when the
|
|
4059
|
-
* again from nothing. When
|
|
4060
|
-
* will ever fit: saving the pipeline sets the limit again
|
|
4061
|
-
* prices, and nothing else changes it; `message` says which.
|
|
4097
|
+
* The first instant of the next UTC month, when the month's count starts
|
|
4098
|
+
* again from nothing. When one attempt alone can cost more than the whole
|
|
4099
|
+
* limit, no month will ever fit: saving the pipeline sets the limit again
|
|
4100
|
+
* from its model's prices, and nothing else changes it; `message` says which.
|
|
4062
4101
|
*/
|
|
4063
4102
|
resumes_at: string;
|
|
4064
4103
|
}
|
|
@@ -4136,10 +4175,8 @@ export interface PipelineVersion {
|
|
|
4136
4175
|
verdict: TrainingVerdict | null;
|
|
4137
4176
|
decision: TrainingDecision | null;
|
|
4138
4177
|
decided_at: string | null;
|
|
4139
|
-
/** True for the version the app is served by today (the same as `is_champion`). */
|
|
4140
|
-
is_live: boolean;
|
|
4141
4178
|
/** True for the version the app is served by today. */
|
|
4142
|
-
|
|
4179
|
+
is_live: boolean;
|
|
4143
4180
|
/** When it was first put live. */
|
|
4144
4181
|
promoted_at: string | null;
|
|
4145
4182
|
checkpoint_id: string | null;
|
|
@@ -4261,6 +4298,69 @@ export interface PipelineAttempt {
|
|
|
4261
4298
|
evaluation_id: string | null;
|
|
4262
4299
|
/** Its last sentence. */
|
|
4263
4300
|
reason: string | null;
|
|
4301
|
+
/**
|
|
4302
|
+
* What became of it in plain words, written by the service from its state,
|
|
4303
|
+
* verdict and error. See {@link AttemptExplanation}.
|
|
4304
|
+
*/
|
|
4305
|
+
explanation: AttemptExplanation | null;
|
|
4306
|
+
}
|
|
4307
|
+
/**
|
|
4308
|
+
* An attempt's outcome in plain words: `headline` ("Could not be tested"),
|
|
4309
|
+
* `detail` (what happened and why) and `next` (what happens now; null when
|
|
4310
|
+
* there is nothing to say).
|
|
4311
|
+
*/
|
|
4312
|
+
export interface AttemptExplanation {
|
|
4313
|
+
headline: string;
|
|
4314
|
+
detail: string;
|
|
4315
|
+
next: string | null;
|
|
4316
|
+
}
|
|
4317
|
+
/**
|
|
4318
|
+
* A pipeline's own training settings, each null while it is automatic (the
|
|
4319
|
+
* platform's value for its model, {@link PipelineTrainingDefaults}). A change
|
|
4320
|
+
* applies from the next attempt, and every attempt keeps the settings it
|
|
4321
|
+
* trained with on its `recipe` (`custom` true when one of these applied).
|
|
4322
|
+
* LoRA only: there is no full fine-tune, so the rank and alpha always apply.
|
|
4323
|
+
*/
|
|
4324
|
+
export interface PipelineTrainingSettings {
|
|
4325
|
+
/** Passes over the data, 1 to 15. */
|
|
4326
|
+
epochs: number | null;
|
|
4327
|
+
/** 1e-6 to 1e-2. */
|
|
4328
|
+
learning_rate: number | null;
|
|
4329
|
+
/** 4, 8, 16, 32 or 64. */
|
|
4330
|
+
lora_rank: number | null;
|
|
4331
|
+
/** 1 to 512. */
|
|
4332
|
+
lora_alpha: number | null;
|
|
4333
|
+
/**
|
|
4334
|
+
* 0 to 50: the share of already-learned samples an attempt replays when it
|
|
4335
|
+
* builds on the live version, so the new version does not forget them.
|
|
4336
|
+
*/
|
|
4337
|
+
replay_percent: number | null;
|
|
4338
|
+
}
|
|
4339
|
+
/**
|
|
4340
|
+
* What automatic means for this pipeline's model: what an attempt trains with
|
|
4341
|
+
* where {@link PipelineTrainingSettings} says null. The automatic recipe picks
|
|
4342
|
+
* its passes from `min_epochs` to `max_epochs` (at least 8 for Gemma 4).
|
|
4343
|
+
*/
|
|
4344
|
+
export interface PipelineTrainingDefaults {
|
|
4345
|
+
learning_rate: number;
|
|
4346
|
+
lora_rank: number;
|
|
4347
|
+
lora_alpha: number;
|
|
4348
|
+
replay_percent: number;
|
|
4349
|
+
min_epochs: number;
|
|
4350
|
+
max_epochs: number;
|
|
4351
|
+
}
|
|
4352
|
+
/**
|
|
4353
|
+
* The training settings a create or edit sends. Every key is three-state:
|
|
4354
|
+
* absent keeps the pipeline's, null puts it back to automatic, a number sets
|
|
4355
|
+
* it. Out of range is refused 422 `TRAINING_SETTING_OUT_OF_RANGE` naming the
|
|
4356
|
+
* field and its range.
|
|
4357
|
+
*/
|
|
4358
|
+
export interface PipelineTrainingRequest {
|
|
4359
|
+
epochs?: number | null;
|
|
4360
|
+
learning_rate?: number | null;
|
|
4361
|
+
lora_rank?: number | null;
|
|
4362
|
+
lora_alpha?: number | null;
|
|
4363
|
+
replay_percent?: number | null;
|
|
4264
4364
|
}
|
|
4265
4365
|
/** A model and the exact commit of it. */
|
|
4266
4366
|
export interface PipelineModelRef {
|
|
@@ -4374,7 +4474,8 @@ export interface PipelineChainRebuild {
|
|
|
4374
4474
|
* pipeline trained is live on its current model, and when the pipeline does
|
|
4375
4475
|
* not build on its live version (then every attempt trains from the base on
|
|
4376
4476
|
* all samples). `learned_samples` is how many samples those versions learned
|
|
4377
|
-
* (the next attempt does not train them again, except
|
|
4477
|
+
* (the next attempt does not train them again, except the replay, about
|
|
4478
|
+
* half of what it trains on);
|
|
4378
4479
|
* `not_learned_samples` is how many were trained by attempts that did not go
|
|
4379
4480
|
* live, so the next attempt trains them again. Null on the list.
|
|
4380
4481
|
*/
|
|
@@ -4414,6 +4515,10 @@ export interface Pipeline {
|
|
|
4414
4515
|
holdout: PipelineHoldout;
|
|
4415
4516
|
/** Rows the next version holds back and never trains on. Detail only; null on the list. */
|
|
4416
4517
|
holdout_size: number | null;
|
|
4518
|
+
/** Its training settings, each null while automatic. See {@link PipelineTrainingSettings}. */
|
|
4519
|
+
training: PipelineTrainingSettings;
|
|
4520
|
+
/** What automatic means for its model. See {@link PipelineTrainingDefaults}. */
|
|
4521
|
+
training_defaults: PipelineTrainingDefaults;
|
|
4417
4522
|
minimums: PipelineMinimums;
|
|
4418
4523
|
/**
|
|
4419
4524
|
* The pinned base every version is trained over: from it, or, where the
|
|
@@ -4424,8 +4529,6 @@ export interface Pipeline {
|
|
|
4424
4529
|
base_model_revision: string;
|
|
4425
4530
|
/** The version serving now; null when what serves is not a version of this pipeline. */
|
|
4426
4531
|
live_version: number | null;
|
|
4427
|
-
/** The same number under its older name. */
|
|
4428
|
-
champion_version: number | null;
|
|
4429
4532
|
/**
|
|
4430
4533
|
* Whether the deployment the live version answers from is up, as the
|
|
4431
4534
|
* platform last checked it. Null when there is no live version, when what
|
|
@@ -4444,10 +4547,6 @@ export interface Pipeline {
|
|
|
4444
4547
|
* does. Null when nothing has taken the name over.
|
|
4445
4548
|
*/
|
|
4446
4549
|
serving_taken_over_by: string | null;
|
|
4447
|
-
benchmark_id: string | null;
|
|
4448
|
-
benchmark_name: string | null;
|
|
4449
|
-
/** The least a benchmark's score has to rise by to count as an improvement under a policy that reads benchmarks. */
|
|
4450
|
-
benchmark_min_delta: number;
|
|
4451
4550
|
status: PipelineStatus;
|
|
4452
4551
|
/**
|
|
4453
4552
|
* The rule's own sentence about what it is waiting for or why it stopped,
|
|
@@ -4457,7 +4556,6 @@ export interface Pipeline {
|
|
|
4457
4556
|
next_reason: string | null;
|
|
4458
4557
|
last_checked_at: string | null;
|
|
4459
4558
|
next_due_at: string | null;
|
|
4460
|
-
auto_promote: boolean;
|
|
4461
4559
|
/**
|
|
4462
4560
|
* Why the platform stopped firing this rule, or null. `consent_invalid` is
|
|
4463
4561
|
* a pipeline whose settings changed since it was last saved: saving it
|
|
@@ -4471,26 +4569,18 @@ export interface Pipeline {
|
|
|
4471
4569
|
* trains on its own: an attempt would train and could not be compared.
|
|
4472
4570
|
*/
|
|
4473
4571
|
scoring_capped_until: string | null;
|
|
4474
|
-
/** The rule's monthly limit. Null means it has none. */
|
|
4475
|
-
monthly_ceiling_cents: number | null;
|
|
4476
|
-
/**
|
|
4477
|
-
* What this rule's runs have cost at most, counted toward the monthly limit
|
|
4478
|
-
* this UTC calendar month -- the figure the limit is enforced against. An
|
|
4479
|
-
* upper bound, not an exact spend. A run counts toward the month it was
|
|
4480
|
-
* created in, and a run still in progress also counts toward the current
|
|
4481
|
-
* month, at the most it may cost (as `run_max_cents` counts it, a base
|
|
4482
|
-
* model's machine included where the attempt has one of its own) or what it
|
|
4483
|
-
* has been billed when that is more. A finished run counts what it was billed, and its comparison
|
|
4484
|
-
* machines are billed at the most they could have cost (each machine's
|
|
4485
|
-
* hourly cap for the time it was up, never more than its own amount). A run created in
|
|
4486
|
-
* an earlier month that finishes in this one counts here only while it is
|
|
4487
|
-
* still running.
|
|
4488
|
-
*/
|
|
4489
|
-
month_spent_cents: number;
|
|
4490
4572
|
active_run: PipelineActiveRun | null;
|
|
4491
|
-
/**
|
|
4573
|
+
/** How many versions it has made: every one is in `versions` from `getPipeline`, only the latest few and the live one on `listPipelines`. */
|
|
4574
|
+
versions_total: number;
|
|
4575
|
+
/** How many attempts it has made; `attempts` holds only the latest of them. */
|
|
4576
|
+
attempts_total: number;
|
|
4577
|
+
/** Winners only, v1 first: every one from `getPipeline`, the latest few and the live one on `listPipelines`. */
|
|
4492
4578
|
versions: PipelineVersion[];
|
|
4493
|
-
/**
|
|
4579
|
+
/**
|
|
4580
|
+
* Its latest attempts, in attempt order: 20 from `getPipeline`, 5 on each
|
|
4581
|
+
* pipeline of `listPipelines`. `attempts_total` says how many there are,
|
|
4582
|
+
* and `listPipelineAttempts` pages through every one.
|
|
4583
|
+
*/
|
|
4494
4584
|
attempts: PipelineAttempt[];
|
|
4495
4585
|
}
|
|
4496
4586
|
export interface TrainingRuleDeleteResponse {
|
|
@@ -4647,12 +4737,23 @@ export interface BenchmarkHistoryResponse {
|
|
|
4647
4737
|
points: BenchmarkHistoryPoint[];
|
|
4648
4738
|
total: number;
|
|
4649
4739
|
}
|
|
4740
|
+
/**
|
|
4741
|
+
* The pipeline list's `status` filter: `training` (an attempt is running),
|
|
4742
|
+
* `needs_you` (waiting on a member: a review or funds), `serving` (its live
|
|
4743
|
+
* version answers) and `paused`.
|
|
4744
|
+
*/
|
|
4745
|
+
export type PipelineListStatus = 'training' | 'needs_you' | 'serving' | 'paused';
|
|
4650
4746
|
export interface PipelineListParams {
|
|
4747
|
+
/** 100 when absent; at most 100. */
|
|
4748
|
+
limit?: number;
|
|
4651
4749
|
/** How many of the newest pipelines to skip: the page after one that started at N starts at N + its length. */
|
|
4652
4750
|
offset?: number;
|
|
4751
|
+
/** A case-insensitive substring of the name, the tag or the model. */
|
|
4752
|
+
q?: string;
|
|
4753
|
+
status?: PipelineListStatus;
|
|
4653
4754
|
}
|
|
4654
4755
|
export interface PipelineListResponse {
|
|
4655
|
-
/** The newest pipelines first,
|
|
4756
|
+
/** The newest pipelines first, one page (100 unless `limit` says; at most 100). */
|
|
4656
4757
|
pipelines: Pipeline[];
|
|
4657
4758
|
/** Every pipeline in the workspace, including any not returned. */
|
|
4658
4759
|
total: number;
|
|
@@ -4662,6 +4763,22 @@ export interface PipelineListResponse {
|
|
|
4662
4763
|
export interface PipelineResponse {
|
|
4663
4764
|
pipeline: Pipeline;
|
|
4664
4765
|
}
|
|
4766
|
+
/** What became of an attempt, as `listPipelineAttempts` filters it. */
|
|
4767
|
+
export type PipelineAttemptResultFilter = 'became_version' | 'not_better' | 'inconclusive' | 'failed' | 'stopped' | 'running' | 'waiting_for_review';
|
|
4768
|
+
/** Which model's attempts: the pipeline's own (`main`) or its second model's (`second`). */
|
|
4769
|
+
export type PipelineAttemptModelFilter = 'main' | 'second';
|
|
4770
|
+
export interface PipelineAttemptListParams {
|
|
4771
|
+
/** 50 when absent; at most 200. */
|
|
4772
|
+
limit?: number;
|
|
4773
|
+
offset?: number;
|
|
4774
|
+
result?: PipelineAttemptResultFilter;
|
|
4775
|
+
model?: PipelineAttemptModelFilter;
|
|
4776
|
+
}
|
|
4777
|
+
/** One page of a pipeline's attempts, newest first. `total` follows the filters. */
|
|
4778
|
+
export interface PipelineAttemptListResponse {
|
|
4779
|
+
attempts: PipelineAttempt[];
|
|
4780
|
+
total: number;
|
|
4781
|
+
}
|
|
4665
4782
|
/**
|
|
4666
4783
|
* The body of `POST /api/loop/pipelines` and (every field optional)
|
|
4667
4784
|
* `PUT /api/loop/pipelines/{id}`. Everything else -- the machines, the money,
|
|
@@ -4718,6 +4835,12 @@ export interface PipelineWriteRequest {
|
|
|
4718
4835
|
/** 1 to 100, or null for no limit (the default). Counts versions, not attempts. */
|
|
4719
4836
|
max_versions?: number | null;
|
|
4720
4837
|
enabled?: boolean;
|
|
4838
|
+
/**
|
|
4839
|
+
* The pipeline's training settings. Absent: unchanged on an edit (automatic
|
|
4840
|
+
* on a create). null: every one back to automatic. An object: only the keys
|
|
4841
|
+
* it carries change, each null for automatic. See {@link PipelineTrainingRequest}.
|
|
4842
|
+
*/
|
|
4843
|
+
training?: PipelineTrainingRequest | null;
|
|
4721
4844
|
/** An edit's compare-and-set. */
|
|
4722
4845
|
expected_revision?: number;
|
|
4723
4846
|
}
|
|
@@ -4770,8 +4893,25 @@ export interface HeldBackFloors {
|
|
|
4770
4893
|
max_percent: number;
|
|
4771
4894
|
scored_rows: number;
|
|
4772
4895
|
}
|
|
4896
|
+
/** Why a model is not offered for a pipeline ({@link LoopUnavailableModel.reason_code}). */
|
|
4897
|
+
export type LoopUnavailableReasonCode = 'not_trainable_sft_lora' | 'not_servable_as_adapter' | 'too_large_for_available_gpus' | 'not_verified' | 'registry_missing';
|
|
4898
|
+
/**
|
|
4899
|
+
* A model the platform knows that a pipeline cannot use, and why. `reason` is
|
|
4900
|
+
* one plain sentence to show as it is; `reason_code` is one of
|
|
4901
|
+
* {@link LoopUnavailableReasonCode}, typed as a string so a code added later
|
|
4902
|
+
* still carries its sentence.
|
|
4903
|
+
*/
|
|
4904
|
+
export interface LoopUnavailableModel {
|
|
4905
|
+
id: string;
|
|
4906
|
+
name: string;
|
|
4907
|
+
family: string | null;
|
|
4908
|
+
reason_code: string;
|
|
4909
|
+
reason: string;
|
|
4910
|
+
}
|
|
4773
4911
|
export interface LoopModelsResponse {
|
|
4774
4912
|
models: LoopModel[];
|
|
4913
|
+
/** Every other model the platform knows, each with why it is not offered here. */
|
|
4914
|
+
unavailable: LoopUnavailableModel[];
|
|
4775
4915
|
floors: PipelineFloors;
|
|
4776
4916
|
}
|
|
4777
4917
|
/** The promotion rule as the API reads it back. */
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "runbios-sdk",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0-dev.322",
|
|
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",
|
|
@@ -16,7 +16,8 @@
|
|
|
16
16
|
"dist/**/*.d.ts",
|
|
17
17
|
"!dist/**/*.map",
|
|
18
18
|
"!dist/**/*.d.ts.map",
|
|
19
|
-
"README.md"
|
|
19
|
+
"README.md",
|
|
20
|
+
"CHANGELOG.md"
|
|
20
21
|
],
|
|
21
22
|
"scripts": {
|
|
22
23
|
"build": "tsc",
|