runbios-sdk 0.2.22 → 0.3.0-dev.323

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/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` as the API echoes it on create, preflight and the job, with the digest of the chain's exact bytes. */
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. */
@@ -1727,6 +1740,14 @@ export interface InferenceDeploymentSummary {
1727
1740
  * unreachable or slow (a money read never blocks the list).
1728
1741
  */
1729
1742
  charged_cents?: number | null;
1743
+ /**
1744
+ * A Conscious Loop comparison machine that no model name points at: the
1745
+ * loop's own machine for comparing an attempt, listed and billed like any
1746
+ * other, but never a model to offer. Leave it out of a model picker; the
1747
+ * pipeline's own name (`loop-<tag>`) is the one to call. Absent from a
1748
+ * service from before it was sent.
1749
+ */
1750
+ loop_comparison?: boolean;
1730
1751
  /** History view (`include_terminated`) only: how the lifecycle closed, and when. */
1731
1752
  disposition?: string;
1732
1753
  deleted_at?: string | null;
@@ -2403,7 +2424,11 @@ export interface ChatCompletionUsage {
2403
2424
  total_tokens: number;
2404
2425
  prompt_tokens_details?: PromptTokensDetails;
2405
2426
  }
2406
- /** Who gave a verdict. Feedback you send is `human` unless you say otherwise. */
2427
+ /**
2428
+ * Who gave a verdict a sample carries. Feedback you send is always `human`:
2429
+ * `verifier`, `judge` and `behavioural` are written by the platform's own
2430
+ * scoring, and the feedback route refuses them (400).
2431
+ */
2407
2432
  export type LoopSource = 'human' | 'verifier' | 'judge' | 'behavioural';
2408
2433
  /**
2409
2434
  * The judgement recorded on an answer.
@@ -2414,8 +2439,18 @@ export type LoopSource = 'human' | 'verifier' | 'judge' | 'behavioural';
2414
2439
  * trained on in place of the model's.
2415
2440
  * `gold` records the reference answer for the question, making no claim about
2416
2441
  * whether the model was right; it is trained on the same way.
2442
+ * `scored` is a score the platform's own scoring wrote; it is read, never sent.
2417
2443
  */
2418
2444
  export type LoopVerdict = 'accepted' | 'rejected' | 'edited' | 'scored' | 'gold';
2445
+ /** The verdicts feedback can send: a person's good, bad, correction or reference answer. */
2446
+ export type LoopFeedbackVerdict = 'accepted' | 'rejected' | 'edited' | 'gold';
2447
+ /**
2448
+ * The plain words for the three common verdicts: `good` is `accepted`, `bad`
2449
+ * is `rejected` and `corrected` is `edited` (with its `correction`). A capture's
2450
+ * `feedback` takes them, and so does `signal`; the stored verdict, and the one
2451
+ * a signal answers with, is the `LoopVerdict` word.
2452
+ */
2453
+ export type LoopFeedbackWord = 'good' | 'bad' | 'corrected';
2419
2454
  /** A function an assistant turn asked to invoke. `arguments` is JSON-encoded. */
2420
2455
  export interface LoopToolCall {
2421
2456
  id?: string;
@@ -2463,6 +2498,19 @@ export interface LoopCaptureParams {
2463
2498
  * one conversation reaches another pipeline too. At most 32 in all.
2464
2499
  */
2465
2500
  labels?: string[];
2501
+ /**
2502
+ * The feedback you already have for this exchange, written with it, so no
2503
+ * second call is needed. Refused (400) before anything is stored when it is
2504
+ * unusable. Send `request_id` too: a retry under it records the feedback
2505
+ * once.
2506
+ */
2507
+ feedback?: LoopCaptureFeedback;
2508
+ }
2509
+ /** Feedback sent with a capture: good, bad, or corrected with the right answer. */
2510
+ export interface LoopCaptureFeedback {
2511
+ verdict: LoopFeedbackWord;
2512
+ /** Required with `corrected`, and read only then: the answer that should have been given. */
2513
+ correction?: string;
2466
2514
  }
2467
2515
  export interface LoopCaptureResult {
2468
2516
  captured: boolean;
@@ -2641,13 +2689,23 @@ export interface LoopSignal {
2641
2689
  metadata: Record<string, unknown> | null;
2642
2690
  created_at: string;
2643
2691
  }
2692
+ /** One feedback item for `loop.signalMany`: the sample's id and its feedback. */
2693
+ export interface LoopSignalManyItem extends LoopSignalParams {
2694
+ trace_id: string;
2695
+ }
2696
+ /** What became of one `signalMany` item: its signal, or the error it ended with. */
2697
+ export interface LoopSignalManyResult {
2698
+ trace_id: string;
2699
+ signal?: LoopSignal;
2700
+ error?: unknown;
2701
+ }
2644
2702
  export interface LoopSignalParams {
2645
- verdict: LoopVerdict;
2646
- source?: LoopSource;
2647
- /** Required when verdict is `edited`. The answer the model should have given. */
2703
+ /** A `LoopFeedbackVerdict`, or its plain word (`good`, `bad`, `corrected`: see `LoopFeedbackWord`). */
2704
+ verdict: LoopFeedbackVerdict | LoopFeedbackWord;
2705
+ /** Always `human` when sent: feedback is a person's. Other sources are refused 400. */
2706
+ source?: 'human';
2707
+ /** Required when verdict is `edited`, `corrected` or `gold`. The answer the model should have given. */
2648
2708
  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
2709
  /** A value or fact the answer can be checked against. Kept with the verdict; a pipeline trains on `correction`, not on this. */
2652
2710
  ground_truth?: string;
2653
2711
  reason?: string;
@@ -2771,12 +2829,23 @@ export interface LoopTraceListParams {
2771
2829
  signal?: 'good' | 'bad' | 'corrected';
2772
2830
  /** Only the conversations nobody has given feedback on yet. */
2773
2831
  unsignalled?: boolean;
2832
+ /**
2833
+ * Text search: 2 to 200 characters, case-insensitive, matched as written
2834
+ * (`%` and `_` are plain characters) in every message, the answer and the
2835
+ * answer's tool calls. Combines with every other filter.
2836
+ */
2837
+ q?: string;
2774
2838
  }
2775
2839
  export interface LoopTraceListResponse {
2776
2840
  traces: LoopTrace[];
2777
2841
  total: number;
2778
2842
  limit: number;
2779
2843
  offset: number;
2844
+ /**
2845
+ * Present only when `q` was sent: how many of the samples the other filters
2846
+ * select keep their text in your own storage and so were not searched.
2847
+ */
2848
+ unsearched?: number;
2780
2849
  }
2781
2850
  export interface LoopConfig {
2782
2851
  deployment_id: string;
@@ -2817,6 +2886,32 @@ export interface LoopStats {
2817
2886
  ready: {
2818
2887
  sft: number;
2819
2888
  };
2889
+ /**
2890
+ * The calls sent with `X-Loop-Pipeline` in the last `days` days (UTC) that
2891
+ * were not recorded under a tag, most first. Empty when every one was.
2892
+ */
2893
+ capture: LoopCaptureHealth;
2894
+ }
2895
+ /** `LoopStats.capture` and `Pipeline.capture`: what the one-header capture did not record. */
2896
+ export interface LoopCaptureHealth {
2897
+ /** The window, in days, today included. */
2898
+ days: number;
2899
+ not_recorded: LoopCaptureMiss[];
2900
+ }
2901
+ /**
2902
+ * Calls under ONE tag that were not recorded, and why. A call naming two tags
2903
+ * is counted under each, so rows are not added up as calls.
2904
+ */
2905
+ export interface LoopCaptureMiss {
2906
+ tag: string;
2907
+ /**
2908
+ * `no_pipeline`: no pipeline has the tag (misspelt, never made, or deleted).
2909
+ * `too_large`: the answer was larger than the platform keeps for a sample.
2910
+ * `incomplete`: the answer was cut short, or had no text and no tool call.
2911
+ */
2912
+ reason: 'no_pipeline' | 'too_large' | 'incomplete';
2913
+ calls: number;
2914
+ last_at: string;
2820
2915
  }
2821
2916
  /** One pipeline a conversation falls inside (GET /api/loop/traces/{id}/pipelines). */
2822
2917
  export interface LoopTracePipeline {
@@ -2982,8 +3077,9 @@ export type TrainingTrigger = 'rows' | 'cadence' | 'both' | 'manual' | 'variant'
2982
3077
  * What it trained on (`train_rows`) is `new_samples` (new since the attempt
2983
3078
  * before it) + `carried_samples` (trained by the attempts in
2984
3079
  * `carried_from_attempts`, which did not go live) + `replayed_samples` (about
2985
- * a fifth of what it trained on, drawn at random from what the versions it
2986
- * builds on already learned, so it does not forget them). `learned_before` is
3080
+ * half of what it trained on -- as many as it had not learned, or all the
3081
+ * versions it builds on learned when that is fewer -- drawn at random from
3082
+ * what they already learned, so it does not forget them). `learned_before` is
2987
3083
  * how many samples those versions had learned: they are not trained again,
2988
3084
  * except the replayed ones. An attempt from the base trains on every sample
2989
3085
  * it can: `new_samples` is all of them, and the other three counts are 0.
@@ -2994,8 +3090,9 @@ export type TrainingTrigger = 'rows' | 'cadence' | 'both' | 'manual' | 'variant'
2994
3090
  * `served_as` is `adapter` for an attempt from the base and `merged` for one
2995
3091
  * built on versions (one model with every version merged in). A winner is
2996
3092
  * merged in and served as one model. `learned_deleted_conversation` is true
2997
- * when a conversation it trained on has since been deleted: a rebuild
2998
- * without it is on its way, and it can no longer be rolled back to.
3093
+ * when it -- or a version it was built on, whose model is merged into it --
3094
+ * learned a conversation that has since been deleted: a rebuild without it is
3095
+ * on its way, and it can no longer be rolled back to.
2999
3096
  */
3000
3097
  export interface Lineage {
3001
3098
  trained_from: 'base' | 'versions';
@@ -3022,6 +3119,12 @@ export interface TrainingRecipe {
3022
3119
  num_train_epochs: number | null;
3023
3120
  lora_rank: number | null;
3024
3121
  lora_alpha: number | null;
3122
+ /**
3123
+ * True when one of the pipeline's own training settings ({@link Pipeline.training})
3124
+ * was applied over the automatic recipe for this run, frozen when it started;
3125
+ * false when it trained on automatic settings throughout.
3126
+ */
3127
+ custom: boolean;
3025
3128
  }
3026
3129
  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
3130
  /**
@@ -3249,6 +3352,15 @@ export interface TrainingRun {
3249
3352
  candidate_name: string | null;
3250
3353
  candidate_seq: number;
3251
3354
  candidate_status: string | null;
3355
+ /**
3356
+ * One boot window after the comparison machine was first seen on a GPU, set
3357
+ * once per booking (a booking after a wait for GPUs sets its own). Not
3358
+ * always the deadline the boot is held to: time the machine has no pod while
3359
+ * it waits for another GPU is not counted (except while a base model's
3360
+ * machine bills beside it), so the attempt can stay in candidate_booking
3361
+ * past this time, by at most one more window. An attempt that ran out
3362
+ * gives the deadline it was held to on its expiry event (deadline_at).
3363
+ */
3252
3364
  candidate_deadline_at: string | null;
3253
3365
  candidate_cleanup_at: string | null;
3254
3366
  evaluation_id: string | null;
@@ -3916,6 +4028,8 @@ export interface BenchmarkItemListParams {
3916
4028
  offset?: number;
3917
4029
  }
3918
4030
  export interface BenchmarkHistoryParams {
4031
+ /** Only the points of this pipeline's attempts (its id, `rule_id`). */
4032
+ pipeline?: string;
3919
4033
  /** 50 when absent; at most 200. */
3920
4034
  limit?: number;
3921
4035
  offset?: number;
@@ -3944,10 +4058,10 @@ export interface BenchmarkRetireParams {
3944
4058
  * after a deleted conversation (`chain.rebuild`) is not held by the limit:
3945
4059
  * Train now starts it, and each one that goes live is a version, so the
3946
4060
  * pipeline can end past its limit.
3947
- * - `MONTHLY_LIMIT_REACHED` (409): the most this month's attempts can have
3948
- * cost plus the most one more may cost would pass the pipeline's internal
3949
- * monthly limit. The body carries the figures:
3950
- * see {@link TrainingRuleMonthlyLimitRefusal}.
4061
+ * - `MONTHLY_LIMIT_REACHED` (409): the pipeline has reached its monthly
4062
+ * safety limit. The body carries `resumes_at`, and `error.message` says
4063
+ * what holds the pipeline and when the next attempt can start, with no
4064
+ * amount: see {@link TrainingRuleMonthlyLimitRefusal}.
3951
4065
  * - `SCORING_CAPPED` (409): the key the comparison runs under is at its
3952
4066
  * monthly cap, so what this attempt trained could not be scored. The body
3953
4067
  * carries `resumes_at`, when the cap lifts (the next UTC month, or sooner
@@ -4002,6 +4116,8 @@ export type TrainingRuleRunRefusalCode = 'NOT_ENOUGH_SAMPLES' | 'PIPELINE_NEEDS_
4002
4116
  * pipeline's current one (ignoring case) is kept, and whether it can still
4003
4117
  * be trained is checked when an attempt starts.
4004
4118
  * - `NO_GPU_FITS` (422): no machines can train or serve the model right now.
4119
+ * - `TRAINING_SETTING_OUT_OF_RANGE` (422): a `training` setting is outside its
4120
+ * range; the message names the field and the range. Nothing was saved.
4005
4121
  * - `MODEL_REVISION_UNAVAILABLE` (422): the model could not be pinned to an
4006
4122
  * exact revision because the training service did not answer. Try again
4007
4123
  * once it does.
@@ -4028,37 +4144,25 @@ export type TrainingRuleRunRefusalCode = 'NOT_ENOUGH_SAMPLES' | 'PIPELINE_NEEDS_
4028
4144
  * the key every comparison is scored with) did not answer just then. Try
4029
4145
  * again in a minute.
4030
4146
  */
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';
4147
+ 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
4148
  /**
4033
4149
  * The body of a manual run refused `409 MONTHLY_LIMIT_REACHED`, as
4034
- * `ApiError.body` carries it.
4035
- *
4036
- * The test is the worst case, not the average: a run may start only if the
4037
- * most the rule's runs this UTC calendar month can have cost
4038
- * (`month_spent_cents`), plus the most the run about to start may spend
4039
- * (`run_max_cents`), fits under the limit.
4150
+ * `ApiError.body` carries it: the pipeline's monthly safety limit holds it.
4151
+ * The limit is the platform's guard, set from the model's prices; the member
4152
+ * never sets it, so its figures are neither fields of the answer nor in
4153
+ * `message`, which says what holds the pipeline and when the next attempt can
4154
+ * start.
4040
4155
  */
4041
4156
  export interface TrainingRuleMonthlyLimitRefusal {
4042
4157
  error: {
4043
4158
  code: 'MONTHLY_LIMIT_REACHED';
4044
4159
  message: string;
4045
4160
  };
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
4161
  /**
4058
- * The first instant of the next UTC month, when the counted spend starts
4059
- * again from nothing. When `run_max_cents` alone exceeds the limit, no month
4060
- * will ever fit: saving the pipeline sets the limit again from its model's
4061
- * prices, and nothing else changes it; `message` says which.
4162
+ * The first instant of the next UTC month, when the month's count starts
4163
+ * again from nothing. When one attempt alone can cost more than the whole
4164
+ * limit, no month will ever fit: saving the pipeline sets the limit again
4165
+ * from its model's prices, and nothing else changes it; `message` says which.
4062
4166
  */
4063
4167
  resumes_at: string;
4064
4168
  }
@@ -4136,10 +4240,8 @@ export interface PipelineVersion {
4136
4240
  verdict: TrainingVerdict | null;
4137
4241
  decision: TrainingDecision | null;
4138
4242
  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
4243
  /** True for the version the app is served by today. */
4142
- is_champion: boolean;
4244
+ is_live: boolean;
4143
4245
  /** When it was first put live. */
4144
4246
  promoted_at: string | null;
4145
4247
  checkpoint_id: string | null;
@@ -4261,6 +4363,69 @@ export interface PipelineAttempt {
4261
4363
  evaluation_id: string | null;
4262
4364
  /** Its last sentence. */
4263
4365
  reason: string | null;
4366
+ /**
4367
+ * What became of it in plain words, written by the service from its state,
4368
+ * verdict and error. See {@link AttemptExplanation}.
4369
+ */
4370
+ explanation: AttemptExplanation | null;
4371
+ }
4372
+ /**
4373
+ * An attempt's outcome in plain words: `headline` ("Could not be tested"),
4374
+ * `detail` (what happened and why) and `next` (what happens now; null when
4375
+ * there is nothing to say).
4376
+ */
4377
+ export interface AttemptExplanation {
4378
+ headline: string;
4379
+ detail: string;
4380
+ next: string | null;
4381
+ }
4382
+ /**
4383
+ * A pipeline's own training settings, each null while it is automatic (the
4384
+ * platform's value for its model, {@link PipelineTrainingDefaults}). A change
4385
+ * applies from the next attempt, and every attempt keeps the settings it
4386
+ * trained with on its `recipe` (`custom` true when one of these applied).
4387
+ * LoRA only: there is no full fine-tune, so the rank and alpha always apply.
4388
+ */
4389
+ export interface PipelineTrainingSettings {
4390
+ /** Passes over the data, 1 to 15. */
4391
+ epochs: number | null;
4392
+ /** 1e-6 to 1e-2. */
4393
+ learning_rate: number | null;
4394
+ /** 4, 8, 16, 32 or 64. */
4395
+ lora_rank: number | null;
4396
+ /** 1 to 512. */
4397
+ lora_alpha: number | null;
4398
+ /**
4399
+ * 0 to 50: the share of already-learned samples an attempt replays when it
4400
+ * builds on the live version, so the new version does not forget them.
4401
+ */
4402
+ replay_percent: number | null;
4403
+ }
4404
+ /**
4405
+ * What automatic means for this pipeline's model: what an attempt trains with
4406
+ * where {@link PipelineTrainingSettings} says null. The automatic recipe picks
4407
+ * its passes from `min_epochs` to `max_epochs` (at least 8 for Gemma 4).
4408
+ */
4409
+ export interface PipelineTrainingDefaults {
4410
+ learning_rate: number;
4411
+ lora_rank: number;
4412
+ lora_alpha: number;
4413
+ replay_percent: number;
4414
+ min_epochs: number;
4415
+ max_epochs: number;
4416
+ }
4417
+ /**
4418
+ * The training settings a create or edit sends. Every key is three-state:
4419
+ * absent keeps the pipeline's, null puts it back to automatic, a number sets
4420
+ * it. Out of range is refused 422 `TRAINING_SETTING_OUT_OF_RANGE` naming the
4421
+ * field and its range.
4422
+ */
4423
+ export interface PipelineTrainingRequest {
4424
+ epochs?: number | null;
4425
+ learning_rate?: number | null;
4426
+ lora_rank?: number | null;
4427
+ lora_alpha?: number | null;
4428
+ replay_percent?: number | null;
4264
4429
  }
4265
4430
  /** A model and the exact commit of it. */
4266
4431
  export interface PipelineModelRef {
@@ -4374,7 +4539,8 @@ export interface PipelineChainRebuild {
4374
4539
  * pipeline trained is live on its current model, and when the pipeline does
4375
4540
  * not build on its live version (then every attempt trains from the base on
4376
4541
  * all samples). `learned_samples` is how many samples those versions learned
4377
- * (the next attempt does not train them again, except a replayed fifth);
4542
+ * (the next attempt does not train them again, except the replay, about
4543
+ * half of what it trains on);
4378
4544
  * `not_learned_samples` is how many were trained by attempts that did not go
4379
4545
  * live, so the next attempt trains them again. Null on the list.
4380
4546
  */
@@ -4401,6 +4567,15 @@ export interface Pipeline {
4401
4567
  own_tag: string | null;
4402
4568
  /** A conversation carrying ANY of these tags is this pipeline's data. */
4403
4569
  tags: string[];
4570
+ /**
4571
+ * The calls sent with `X-Loop-Pipeline` in the last `days` days that were
4572
+ * not recorded: under this pipeline's tags (an answer too large to keep, or
4573
+ * cut short), and under any tag no pipeline had (`no_pipeline`: a misspelt
4574
+ * tag, or a deleted pipeline's). One row per tag: a call naming two tags is
4575
+ * counted under each, so rows are not added up as calls. Null on the list,
4576
+ * and when it could not be read: only `pipelines.get` reads it.
4577
+ */
4578
+ capture: LoopCaptureHealth | null;
4404
4579
  /**
4405
4580
  * A second base model, trained from its own base on all samples after each
4406
4581
  * attempt (it never builds on this pipeline's versions, which are another
@@ -4414,6 +4589,10 @@ export interface Pipeline {
4414
4589
  holdout: PipelineHoldout;
4415
4590
  /** Rows the next version holds back and never trains on. Detail only; null on the list. */
4416
4591
  holdout_size: number | null;
4592
+ /** Its training settings, each null while automatic. See {@link PipelineTrainingSettings}. */
4593
+ training: PipelineTrainingSettings;
4594
+ /** What automatic means for its model. See {@link PipelineTrainingDefaults}. */
4595
+ training_defaults: PipelineTrainingDefaults;
4417
4596
  minimums: PipelineMinimums;
4418
4597
  /**
4419
4598
  * The pinned base every version is trained over: from it, or, where the
@@ -4424,8 +4603,6 @@ export interface Pipeline {
4424
4603
  base_model_revision: string;
4425
4604
  /** The version serving now; null when what serves is not a version of this pipeline. */
4426
4605
  live_version: number | null;
4427
- /** The same number under its older name. */
4428
- champion_version: number | null;
4429
4606
  /**
4430
4607
  * Whether the deployment the live version answers from is up, as the
4431
4608
  * platform last checked it. Null when there is no live version, when what
@@ -4444,10 +4621,6 @@ export interface Pipeline {
4444
4621
  * does. Null when nothing has taken the name over.
4445
4622
  */
4446
4623
  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
4624
  status: PipelineStatus;
4452
4625
  /**
4453
4626
  * The rule's own sentence about what it is waiting for or why it stopped,
@@ -4457,7 +4630,6 @@ export interface Pipeline {
4457
4630
  next_reason: string | null;
4458
4631
  last_checked_at: string | null;
4459
4632
  next_due_at: string | null;
4460
- auto_promote: boolean;
4461
4633
  /**
4462
4634
  * Why the platform stopped firing this rule, or null. `consent_invalid` is
4463
4635
  * a pipeline whose settings changed since it was last saved: saving it
@@ -4471,26 +4643,18 @@ export interface Pipeline {
4471
4643
  * trains on its own: an attempt would train and could not be compared.
4472
4644
  */
4473
4645
  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
4646
  active_run: PipelineActiveRun | null;
4491
- /** Winners only, v1 first. */
4647
+ /** How many versions it has made: every one is in `versions` from `getPipeline`, only the latest few and the live one on `listPipelines`. */
4648
+ versions_total: number;
4649
+ /** How many attempts it has made; `attempts` holds only the latest of them. */
4650
+ attempts_total: number;
4651
+ /** Winners only, v1 first: every one from `getPipeline`, the latest few and the live one on `listPipelines`. */
4492
4652
  versions: PipelineVersion[];
4493
- /** Every attempt, attempt 1 first. */
4653
+ /**
4654
+ * Its latest attempts, in attempt order: 20 from `getPipeline`, 5 on each
4655
+ * pipeline of `listPipelines`. `attempts_total` says how many there are,
4656
+ * and `listPipelineAttempts` pages through every one.
4657
+ */
4494
4658
  attempts: PipelineAttempt[];
4495
4659
  }
4496
4660
  export interface TrainingRuleDeleteResponse {
@@ -4647,12 +4811,23 @@ export interface BenchmarkHistoryResponse {
4647
4811
  points: BenchmarkHistoryPoint[];
4648
4812
  total: number;
4649
4813
  }
4814
+ /**
4815
+ * The pipeline list's `status` filter: `training` (an attempt is running),
4816
+ * `needs_you` (waiting on a member: a review or funds), `serving` (its live
4817
+ * version answers) and `paused`.
4818
+ */
4819
+ export type PipelineListStatus = 'training' | 'needs_you' | 'serving' | 'paused';
4650
4820
  export interface PipelineListParams {
4821
+ /** 100 when absent; at most 100. */
4822
+ limit?: number;
4651
4823
  /** How many of the newest pipelines to skip: the page after one that started at N starts at N + its length. */
4652
4824
  offset?: number;
4825
+ /** A case-insensitive substring of the name, the tag or the model. */
4826
+ q?: string;
4827
+ status?: PipelineListStatus;
4653
4828
  }
4654
4829
  export interface PipelineListResponse {
4655
- /** The newest pipelines first, at most the service's page (100). */
4830
+ /** The newest pipelines first, one page (100 unless `limit` says; at most 100). */
4656
4831
  pipelines: Pipeline[];
4657
4832
  /** Every pipeline in the workspace, including any not returned. */
4658
4833
  total: number;
@@ -4662,6 +4837,22 @@ export interface PipelineListResponse {
4662
4837
  export interface PipelineResponse {
4663
4838
  pipeline: Pipeline;
4664
4839
  }
4840
+ /** What became of an attempt, as `listPipelineAttempts` filters it. */
4841
+ export type PipelineAttemptResultFilter = 'became_version' | 'not_better' | 'inconclusive' | 'failed' | 'stopped' | 'running' | 'waiting_for_review';
4842
+ /** Which model's attempts: the pipeline's own (`main`) or its second model's (`second`). */
4843
+ export type PipelineAttemptModelFilter = 'main' | 'second';
4844
+ export interface PipelineAttemptListParams {
4845
+ /** 50 when absent; at most 200. */
4846
+ limit?: number;
4847
+ offset?: number;
4848
+ result?: PipelineAttemptResultFilter;
4849
+ model?: PipelineAttemptModelFilter;
4850
+ }
4851
+ /** One page of a pipeline's attempts, newest first. `total` follows the filters. */
4852
+ export interface PipelineAttemptListResponse {
4853
+ attempts: PipelineAttempt[];
4854
+ total: number;
4855
+ }
4665
4856
  /**
4666
4857
  * The body of `POST /api/loop/pipelines` and (every field optional)
4667
4858
  * `PUT /api/loop/pipelines/{id}`. Everything else -- the machines, the money,
@@ -4718,6 +4909,12 @@ export interface PipelineWriteRequest {
4718
4909
  /** 1 to 100, or null for no limit (the default). Counts versions, not attempts. */
4719
4910
  max_versions?: number | null;
4720
4911
  enabled?: boolean;
4912
+ /**
4913
+ * The pipeline's training settings. Absent: unchanged on an edit (automatic
4914
+ * on a create). null: every one back to automatic. An object: only the keys
4915
+ * it carries change, each null for automatic. See {@link PipelineTrainingRequest}.
4916
+ */
4917
+ training?: PipelineTrainingRequest | null;
4721
4918
  /** An edit's compare-and-set. */
4722
4919
  expected_revision?: number;
4723
4920
  }
@@ -4770,8 +4967,25 @@ export interface HeldBackFloors {
4770
4967
  max_percent: number;
4771
4968
  scored_rows: number;
4772
4969
  }
4970
+ /** Why a model is not offered for a pipeline ({@link LoopUnavailableModel.reason_code}). */
4971
+ export type LoopUnavailableReasonCode = 'not_trainable_sft_lora' | 'not_servable_as_adapter' | 'too_large_for_available_gpus' | 'not_verified' | 'registry_missing';
4972
+ /**
4973
+ * A model the platform knows that a pipeline cannot use, and why. `reason` is
4974
+ * one plain sentence to show as it is; `reason_code` is one of
4975
+ * {@link LoopUnavailableReasonCode}, typed as a string so a code added later
4976
+ * still carries its sentence.
4977
+ */
4978
+ export interface LoopUnavailableModel {
4979
+ id: string;
4980
+ name: string;
4981
+ family: string | null;
4982
+ reason_code: string;
4983
+ reason: string;
4984
+ }
4773
4985
  export interface LoopModelsResponse {
4774
4986
  models: LoopModel[];
4987
+ /** Every other model the platform knows, each with why it is not offered here. */
4988
+ unavailable: LoopUnavailableModel[];
4775
4989
  floors: PipelineFloors;
4776
4990
  }
4777
4991
  /** 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.2.22",
3
+ "version": "0.3.0-dev.323",
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",