runbios-sdk 0.2.19-dev.274 → 0.2.19-dev.277

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 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.19-dev.274";
39
+ export declare const VERSION = "0.2.19-dev.277";
40
40
  export declare class RunBiOS {
41
41
  /** Search models, fetch configs, check adapter compatibility. */
42
42
  readonly models: Models;
@@ -75,7 +75,7 @@ export { Training } from './resources/training.js';
75
75
  export { Wallet } from './resources/wallet.js';
76
76
  export { GPU, type GPURecommendation } from './resources/gpu.js';
77
77
  export { Inference, validateChatRequest, parseSSE, buildInferenceRequest, contextSizingBasis, type ContextSizingBasis, CONTEXT_DEFAULT_CEILING, CONTEXT_EDITABLE_FLOOR, type ChatMessage, type FunctionTool, type ChatCompletionParams, type ChatCompletionResponse, type ChatCompletionChunk, type InferenceVerbParams, type CompletionParams, type EmbeddingParams, type RerankParams, type AnthropicMessageParams, type ServerlessUsageWindow, type ServerlessTimeseriesMetric, type ServerlessWorkspaceLimits, type ServerlessUsageEnvelope, type ServerlessUsageOverviewResponse, type ServerlessUsageRowsResponse, type ServerlessUsageTimeseriesResponse, type ServerlessUsageDailyResponse, type ServerlessSavingsTotals, type ServerlessSavingsPeriod, type ServerlessUsageSavingsResponse, } from './resources/inference.js';
78
- export type { BiOSConfig, PaginatedResponse, ApiErrorBody, AvailableGpuAlternative, CapacityMinimumRequirement, InferenceBookingAccepted, Model, ModelSearchParams, ModelSearchResponse, ModelDetailResponse, InferenceModel, InferenceModelListResponse, ModelConfig, Dataset, DatasetListParams, DatasetListResponse, DatasetUploadParams, DatasetPreview, DatasetPreviewParams, DatasetImportHFParams, DatasetRegisterHFParams, DatasetHubSearchParams, DatasetHubPreviewParams, DatasetValidation, DatasetFormatVariant, DatasetFormatSpec, DatasetFormatSpecs, DatasetStorageUsage, TrainingMethod, RLHFAlgorithm, AdapterType, TrainingJobStatus, TrainingStatusFilter, TrainingCreateParams, TrainingListParams, TrainingListResponse, TrainingJob, TrainingMetrics, TrainingResourceMetrics, TrainingDeviceMetrics, MetricPoint, MetricGraphConfig, TrainingCheckpoint, TrainingLogs, TrainingLogEntry, TrainingStopResponse, TrainingResumeResponse, CanonicalTrainingRequest, TrainingPreflightDataset, TrainingPreflightWarning, TrainingPreflightResponse, TrainingCapabilityChoice, TrainingConfigFieldCapability, TrainingCapabilities, GPUChoice, WalletBalance, Transaction, TransactionListResponse, TransactionListParams, GPUInfo, GPUPricingResponse, GPUOptionsParams, TrainingRecommendParams, TrainingAdvisorVerdict, TrainingAdvisorRecommendation, TrainingAdvisorUserShape, TrainingAdvisorJustification, TrainingAdvisorBasis, GPUOption, GPUOptionSuggestion, GPUOptionsResponse, InferenceStatus, InferenceCreateParams, InferenceUpdateParams, InferenceDeployment, InferenceDeploymentSummary, InferenceCreateResponse, InferenceListResponse, InferenceUpdateResponse, InferenceLifecycleResponse, InferenceDeleteResponse, InferenceGPUOptionMarket, InferenceGPUOption, InferenceGPUAlternative, InferenceGPUOptionsParams, InferenceGPUOptionsResponse, InferenceCanonicalRequest, InferencePreflightWarning, InferencePreflightResponse, AdapterCompatibility, AdapterCompatibilityResponse, AdapterCompatibilityParams, SupportedArchitecture, ArchitectureScope, SupportedArchitecturesResponse, ApiKey, ApiKeyScope, ApiKeyIntrospection, Organization, OrgMember, OrgInvite, Workspace, Integration, IntegrationCreateParams, StorageUsage, StorageObject, PromptTokensDetails, ChatCompletionUsage, ServingKind, TrainingRulePausedReason, TrainingTrigger, TrainingRecipe, TrainingRunState, TrainingVerdict, TrainingDecision, NotifyState, EvaluationStatus, EvaluationItemStatus, EvaluationWinner, EvaluationItemWinnerFilter, EvaluationWarningCode, TrainingToolCall, TrainingMessage, TrainingRuleServing, TrainingRunPromoteRequest, TrainingRunRejectRequest, TrainingRunRollbackRequest, TrainingRunCancelRequest, TrainingRunListParams, TrainingRun, TrainingRunSummary, TrainingRunEvent, TrainingRunLinks, TrainingRunActions, EvaluationRef, EvaluationDecoding, EvaluationJudgeDimension, EvaluationDimensionScore, EvaluationWarning, EvaluationMargin, JudgeAgreementDimension, JudgeAgreement, Evaluation, EvaluationItemSide, EvaluationItem, EvaluationItemListParams, BenchmarkStatus, BenchmarkSourceKind, BenchmarkRunStatus, BenchmarkScoring, BenchmarkDimensionScore, Benchmark, BenchmarkItem, BenchmarkRun, BenchmarkHistoryPoint, BenchmarkSource, BenchmarkCreateParams, BenchmarkListParams, BenchmarkItemListParams, BenchmarkHistoryParams, BenchmarkRetireParams, InferenceAlias, InferenceAliasRequest, TrainingRuleDeleteResponse, TrainingRunListResponse, TrainingRunResponse, TrainingRunActionResponse, EvaluationItemsResponse, InferenceAliasListResponse, InferenceAliasResponse, InferenceAliasDeleteResponse, BenchmarkListResponse, BenchmarkItemsResponse, BenchmarkHistoryResponse, TrainingRuleRunRefusalCode, TrainingRuleSaveRefusalCode, TrainingRuleMonthlyLimitRefusal, PipelineStatus, PipelineActiveRun, PipelineVersion, PipelineAttempt, PipelineAttemptTrigger, PipelineAttemptOutcome, Pipeline, PipelineListParams, PipelineListResponse, PipelineResponse, PipelineTrainWhen, PipelineSchedule, PipelineWriteRequest, PipelineMutationResponse, PipelineImportParams, PipelineFloors, LoopModel, LoopModelsResponse, LoopTracePipeline, LoopTracePipelinesResponse, LoopMetricsHistoryParams, LoopMetricPoint, LoopSignalDay, LoopMetricsHistory, PromotionPolicyState, RuleBenchmark, PipelineBenchmarksResponse, PipelineBenchmarkAttachParams, PipelineBenchmarkMoveParams, CompareBenchmark, VersionBenchmarkScore, PromotionMeasurement, PromotionOutcome, VersionScores, VersionScoreDifference, VersionCompareResponse, VersionCompareParams, } from './types.js';
78
+ export type { BiOSConfig, PaginatedResponse, ApiErrorBody, AvailableGpuAlternative, CapacityMinimumRequirement, InferenceBookingAccepted, Model, ModelSearchParams, ModelSearchResponse, ModelDetailResponse, InferenceModel, InferenceModelListResponse, ModelConfig, Dataset, DatasetListParams, DatasetListResponse, DatasetUploadParams, DatasetPreview, DatasetPreviewParams, DatasetImportHFParams, DatasetRegisterHFParams, DatasetHubSearchParams, DatasetHubPreviewParams, DatasetValidation, DatasetFormatVariant, DatasetFormatSpec, DatasetFormatSpecs, DatasetStorageUsage, TrainingMethod, RLHFAlgorithm, AdapterType, TrainingJobStatus, TrainingStatusFilter, TrainingCreateParams, TrainingListParams, TrainingListResponse, TrainingJob, TrainingMetrics, TrainingResourceMetrics, TrainingDeviceMetrics, MetricPoint, MetricGraphConfig, TrainingCheckpoint, TrainingLogs, TrainingLogEntry, TrainingStopResponse, TrainingResumeResponse, CanonicalTrainingRequest, TrainingPreflightDataset, TrainingPreflightWarning, TrainingPreflightResponse, TrainingCapabilityChoice, TrainingConfigFieldCapability, TrainingCapabilities, GPUChoice, WalletBalance, Transaction, TransactionListResponse, TransactionListParams, GPUInfo, GPUPricingResponse, GPUOptionsParams, TrainingRecommendParams, TrainingAdvisorVerdict, TrainingAdvisorRecommendation, TrainingAdvisorUserShape, TrainingAdvisorJustification, TrainingAdvisorBasis, GPUOption, GPUOptionSuggestion, GPUOptionsResponse, InferenceStatus, InferenceCreateParams, InferenceUpdateParams, InferenceDeployment, InferenceDeploymentSummary, InferenceCreateResponse, InferenceListResponse, InferenceUpdateResponse, InferenceLifecycleResponse, InferenceDeleteResponse, InferenceGPUOptionMarket, InferenceGPUOption, InferenceGPUAlternative, InferenceGPUOptionsParams, InferenceGPUOptionsResponse, InferenceCanonicalRequest, InferencePreflightWarning, InferencePreflightResponse, AdapterCompatibility, AdapterCompatibilityResponse, AdapterCompatibilityParams, SupportedArchitecture, ArchitectureScope, SupportedArchitecturesResponse, ApiKey, ApiKeyScope, ApiKeyIntrospection, Organization, OrgMember, OrgInvite, Workspace, Integration, IntegrationCreateParams, StorageUsage, StorageObject, PromptTokensDetails, ChatCompletionUsage, ServingKind, TrainingRulePausedReason, TrainingTrigger, TrainingRecipe, TrainingRunState, TrainingVerdict, TrainingDecision, NotifyState, EvaluationStatus, EvaluationItemStatus, EvaluationWinner, EvaluationItemWinnerFilter, EvaluationWarningCode, TrainingToolCall, TrainingMessage, TrainingRuleServing, TrainingRunPromoteRequest, TrainingRunRejectRequest, TrainingRunRollbackRequest, TrainingRunCancelRequest, TrainingRunListParams, TrainingRun, TrainingRunSummary, TrainingRunEvent, TrainingRunLinks, TrainingRunActions, EvaluationRef, EvaluationDecoding, EvaluationJudgeDimension, EvaluationDimensionScore, EvaluationWarning, EvaluationMargin, Evaluation, EvaluationItemSide, EvaluationItem, EvaluationItemListParams, BenchmarkStatus, BenchmarkSourceKind, BenchmarkRunStatus, BenchmarkScoring, BenchmarkDimensionScore, Benchmark, BenchmarkItem, BenchmarkRun, BenchmarkHistoryPoint, BenchmarkSource, BenchmarkCreateParams, BenchmarkListParams, BenchmarkItemListParams, BenchmarkHistoryParams, BenchmarkRetireParams, InferenceAlias, InferenceAliasRequest, TrainingRuleDeleteResponse, TrainingRunListResponse, TrainingRunResponse, TrainingRunActionResponse, EvaluationItemsResponse, InferenceAliasListResponse, InferenceAliasResponse, InferenceAliasDeleteResponse, BenchmarkListResponse, BenchmarkItemsResponse, BenchmarkHistoryResponse, TrainingRuleRunRefusalCode, TrainingRuleSaveRefusalCode, TrainingRuleMonthlyLimitRefusal, PipelineStatus, PipelineActiveRun, PipelineVersion, PipelineAttempt, PipelineAttemptTrigger, PipelineAttemptOutcome, Pipeline, PipelineListParams, PipelineListResponse, PipelineResponse, PipelineTrainWhen, PipelineSchedule, PipelineWriteRequest, PipelineMutationResponse, PipelineImportParams, PipelineFloors, LoopModel, LoopModelsResponse, LoopTracePipeline, LoopTracePipelinesResponse, LoopMetricsHistoryParams, LoopMetricPoint, LoopSignalDay, LoopMetricsHistory, PromotionPolicyState, RuleBenchmark, PipelineBenchmarksResponse, PipelineBenchmarkAttachParams, PipelineBenchmarkMoveParams, CompareBenchmark, VersionBenchmarkScore, PromotionMeasurement, PromotionOutcome, VersionScores, VersionScoreDifference, VersionCompareResponse, VersionCompareParams, } from './types.js';
79
79
  /** The closed set of run states a training run never leaves. */
80
80
  export { TERMINAL_RUN_STATES } from './types.js';
81
81
  /** The most versions a pipeline may be set to make. */
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.19-dev.274';
39
+ export const VERSION = '0.2.19-dev.277';
40
40
  export class RunBiOS {
41
41
  /** Search models, fetch configs, check adapter compatibility. */
42
42
  models;
@@ -88,10 +88,10 @@ export declare class Loop {
88
88
  * a corpus from a pile.
89
89
  *
90
90
  * Each row is read for what it actually is. A `prompt`/`chosen`/`rejected`
91
- * triple becomes a preference pair; an answer plus a yes-or-no becomes a
92
- * thumbs verdict; a question and an answer waits for review; a question with
93
- * no answer waits for an answer; a paragraph of prose is refused, because it
94
- * is not a conversation.
91
+ * triple becomes a correction (`chosen` is learned from); an answer plus a
92
+ * yes-or-no becomes a thumbs verdict; a question and an answer waits for
93
+ * review; a question with no answer waits for an answer; a paragraph of prose
94
+ * is refused, because it is not a conversation.
95
95
  *
96
96
  * A verdict that arrives *with* the file is kept -- discarding somebody's
97
97
  * judgement would be worse -- but it is recorded as having come from your
@@ -138,7 +138,14 @@ export declare class Loop {
138
138
  importRows(params: LoopImportParams): Promise<LoopImportResult>;
139
139
  /** List captured conversations, newest first. */
140
140
  listTraces(params?: LoopTraceListParams): Promise<LoopTraceListResponse>;
141
- /** Read one conversation, with every verdict recorded on it. */
141
+ /**
142
+ * Read one conversation, with every verdict and tag recorded on it.
143
+ *
144
+ * A conversation kept in your own storage carries `payload_stored_externally`.
145
+ * When its text could not be read just now it also carries
146
+ * `payload_unavailable`, with `messages` null and `completion` empty: it is
147
+ * not an empty conversation. Read it again later rather than reviewing it.
148
+ */
142
149
  getTrace(id: string): Promise<LoopTrace>;
143
150
  /**
144
151
  * Delete a conversation.
@@ -158,11 +165,11 @@ export declare class Loop {
158
165
  * Append-only: posting a second verdict does not replace the first. Two
159
166
  * reviewers disagreeing about an answer is information worth keeping.
160
167
  *
161
- * `source` says who judged: `human`, `verifier` (a deterministic check --
162
- * tests passed, schema valid), `judge` (a model grading a model), or
163
- * `behavioural` (what the user did next). When several disagree, a human
164
- * outranks a verifier, a verifier outranks a judge, and a judge outranks a
165
- * behavioural hint.
168
+ * What a pipeline trains on (every pipeline fine-tunes on examples): an
169
+ * `accepted` answer is an example as it stands; the `correction` of an
170
+ * `edited` or `gold` verdict is the example, in place of the model's answer;
171
+ * a `rejected` answer is left out. Nothing is learned from an answer that was
172
+ * rejected or replaced. `source` defaults to `human`.
166
173
  */
167
174
  signal(traceId: string, params: LoopSignalParams): Promise<LoopSignal>;
168
175
  /**
@@ -182,23 +189,18 @@ export declare class Loop {
182
189
  /**
183
190
  * The model was wrong; here is what it should have said.
184
191
  *
185
- * The most valuable feedback there is, because it produces BOTH halves of a
186
- * preference pair from one action: the model learns your answer and learns to
187
- * avoid its own.
192
+ * The most valuable feedback there is: your answer is trained on in place of
193
+ * the model's. Nothing is learned from the answer it replaced.
188
194
  */
189
195
  correct(traceId: string, answer: string, reason?: string): Promise<LoopSignal>;
190
196
  /**
191
197
  * Record the GOLD answer for this question — the reference, regardless of
192
198
  * what the model happened to say.
193
199
  *
194
- * Different from `correct()` in a way that matters: a correction asserts the
195
- * model was wrong, so the original becomes the rejected half of a pair. A gold
196
- * answer asserts nothing about the model, so if it MATCHES what was said, no
197
- * preference pair is invented — but SFT still learns it.
198
- *
199
- * It is the most reusable thing you can record: it trains SFT, forms a DPO
200
- * pair when it differs from the answer, and stands in as the GRPO reference
201
- * when you have not supplied a separate ground truth.
200
+ * A pipeline trains on it exactly as it does on a correction: the gold
201
+ * answer is the example, in place of the model's. The difference is only
202
+ * what it says: a correction says the model was wrong, a gold answer says
203
+ * nothing about the model.
202
204
  */
203
205
  gold(traceId: string, answer: string, reason?: string): Promise<LoopSignal>;
204
206
  /** Every verdict on one conversation, oldest first. */
@@ -356,8 +358,8 @@ export declare class Loop {
356
358
  *
357
359
  * `status` says whether it is the platform working (`running`), the member
358
360
  * who has to act (`needs_review`, `needs_funds`), or nothing at all until
359
- * somebody does (`paused`, with `paused_reason` or `needs_consent` saying
360
- * why; `complete` at `max_versions`). `month_spent_cents` is the figure the
361
+ * somebody does (`paused`, with `paused_reason` saying why; `complete` at
362
+ * `max_versions`). `month_spent_cents` is the figure the
361
363
  * monthly limit is enforced against: what runs started this month have cost
362
364
  * at most, not an exact spend.
363
365
  */
@@ -91,10 +91,10 @@ export class Loop {
91
91
  * a corpus from a pile.
92
92
  *
93
93
  * Each row is read for what it actually is. A `prompt`/`chosen`/`rejected`
94
- * triple becomes a preference pair; an answer plus a yes-or-no becomes a
95
- * thumbs verdict; a question and an answer waits for review; a question with
96
- * no answer waits for an answer; a paragraph of prose is refused, because it
97
- * is not a conversation.
94
+ * triple becomes a correction (`chosen` is learned from); an answer plus a
95
+ * yes-or-no becomes a thumbs verdict; a question and an answer waits for
96
+ * review; a question with no answer waits for an answer; a paragraph of prose
97
+ * is refused, because it is not a conversation.
98
98
  *
99
99
  * A verdict that arrives *with* the file is kept -- discarding somebody's
100
100
  * judgement would be worse -- but it is recorded as having come from your
@@ -182,7 +182,14 @@ export class Loop {
182
182
  const qs = q.toString();
183
183
  return this._http.fetchGet(`/api/loop/traces${qs ? `?${qs}` : ''}`);
184
184
  }
185
- /** Read one conversation, with every verdict recorded on it. */
185
+ /**
186
+ * Read one conversation, with every verdict and tag recorded on it.
187
+ *
188
+ * A conversation kept in your own storage carries `payload_stored_externally`.
189
+ * When its text could not be read just now it also carries
190
+ * `payload_unavailable`, with `messages` null and `completion` empty: it is
191
+ * not an empty conversation. Read it again later rather than reviewing it.
192
+ */
186
193
  async getTrace(id) {
187
194
  const res = await this._http.fetchGet(`/api/loop/traces/${encodeURIComponent(id)}`);
188
195
  return res.trace;
@@ -205,11 +212,11 @@ export class Loop {
205
212
  * Append-only: posting a second verdict does not replace the first. Two
206
213
  * reviewers disagreeing about an answer is information worth keeping.
207
214
  *
208
- * `source` says who judged: `human`, `verifier` (a deterministic check --
209
- * tests passed, schema valid), `judge` (a model grading a model), or
210
- * `behavioural` (what the user did next). When several disagree, a human
211
- * outranks a verifier, a verifier outranks a judge, and a judge outranks a
212
- * behavioural hint.
215
+ * What a pipeline trains on (every pipeline fine-tunes on examples): an
216
+ * `accepted` answer is an example as it stands; the `correction` of an
217
+ * `edited` or `gold` verdict is the example, in place of the model's answer;
218
+ * a `rejected` answer is left out. Nothing is learned from an answer that was
219
+ * rejected or replaced. `source` defaults to `human`.
213
220
  */
214
221
  async signal(traceId, params) {
215
222
  const res = await this._http.fetchPost(`/api/loop/traces/${encodeURIComponent(traceId)}/signals`, params);
@@ -236,9 +243,8 @@ export class Loop {
236
243
  /**
237
244
  * The model was wrong; here is what it should have said.
238
245
  *
239
- * The most valuable feedback there is, because it produces BOTH halves of a
240
- * preference pair from one action: the model learns your answer and learns to
241
- * avoid its own.
246
+ * The most valuable feedback there is: your answer is trained on in place of
247
+ * the model's. Nothing is learned from the answer it replaced.
242
248
  */
243
249
  async correct(traceId, answer, reason) {
244
250
  return this.signal(traceId, { verdict: 'edited', correction: answer, reason });
@@ -247,14 +253,10 @@ export class Loop {
247
253
  * Record the GOLD answer for this question — the reference, regardless of
248
254
  * what the model happened to say.
249
255
  *
250
- * Different from `correct()` in a way that matters: a correction asserts the
251
- * model was wrong, so the original becomes the rejected half of a pair. A gold
252
- * answer asserts nothing about the model, so if it MATCHES what was said, no
253
- * preference pair is invented — but SFT still learns it.
254
- *
255
- * It is the most reusable thing you can record: it trains SFT, forms a DPO
256
- * pair when it differs from the answer, and stands in as the GRPO reference
257
- * when you have not supplied a separate ground truth.
256
+ * A pipeline trains on it exactly as it does on a correction: the gold
257
+ * answer is the example, in place of the model's. The difference is only
258
+ * what it says: a correction says the model was wrong, a gold answer says
259
+ * nothing about the model.
258
260
  */
259
261
  async gold(traceId, answer, reason) {
260
262
  return this.signal(traceId, { verdict: 'gold', correction: answer, reason });
@@ -491,8 +493,8 @@ export class Loop {
491
493
  *
492
494
  * `status` says whether it is the platform working (`running`), the member
493
495
  * who has to act (`needs_review`, `needs_funds`), or nothing at all until
494
- * somebody does (`paused`, with `paused_reason` or `needs_consent` saying
495
- * why; `complete` at `max_versions`). `month_spent_cents` is the figure the
496
+ * somebody does (`paused`, with `paused_reason` saying why; `complete` at
497
+ * `max_versions`). `month_spent_cents` is the figure the
496
498
  * monthly limit is enforced against: what runs started this month have cost
497
499
  * at most, not an exact spend.
498
500
  */
package/dist/types.d.ts CHANGED
@@ -2297,18 +2297,17 @@ export interface ChatCompletionUsage {
2297
2297
  total_tokens: number;
2298
2298
  prompt_tokens_details?: PromptTokensDetails;
2299
2299
  }
2300
- /** What a training set is shaped for. The three need different things. */
2301
- export type LoopMethod = 'sft' | 'dpo' | 'grpo' | 'kto';
2302
- /** Who judged an answer. */
2300
+ /** Who gave a verdict. Feedback you send is `human` unless you say otherwise. */
2303
2301
  export type LoopSource = 'human' | 'verifier' | 'judge' | 'behavioural';
2304
- /** The judgement itself. */
2305
2302
  /**
2306
2303
  * The judgement recorded on an answer.
2307
2304
  *
2308
- * `accepted` / `rejected` are the thumbs (see `upvote` / `downvote`).
2309
- * `edited` says the model was WRONG and carries the better answer.
2305
+ * `accepted` / `rejected` are the thumbs (see `upvote` / `downvote`): an
2306
+ * accepted answer is trained on, a rejected one is left out.
2307
+ * `edited` says the model was WRONG and carries the better answer, which is
2308
+ * trained on in place of the model's.
2310
2309
  * `gold` records the reference answer for the question, making no claim about
2311
- * whether the model was right — which is why it is separate from `edited`.
2310
+ * whether the model was right; it is trained on the same way.
2312
2311
  */
2313
2312
  export type LoopVerdict = 'accepted' | 'rejected' | 'edited' | 'scored' | 'gold';
2314
2313
  /** A function an assistant turn asked to invoke. `arguments` is JSON-encoded. */
@@ -2495,7 +2494,7 @@ export interface LoopImportResult {
2495
2494
  not_saved_rows?: number[];
2496
2495
  /**
2497
2496
  * Rows whose CONVERSATION stored and whose VERDICT did not, and which rows
2498
- * those were. A preference pair or a thumbs label is two writes, and the
2497
+ * those were. A chosen/rejected row or a thumbs label is two writes, and the
2499
2498
  * second can fail on its own: the conversation is then in the loop carrying
2500
2499
  * nobody's judgement, counted under `needs_review` rather than `reviewed`,
2501
2500
  * and not trainable. The call rejects with {@link LoopImportIncompleteError},
@@ -2532,6 +2531,8 @@ export interface LoopSignal {
2532
2531
  ground_truth: string | null;
2533
2532
  reason: string | null;
2534
2533
  author: string | null;
2534
+ /** What the caller attached when recording it, or null. */
2535
+ metadata: Record<string, unknown> | null;
2535
2536
  created_at: string;
2536
2537
  }
2537
2538
  export interface LoopSignalParams {
@@ -2539,9 +2540,9 @@ export interface LoopSignalParams {
2539
2540
  source?: LoopSource;
2540
2541
  /** Required when verdict is `edited`. The answer the model should have given. */
2541
2542
  correction?: string;
2542
- /** Required when verdict is `scored`. */
2543
+ /** Required when verdict is `scored`: above zero trains the answer as it stands, otherwise it is left out. */
2543
2544
  score?: number;
2544
- /** A value or fact the answer can be checked against. GRPO needs one. */
2545
+ /** A value or fact the answer can be checked against. Kept with the verdict; a pipeline trains on `correction`, not on this. */
2545
2546
  ground_truth?: string;
2546
2547
  reason?: string;
2547
2548
  author?: string;
@@ -2579,7 +2580,11 @@ export interface LoopTrace {
2579
2580
  deployment_id: string | null;
2580
2581
  model: string;
2581
2582
  model_version: string | null;
2582
- messages: LoopMessage[];
2583
+ /**
2584
+ * The conversation. NULL, with `completion` empty, when its text is kept in
2585
+ * your own storage and could not be read just now: see `payload_unavailable`.
2586
+ */
2587
+ messages: LoopMessage[] | null;
2583
2588
  completion: string;
2584
2589
  tool_calls?: LoopToolCall[];
2585
2590
  tools?: unknown;
@@ -2591,9 +2596,35 @@ export interface LoopTrace {
2591
2596
  redacted_at: string | null;
2592
2597
  /** What the redaction pass removed, counted by rule. */
2593
2598
  redaction_report?: Record<string, number>;
2599
+ /** What the caller attached when recording it, or null. */
2600
+ metadata: Record<string, unknown> | null;
2594
2601
  created_at: string;
2595
2602
  expires_at: string;
2603
+ /** Every verdict recorded on it, oldest first. On the single read only. */
2596
2604
  signals?: LoopSignal[];
2605
+ /** How many verdicts it carries. */
2606
+ signal_count: number;
2607
+ /**
2608
+ * The verdict that decides it -- the one training uses, not whichever
2609
+ * arrived last. Absent when nobody has given feedback.
2610
+ */
2611
+ verdict?: LoopVerdict;
2612
+ /** Who gave that verdict. */
2613
+ verdict_source?: LoopSource;
2614
+ /** Its tags. On the single read only. */
2615
+ labels?: LoopLabel[];
2616
+ /**
2617
+ * True when the conversation's text is kept in your own storage rather than
2618
+ * here. The text is read from there on every request.
2619
+ */
2620
+ payload_stored_externally?: boolean;
2621
+ /**
2622
+ * True when that text could not be read just now (the storage could not be
2623
+ * reached, or the object is gone). `messages` is then null and `completion`
2624
+ * empty: the conversation is NOT empty. Try again later; do not review it or
2625
+ * treat it as a blank answer.
2626
+ */
2627
+ payload_unavailable?: boolean;
2597
2628
  }
2598
2629
  export interface LoopTraceListParams {
2599
2630
  deployment_id?: string;
@@ -2810,11 +2841,13 @@ export type TrainingRulePausedReason = 'consent_invalid' | 'insufficient_funds'
2810
2841
  */
2811
2842
  | 'training_not_enabled';
2812
2843
  /**
2813
- * Why a run fired. `variant` is a recipe variant: the pipeline had nothing new
2814
- * to learn, so it trained the same base model on the same conversations with
2815
- * one training setting changed (see {@link TrainingRecipe}).
2844
+ * Why a run fired, as the run stores it: `rows` (enough new samples),
2845
+ * `cadence` (the schedule), `both`, `manual` (train now), `challenger` (the
2846
+ * pipeline's challenger model trained on the same data as the attempt before
2847
+ * it), or `variant` (a recipe variant, retired: the same base model on the
2848
+ * same conversations with one training setting changed; old runs only).
2816
2849
  */
2817
- export type TrainingTrigger = 'rows' | 'cadence' | 'both' | 'manual' | 'variant';
2850
+ export type TrainingTrigger = 'rows' | 'cadence' | 'both' | 'manual' | 'variant' | 'challenger';
2818
2851
  /**
2819
2852
  * The four training settings a recipe variant may change, as the run was
2820
2853
  * actually trained: the training service's own defaults are filled in where
@@ -2891,8 +2924,6 @@ export interface TrainingRun {
2891
2924
  workspace_id: string;
2892
2925
  seq: number;
2893
2926
  rule_revision: number;
2894
- authorized_by: string;
2895
- rule_snapshot: Record<string, unknown>;
2896
2927
  trigger: TrainingTrigger;
2897
2928
  /**
2898
2929
  * For a recipe variant, what it changed, in plain words ("half the learning
@@ -2921,13 +2952,9 @@ export interface TrainingRun {
2921
2952
  * no remedy worth printing.
2922
2953
  */
2923
2954
  error_next_step: string | null;
2924
- training_ceiling_cents: number;
2925
- candidate_ceiling_cents: number;
2926
- eval_ceiling_cents: number;
2927
2955
  billed_training_cents: number;
2928
2956
  billed_candidate_cents: number;
2929
2957
  spent_eval_cents: number;
2930
- loop_dataset_id: string | null;
2931
2958
  train_rows: number | null;
2932
2959
  holdout_rows: number | null;
2933
2960
  train_dataset_id: string | null;
@@ -2967,8 +2994,7 @@ export interface TrainingRun {
2967
2994
  benchmark_run_id: string | null;
2968
2995
  /**
2969
2996
  * What the replay's calls cost. Kept apart from `spent_eval_cents` so a
2970
- * report can say what the comparison cost and what the benchmark cost; both
2971
- * come out of `eval_ceiling_cents` and their sum can never exceed it, so
2997
+ * report can say what the comparison cost and what the benchmark cost, so
2972
2998
  * anything totalling what a run cost has to add this one too.
2973
2999
  */
2974
3000
  benchmark_spent_cents: number;
@@ -3049,7 +3075,6 @@ export interface TrainingRunEvent {
3049
3075
  export interface TrainingRunLinks {
3050
3076
  training_job_url: string | null;
3051
3077
  candidate_url: string | null;
3052
- dataset_url: string | null;
3053
3078
  evaluation_url: string | null;
3054
3079
  /** The TREND the benchmark number belongs to, not the one replay. */
3055
3080
  benchmark_url: string | null;
@@ -3091,41 +3116,13 @@ export interface EvaluationWarning {
3091
3116
  export interface EvaluationMargin {
3092
3117
  promote_margin: number;
3093
3118
  promote_min_win_rate: number;
3094
- min_judge_agreement: number;
3095
3119
  min_holdout_rows: number;
3096
3120
  }
3097
- /**
3098
- * One rubric dimension of a judge-versus-human agreement.
3099
- *
3100
- * Deliberately not EvaluationDimensionScore: that type carries `incumbent` and
3101
- * `candidate`, which are the two models being compared, and an agreement has
3102
- * neither. `pairs` is per dimension because a reviewer who rated one dimension
3103
- * and skipped another leaves a different denominator behind each number.
3104
- */
3105
- export interface JudgeAgreementDimension {
3106
- dimension: string;
3107
- pairs: number;
3108
- agreement: number | null;
3109
- mean_abs_error: number | null;
3110
- }
3111
- /** How often this judge agreed with the workspace's own reviewers. */
3112
- export interface JudgeAgreement {
3113
- judge_id: string;
3114
- pairs: number;
3115
- agreement: number | null;
3116
- mean_abs_error: number | null;
3117
- per_dimension: JudgeAgreementDimension[];
3118
- window_days: number;
3119
- computed_at: string;
3120
- /** "Not enough reviewer overlap yet" is an answer; 100% of two is not. */
3121
- enough_pairs: boolean;
3122
- }
3123
3121
  /** The comparison report: the candidate against what serves today, same rows. */
3124
3122
  export interface Evaluation {
3125
3123
  id: string;
3126
3124
  run_id: string;
3127
3125
  workspace_id: string;
3128
- loop_dataset_id: string | null;
3129
3126
  split: string;
3130
3127
  incumbent_ref: EvaluationRef;
3131
3128
  candidate_ref: EvaluationRef;
@@ -3134,7 +3131,6 @@ export interface Evaluation {
3134
3131
  judge_model: string | null;
3135
3132
  judge_instructions: string | null;
3136
3133
  judge_dimensions: EvaluationJudgeDimension[];
3137
- judge_system_prompt: string | null;
3138
3134
  decoding: EvaluationDecoding;
3139
3135
  rows_selected: number;
3140
3136
  rows_scored: number;
@@ -3150,7 +3146,6 @@ export interface Evaluation {
3150
3146
  judge_incumbent_mean: number | null;
3151
3147
  judge_candidate_mean: number | null;
3152
3148
  per_dimension: EvaluationDimensionScore[];
3153
- judge_agreement: JudgeAgreement | null;
3154
3149
  /** Informational: there is no incumbent counterpart to compare it against. */
3155
3150
  trainer_eval_loss: number | null;
3156
3151
  warnings: EvaluationWarning[];
@@ -3283,14 +3278,11 @@ export interface Benchmark {
3283
3278
  judge_model: string;
3284
3279
  judge_instructions: string;
3285
3280
  judge_dimensions: EvaluationJudgeDimension[];
3286
- judge_system_prompt: string | null;
3287
3281
  decoding: EvaluationDecoding;
3288
3282
  scoring: BenchmarkScoring;
3289
3283
  item_count: number;
3290
3284
  /** Recomputed from the rows and compared at the start of every replay. */
3291
3285
  items_digest: string;
3292
- /** A cap INSIDE the run's own amount for judge calls, never an addition to it. */
3293
- per_run_ceiling_cents: number;
3294
3286
  created_by: string;
3295
3287
  created_at: string;
3296
3288
  retired_at: string | null;
@@ -3342,7 +3334,6 @@ export interface BenchmarkRun {
3342
3334
  prompt_tokens: number;
3343
3335
  completion_tokens: number;
3344
3336
  spent_cents: number;
3345
- ceiling_cents: number;
3346
3337
  status: BenchmarkRunStatus;
3347
3338
  /** The whole explanation when there is no score, so never empty on one. */
3348
3339
  status_reason: string | null;
@@ -3448,6 +3439,10 @@ export interface BenchmarkRetireParams {
3448
3439
  * monthly cap, so what this attempt trained could not be scored. The body
3449
3440
  * carries `resumes_at`, when the cap lifts (the next UTC month, or sooner
3450
3441
  * if the key's cap is raised).
3442
+ * - `LIVE_VERSION_STOPPED` (409): the deployment the pipeline's live version
3443
+ * answers from is stopped, paused until funds are added, deleted or failed,
3444
+ * so an attempt could not be compared against it. Resume it in Deployments,
3445
+ * or roll the version back, then train again.
3451
3446
  * - `AGENT_COULD_NOT_START` (503): the key every comparison is scored with is
3452
3447
  * missing or was refused, and train now could not renew it just then.
3453
3448
  * Nothing was started. Press train now again in a minute.
@@ -3460,7 +3455,7 @@ export interface BenchmarkRetireParams {
3460
3455
  * `MONTHLY_LIMIT_REACHED` and `SCORING_CAPPED` once their date has passed;
3461
3456
  * retrying any other one unchanged gets the same answer.
3462
3457
  */
3463
- export type TrainingRuleRunRefusalCode = 'NOT_ENOUGH_SAMPLES' | 'PIPELINE_NEEDS_SAVE' | 'RULE_PAUSED' | 'RUN_ACTIVE' | 'VERSION_LIMIT_REACHED' | 'MONTHLY_LIMIT_REACHED' | 'SCORING_CAPPED' | 'AGENT_COULD_NOT_START' | 'AGENT_OFF';
3458
+ export type TrainingRuleRunRefusalCode = 'NOT_ENOUGH_SAMPLES' | 'PIPELINE_NEEDS_SAVE' | 'RULE_PAUSED' | 'RUN_ACTIVE' | 'VERSION_LIMIT_REACHED' | 'MONTHLY_LIMIT_REACHED' | 'SCORING_CAPPED' | 'LIVE_VERSION_STOPPED' | 'AGENT_COULD_NOT_START' | 'AGENT_OFF';
3464
3459
  /**
3465
3460
  * The machine codes saving a pipeline (`createPipeline` or `updatePipeline`)
3466
3461
  * can be refused with: every one the two routes answer beyond a malformed
@@ -3537,7 +3532,8 @@ export interface TrainingRuleMonthlyLimitRefusal {
3537
3532
  /**
3538
3533
  * The first instant of the next UTC month, when the counted spend starts
3539
3534
  * again from nothing. When `run_max_cents` alone exceeds the limit, no month
3540
- * will ever fit and only raising the limit helps; `message` says which.
3535
+ * will ever fit: saving the pipeline sets the limit again from its model's
3536
+ * prices, and nothing else changes it; `message` says which.
3541
3537
  */
3542
3538
  resumes_at: string;
3543
3539
  }
@@ -3549,8 +3545,9 @@ export declare const PIPELINE_MAX_VERSIONS_CEILING = 100;
3549
3545
  * platform working on it.
3550
3546
  *
3551
3547
  * `paused` is a rule that is switched off, AND an enabled rule the platform
3552
- * has stopped firing (`paused_reason`) or whose terms changed and were never
3553
- * accepted (`needs_consent`). `complete` is a pipeline at its `max_versions`.
3548
+ * has stopped firing (`paused_reason`; `consent_invalid` when its settings
3549
+ * changed since it was last saved). `complete` is a pipeline at its
3550
+ * `max_versions`.
3554
3551
  */
3555
3552
  export type PipelineStatus = 'running' | 'needs_review' | 'needs_funds' | 'waiting' | 'paused' | 'complete';
3556
3553
  /**
@@ -3588,8 +3585,6 @@ export interface PipelineActiveRun {
3588
3585
  * not a version, and becomes one only if a member promotes it.
3589
3586
  */
3590
3587
  competed: boolean;
3591
- /** What recipe it is trying, when it is a recipe variant. See TrainingRun.recipe_note. */
3592
- recipe_note: string | null;
3593
3588
  }
3594
3589
  /**
3595
3590
  * One version: an attempt that was put live -- promoted by the pipeline's
@@ -3659,18 +3654,10 @@ export interface PipelineVersion {
3659
3654
  */
3660
3655
  compared_at: string | null;
3661
3656
  /**
3662
- * Why the run that made it fired. `variant` is a version trained on the same
3663
- * conversations as the one before it with one setting changed; every other
3664
- * value is a version that learned from newly reviewed conversations (or a
3665
- * member's run now).
3657
+ * Why the attempt that made it was made, in the words `attempts[]` uses for
3658
+ * the same run; see {@link PipelineAttempt.trigger}.
3666
3659
  */
3667
- trigger: TrainingTrigger;
3668
- /** See TrainingRun.recipe_note. */
3669
- recipe_note: string | null;
3670
- /** See TrainingRun.recipe_of_version. */
3671
- recipe_of_version: number | null;
3672
- /** See TrainingRun.recipe. */
3673
- recipe: TrainingRecipe;
3660
+ trigger: PipelineAttemptTrigger;
3674
3661
  finished_at: string | null;
3675
3662
  }
3676
3663
  /**
@@ -3742,8 +3729,6 @@ export interface PipelineTrainWhen {
3742
3729
  }
3743
3730
  /** What is held back beyond max(50, 5% of the data): a larger percent, or a count. */
3744
3731
  export interface PipelineHoldout {
3745
- percent: number;
3746
- count: number | null;
3747
3732
  min_rows: number;
3748
3733
  }
3749
3734
  /**
@@ -3780,10 +3765,6 @@ export interface Pipeline {
3780
3765
  * commit the server pinned.
3781
3766
  */
3782
3767
  challenger_model: PipelineModelRef | null;
3783
- /** `sft` today; `kto`, `dpo` and `grpo` cannot be chosen yet. */
3784
- training_type: string;
3785
- /** How each version starts: `fresh`, a new adapter over the pinned base trained on all accepted data. */
3786
- version_base: string;
3787
3768
  train_when: PipelineTrainWhen;
3788
3769
  promotion: PipelinePromotion;
3789
3770
  holdout: PipelineHoldout;
@@ -3793,7 +3774,6 @@ export interface Pipeline {
3793
3774
  /** The pinned base every version is a fresh adapter over, which is what makes their scores comparable. */
3794
3775
  base_model_id: string;
3795
3776
  base_model_revision: string;
3796
- train_type: string;
3797
3777
  /** The version serving now; null when what serves is not a version of this pipeline. */
3798
3778
  live_version: number | null;
3799
3779
  /** The same number under its older name. */
@@ -3808,25 +3788,31 @@ export interface Pipeline {
3808
3788
  serving_taken_over_by: string | null;
3809
3789
  benchmark_id: string | null;
3810
3790
  benchmark_name: string | null;
3811
- benchmark_decides: boolean;
3791
+ /** The least a benchmark's score has to rise by to count as an improvement under a policy that reads benchmarks. */
3812
3792
  benchmark_min_delta: number;
3813
3793
  status: PipelineStatus;
3814
3794
  /**
3815
3795
  * The rule's own sentence about what it is waiting for or why it stopped,
3816
3796
  * verbatim. Only as fresh as the platform's last visit: when `status` is
3817
- * `paused`, `paused_reason` and `needs_consent` are what say why.
3797
+ * `paused`, `paused_reason` is what says why.
3818
3798
  */
3819
3799
  next_reason: string | null;
3820
3800
  last_checked_at: string | null;
3821
3801
  next_due_at: string | null;
3822
3802
  auto_promote: boolean;
3823
- /** Why the platform stopped firing this rule, or null. Same codes as the rule's. */
3803
+ /**
3804
+ * Why the platform stopped firing this rule, or null. `consent_invalid` is
3805
+ * a pipeline whose settings changed since it was last saved: saving it
3806
+ * again starts it.
3807
+ */
3824
3808
  paused_reason: TrainingRulePausedReason | null;
3825
3809
  /**
3826
- * The rule's terms changed and nobody has accepted them. It makes nothing
3827
- * until somebody does.
3810
+ * When this workspace's scoring key comes off its monthly cap (the start of
3811
+ * the next UTC month), or null when it is not capped. Until then Train now
3812
+ * answers 409 `SCORING_CAPPED` with this time as `resumes_at`, and nothing
3813
+ * trains on its own: an attempt would train and could not be compared.
3828
3814
  */
3829
- needs_consent: boolean;
3815
+ scoring_capped_until: string | null;
3830
3816
  /** The rule's monthly limit. Null means it has none. */
3831
3817
  monthly_ceiling_cents: number | null;
3832
3818
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "runbios-sdk",
3
- "version": "0.2.19-dev.274",
3
+ "version": "0.2.19-dev.277",
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",