runbios-sdk 0.2.20 → 0.2.21-dev.294

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/client.js CHANGED
@@ -344,7 +344,7 @@ export class HttpClient {
344
344
  constructor(config) {
345
345
  // Default host stays api.runbios.ai for now; cutover to api.runbios.ai is
346
346
  // planned once its DNS exists.
347
- this.baseUrl = (config.baseUrl || envBaseUrl() || 'https://api.runbios.ai').replace(/\/+$/, '');
347
+ this.baseUrl = (config.baseUrl || envBaseUrl() || 'https://api-dev.runbios.ai').replace(/\/+$/, '');
348
348
  this.apiKey = config.apiKey ?? envApiKey();
349
349
  this.accessToken = config.accessToken;
350
350
  this.orgId = config.orgId;
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.20";
39
+ export declare const VERSION = "0.2.21-dev.294";
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, 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';
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, EvaluationStatus, EvaluationItemStatus, ItemErrorCode, EvaluationWinner, EvaluationItemWinnerFilter, ReportStatusFilter, ReportSort, EvaluationWarningCode, TrainingToolCall, TrainingMessage, TrainingRuleServing, TrainingRunPromoteRequest, TrainingRunRejectRequest, TrainingRunRollbackRequest, TrainingRunCancelRequest, TrainingRunListParams, TrainingRun, TrainingRunSummary, TrainingRunEvent, TrainingRunLinks, TrainingRunActions, EvaluationRef, EvaluationDecoding, EvaluationJudgeDimension, EvaluationDimensionScore, EvaluationWarning, EvaluationMargin, Evaluation, EvaluationItemJudge, EvaluationReferenceKind, EvaluationReference, EvaluationPairwiseOrder, EvaluationItemPairwise, EvaluationItemSide, EvaluationItem, EvaluationItemListParams, BenchmarkStatus, BenchmarkSourceKind, BenchmarkRunStatus, BenchmarkScoring, BenchmarkCheck, BenchmarkDimensionScore, Benchmark, BenchmarkItem, BenchmarkRun, BenchmarkRunItemSide, BenchmarkRunItem, BenchmarkRunItemListParams, BenchmarkHistoryPoint, BenchmarkSource, BenchmarkCreateParams, BenchmarkListParams, BenchmarkItemListParams, BenchmarkHistoryParams, BenchmarkRetireParams, InferenceAlias, InferenceAliasRequest, TrainingRuleDeleteResponse, TrainingRunListResponse, TrainingRunBenchmarkRun, TrainingRunResponse, TrainingRunActionResponse, EvaluationItemsResponse, BenchmarkRunItemsResponse, InferenceAliasListResponse, InferenceAliasResponse, InferenceAliasDeleteResponse, BenchmarkListResponse, BenchmarkItemsResponse, BenchmarkHistoryResponse, TrainingRuleRunRefusalCode, TrainingRuleSaveRefusalCode, TrainingRuleMonthlyLimitRefusal, PipelineStatus, PipelineActiveRun, PipelineVersion, PipelineAttempt, PipelineAttemptTrigger, PipelineAttemptOutcome, PipelineLiveDeploymentStatus, PipelineLiveDeployment, LoopStorageWhere, LoopStorage, Pipeline, PipelineListParams, PipelineListResponse, PipelineResponse, PipelineTrainWhen, PipelineSchedule, PipelineWriteRequest, PipelineMutationResponse, PipelineImportParams, PipelineFloors, HeldBackFloors, LoopModel, LoopModelsResponse, LoopTracePipeline, LoopTracePipelinesResponse, LoopMetricsHistoryParams, LoopMetricPoint, LoopSignalDay, LoopMetricsHistory, PromotionPolicyState, RuleBenchmark, PipelineBenchmarksResponse, PipelineBenchmarkAttachParams, PipelineBenchmarkMoveParams, CompareBenchmark, VersionBenchmarkScore, PromotionMeasurement, PromotionOutcome, VersionHoldout, VersionScores, VersionScoreDifference, VersionCompareResponse, VersionCompareParams, TrainingRunPromotion, VerdictCheck, VerdictCheckKey, VerdictChecksWithheld, TrainingRunCost, AttemptDirection, AttemptHoldout, AttemptCompareSide, AttemptSharedSample, AttemptSharedFigures, AttemptBenchmarkSide, AttemptCompareBenchmark, AttemptCompareItemSide, AttemptCompareItem, AttemptCompareResponse, AttemptCompareParams, } 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.20';
39
+ export const VERSION = '0.2.21-dev.294';
40
40
  export class RunBiOS {
41
41
  /** Search models, fetch configs, check adapter compatibility. */
42
42
  models;
@@ -336,7 +336,7 @@ export class Inference {
336
336
  this.key = config.inferenceKey || envInferenceKey() || envApiKey();
337
337
  // Same default host as HttpClient (api.runbios.ai); api.runbios.ai cutover
338
338
  // is planned once its DNS exists — update both call sites together.
339
- this.baseUrl = (config.baseUrl || envBaseUrl() || 'https://api.runbios.ai').replace(/\/+$/, '');
339
+ this.baseUrl = (config.baseUrl || envBaseUrl() || 'https://api-dev.runbios.ai').replace(/\/+$/, '');
340
340
  this.timeout = config.timeout ?? 900_000;
341
341
  this._http = http;
342
342
  }
@@ -1,5 +1,5 @@
1
1
  import type { HttpClient } from '../client.js';
2
- import type { LoopTrace, LoopTraceListResponse, LoopTraceListParams, LoopCaptureParams, LoopCaptureResult, LoopImportParams, LoopImportResult, LoopSignal, LoopSignalParams, LoopLabel, LoopLabelCount, LoopConfig, LoopConfigParams, LoopStats, LoopTracePipelinesResponse, LoopMetricsHistory, LoopMetricsHistoryParams, TrainingRuleDeleteResponse, TrainingRunListParams, TrainingRunListResponse, TrainingRunResponse, TrainingRunActionResponse, TrainingRunPromoteRequest, TrainingRunRejectRequest, TrainingRunRollbackRequest, TrainingRunCancelRequest, Evaluation, EvaluationItemListParams, EvaluationItemsResponse, Benchmark, BenchmarkCreateParams, BenchmarkHistoryParams, BenchmarkHistoryResponse, BenchmarkItemListParams, BenchmarkItemsResponse, BenchmarkListParams, BenchmarkListResponse, BenchmarkRetireParams, BenchmarkRun, Pipeline, PipelineListParams, PipelineListResponse, PipelineWriteRequest, PipelineMutationResponse, LoopModelsResponse, PipelineImportParams, PipelineBenchmarksResponse, PipelineBenchmarkAttachParams, PipelineBenchmarkMoveParams, VersionCompareResponse, VersionCompareParams } from '../types.js';
2
+ import type { LoopTrace, LoopTraceListResponse, LoopTraceListParams, LoopCaptureParams, LoopCaptureResult, LoopImportParams, LoopImportResult, LoopSignal, LoopSignalParams, LoopLabel, LoopLabelCount, LoopConfig, LoopConfigParams, LoopStats, LoopTracePipelinesResponse, LoopMetricsHistory, LoopMetricsHistoryParams, TrainingRuleDeleteResponse, TrainingRunListParams, TrainingRunListResponse, TrainingRunResponse, TrainingRunActionResponse, TrainingRunPromoteRequest, TrainingRunRejectRequest, TrainingRunRollbackRequest, TrainingRunCancelRequest, Evaluation, EvaluationItemListParams, EvaluationItemsResponse, Benchmark, BenchmarkCreateParams, BenchmarkHistoryParams, BenchmarkHistoryResponse, BenchmarkItemListParams, BenchmarkItemsResponse, BenchmarkListParams, BenchmarkListResponse, BenchmarkRetireParams, BenchmarkRun, BenchmarkRunItemListParams, BenchmarkRunItemsResponse, Pipeline, PipelineListParams, PipelineListResponse, PipelineWriteRequest, PipelineMutationResponse, LoopModelsResponse, PipelineImportParams, PipelineBenchmarksResponse, PipelineBenchmarkAttachParams, PipelineBenchmarkMoveParams, VersionCompareResponse, VersionCompareParams, AttemptCompareResponse, AttemptCompareParams } from '../types.js';
3
3
  /**
4
4
  * The Conscious Loop -- pipelines that keep improving a model from the
5
5
  * conversations you send them.
@@ -368,8 +368,15 @@ export declare class Loop {
368
368
  * The base models a pipeline can train: only those the engine trains with
369
369
  * LoRA SFT and the platform can serve for the comparison, recommended first.
370
370
  * The one list {@link createPipeline} accepts a `model.id` from, with the
371
- * `floors` a new pipeline is held to: the samples its first attempt needs and
372
- * the smallest `train_when.min_samples`.
371
+ * fixed `floors` a pipeline is held to: the samples its first attempt
372
+ * needs, and the new samples each later attempt waits for
373
+ * (`new_samples`, or `new_samples_percent` of the rows the last trained
374
+ * attempt trained on when that is more), and the held-back rule
375
+ * (`held_back`: at least `min_rows`, or the share a pipeline chooses from
376
+ * `default_percent` to `max_percent` if that is more, and each attempt is
377
+ * judged on at most `scored_rows` of them). They are read-only.
378
+ * When the list cannot be read it throws `ApiError` 503
379
+ * `MODELS_UNAVAILABLE`, whose `body.floors` still carries the floors.
373
380
  */
374
381
  listModels(): Promise<LoopModelsResponse>;
375
382
  /**
@@ -380,20 +387,31 @@ export declare class Loop {
380
387
  * the platform trains a new version on GPUs it chooses, compares it with what
381
388
  * serves your traffic, and promotes it by the pipeline's promotion policy.
382
389
  * What is charged is the GPU time the runs actually use; the platform's own
383
- * per-run and monthly limits stop a run that goes wrong.
390
+ * per-run and monthly limits stop a run that goes wrong. `holdout.percent`
391
+ * (5 to 20, default 5) is the share of its samples held back to judge each
392
+ * attempt and never trained on.
384
393
  */
385
394
  createPipeline(params: PipelineWriteRequest): Promise<PipelineMutationResponse>;
386
395
  /**
387
396
  * Edit a pipeline. Only the fields sent change; `max_versions: null` removes
388
397
  * the limit and `challenger_model: null` removes the challenger. `promotion`
389
- * is how the promotion policy is set. Saving is the authorization, as on a
390
- * create.
398
+ * is how the promotion policy is set. A new `holdout.percent` is a new
399
+ * revision: lowering it keeps every sample already held back, and raising it
400
+ * holds back only new samples. Saving is the authorization, as on a create.
391
401
  */
392
402
  updatePipeline(id: string, params: PipelineWriteRequest): Promise<PipelineMutationResponse>;
393
403
  /**
394
- * Delete a pipeline: an attempt still running is cancelled; the versions it
395
- * made, what serves your app, and its samples and tags are kept. Recording
396
- * to its own tag stops.
404
+ * Delete a pipeline: an attempt still running is cancelled, the deployment
405
+ * its live version answers from is stopped and deleted -- it stops
406
+ * answering and is no longer billed -- unless another pipeline or model
407
+ * name of yours answers from it too. If one does, that deployment keeps
408
+ * running and billed until you stop it on Deployments, and its trained
409
+ * checkpoint is kept (and billed as storage) until that deployment is
410
+ * deleted. Its history is deleted with it: the checkpoints its attempts
411
+ * trained, the sets they trained on, and every conversation of their
412
+ * comparison and benchmark reports. That happens in the background after
413
+ * this returns. Your samples and their tags are kept. Recording to its own
414
+ * tag stops. It cannot be undone.
397
415
  */
398
416
  deletePipeline(id: string): Promise<TrainingRuleDeleteResponse>;
399
417
  /**
@@ -428,6 +446,23 @@ export declare class Loop {
428
446
  * VERSION numbers; with both, `differences` says b minus a per benchmark.
429
447
  */
430
448
  compareVersions(id: string, params?: VersionCompareParams): Promise<VersionCompareResponse>;
449
+ /**
450
+ * Any two attempts of a pipeline side by side, put live or not. `a` and `b`
451
+ * are RUN ids. Each side's held-back numbers (never subtracted: each was
452
+ * compared with its own opponent), every benchmark both replayed with b
453
+ * minus a where comparable, and a page of the held-back conversations both
454
+ * were scored on, each side's score and whether it passed, and whether b
455
+ * scored higher, lower or the same (`tie_band` or more above counts as
456
+ * higher; less than `tie_band` apart is about the same). `shared_sample.a`
457
+ * and `.b` are each attempt's mean and pass rate over those same
458
+ * conversations -- the like-for-like figures; each side's `holdout` is over
459
+ * its own, possibly larger, set. When the two were scored differently
460
+ * (another scoring model or rubric), `shared_sample.comparable` is false,
461
+ * `why` says so, no direction is given and `filter` is refused (400); a
462
+ * conversation whose right answer changed between them has no direction
463
+ * either. Numbers and ids only: read an answer with `listEvaluationItems`.
464
+ */
465
+ compareAttempts(id: string, params: AttemptCompareParams): Promise<AttemptCompareResponse>;
431
466
  /**
432
467
  * The comparison behind a verdict: both models on the same held-out rows,
433
468
  * with identical decoding, scored by the same judge.
@@ -437,17 +472,31 @@ export declare class Loop {
437
472
  * your own reviewers, is reported with the warning that says so rather than
438
473
  * withheld. `margin_used` is the thresholds this verdict was measured
439
474
  * against, frozen with the report, so a later policy change cannot rewrite
440
- * what a past decision meant.
475
+ * what a past decision meant. `candidate_pass_rate` and
476
+ * `incumbent_pass_rate` are the share of conversations each side passed
477
+ * (score 0.70 or more).
441
478
  */
442
479
  getEvaluation(id: string): Promise<Evaluation>;
443
480
  /**
444
- * The paired conversations behind the numbers: one prompt, both answers, the
445
- * scores each earned, and which won.
481
+ * The paired conversations behind the numbers: one prompt, the reference a
482
+ * person gave for it, both answers, what the judge made of each (its scores,
483
+ * its reason, and whether the answer passed: score 0.70 or more), the
484
+ * direct comparison in both orders, and which won.
446
485
  *
447
486
  * Filter by `winner` -- `candidate` (the attempt won), `serving` (the version
448
487
  * serving today won; the item itself says `incumbent`) or `tie` -- and read
449
488
  * `serving` first: the pairs the attempt lost are where a verdict is actually
450
489
  * checked. `limit` is 50 when absent and at most 200.
490
+ *
491
+ * Narrow further by `candidate_passed` and `incumbent_passed` (each `true`
492
+ * or `false`, one side each and composable: `false` is scored below 0.70,
493
+ * so `candidate_passed: false, incumbent_passed: true` is the regressions),
494
+ * `orders` (the two side-by-side orders
495
+ * `agreed` or `disagreed`), `has_reference`, `status` (`scored`, `failed`),
496
+ * order by `sort` (`score_change`: the attempt's score less the other's,
497
+ * largest first), and search with `q` (2 to 200 characters) over each
498
+ * conversation, its right answer, both answers and every reason; `searched`
499
+ * says how many rows were searched.
451
500
  */
452
501
  listEvaluationItems(id: string, params?: EvaluationItemListParams): Promise<EvaluationItemsResponse>;
453
502
  /**
@@ -461,14 +510,24 @@ export declare class Loop {
461
510
  * replayed against both models on every run that finishes its comparison,
462
511
  * and reported as two absolute numbers on a scale that does not move.
463
512
  *
464
- * 20 to 200 conversations. A named conversation with nothing to ask a model
465
- * is refused rather than skipped, because pinning 47 of the 50 you chose is
466
- * the set being wrong from the first day and you would never find out.
513
+ * 20 to 200 conversations. A named conversation with nothing to ask a model,
514
+ * or too large to keep in storage, is refused 422 `BENCHMARK_ROW_UNUSABLE`
515
+ * rather than skipped, because pinning 47 of the 50 you chose is the set
516
+ * being wrong from the first day and you would never find out. The set is
517
+ * kept in storage and nowhere else: when it cannot be stored just then the
518
+ * create is refused 409 `CONFLICT` and nothing is saved; try again in a
519
+ * minute.
467
520
  *
468
521
  * The platform freezes the judge and the model it scores on (the ones every
469
522
  * pipeline comparison uses), gives both models the comparison's own answer
470
523
  * length, and sets what one replay may spend, inside the attempt's own
471
524
  * scoring limit; none of that is sent.
525
+ *
526
+ * `check: 'exact'` scores it by the exact check instead: the answer or the
527
+ * tool call must match the right answer pinned with each conversation, and
528
+ * no model is asked. Every conversation then needs a right answer (one a
529
+ * person marked good, or a correction); the ones without are refused 422
530
+ * `BENCHMARK_ROW_HAS_NO_ANSWER`, named, and nothing is saved.
472
531
  */
473
532
  createBenchmark(params: BenchmarkCreateParams): Promise<Benchmark>;
474
533
  /** Your benchmarks, newest first. Filter by `status` to hide retired ones. */
@@ -526,4 +585,21 @@ export declare class Loop {
526
585
  * different set, which is the exact defect a standing benchmark removes.
527
586
  */
528
587
  getBenchmarkRun(id: string): Promise<BenchmarkRun>;
588
+ /**
589
+ * The conversations behind one replay, in the benchmark's order: the pinned
590
+ * prompt and its reference, both answers, what the judge made of each (its
591
+ * scores, its reason, and whether the answer passed: score 0.70 or more),
592
+ * and which side won it.
593
+ *
594
+ * Filter by `winner` -- `candidate` (the attempt won), `serving` (the
595
+ * version serving today won; the item itself says `incumbent`) or `tie` --
596
+ * exactly as on a comparison report's items. `limit` is 50 when absent and
597
+ * at most 200. A replay that stopped before it began has no conversations:
598
+ * its `status_reason` says why.
599
+ *
600
+ * The same `candidate_passed`, `incumbent_passed`, `has_reference`,
601
+ * `status`, `sort` and `q` as a
602
+ * comparison's items; there is no `orders`.
603
+ */
604
+ listBenchmarkRunItems(id: string, params?: BenchmarkRunItemListParams): Promise<BenchmarkRunItemsResponse>;
529
605
  }
@@ -512,8 +512,15 @@ export class Loop {
512
512
  * The base models a pipeline can train: only those the engine trains with
513
513
  * LoRA SFT and the platform can serve for the comparison, recommended first.
514
514
  * The one list {@link createPipeline} accepts a `model.id` from, with the
515
- * `floors` a new pipeline is held to: the samples its first attempt needs and
516
- * the smallest `train_when.min_samples`.
515
+ * fixed `floors` a pipeline is held to: the samples its first attempt
516
+ * needs, and the new samples each later attempt waits for
517
+ * (`new_samples`, or `new_samples_percent` of the rows the last trained
518
+ * attempt trained on when that is more), and the held-back rule
519
+ * (`held_back`: at least `min_rows`, or the share a pipeline chooses from
520
+ * `default_percent` to `max_percent` if that is more, and each attempt is
521
+ * judged on at most `scored_rows` of them). They are read-only.
522
+ * When the list cannot be read it throws `ApiError` 503
523
+ * `MODELS_UNAVAILABLE`, whose `body.floors` still carries the floors.
517
524
  */
518
525
  async listModels() {
519
526
  const res = await this._http.fetchGet('/api/loop/models');
@@ -527,7 +534,9 @@ export class Loop {
527
534
  * the platform trains a new version on GPUs it chooses, compares it with what
528
535
  * serves your traffic, and promotes it by the pipeline's promotion policy.
529
536
  * What is charged is the GPU time the runs actually use; the platform's own
530
- * per-run and monthly limits stop a run that goes wrong.
537
+ * per-run and monthly limits stop a run that goes wrong. `holdout.percent`
538
+ * (5 to 20, default 5) is the share of its samples held back to judge each
539
+ * attempt and never trained on.
531
540
  */
532
541
  async createPipeline(params) {
533
542
  return this._http.fetchPost('/api/loop/pipelines', params);
@@ -535,16 +544,25 @@ export class Loop {
535
544
  /**
536
545
  * Edit a pipeline. Only the fields sent change; `max_versions: null` removes
537
546
  * the limit and `challenger_model: null` removes the challenger. `promotion`
538
- * is how the promotion policy is set. Saving is the authorization, as on a
539
- * create.
547
+ * is how the promotion policy is set. A new `holdout.percent` is a new
548
+ * revision: lowering it keeps every sample already held back, and raising it
549
+ * holds back only new samples. Saving is the authorization, as on a create.
540
550
  */
541
551
  async updatePipeline(id, params) {
542
552
  return this._http.fetchPut(`/api/loop/pipelines/${encodeURIComponent(id)}`, params);
543
553
  }
544
554
  /**
545
- * Delete a pipeline: an attempt still running is cancelled; the versions it
546
- * made, what serves your app, and its samples and tags are kept. Recording
547
- * to its own tag stops.
555
+ * Delete a pipeline: an attempt still running is cancelled, the deployment
556
+ * its live version answers from is stopped and deleted -- it stops
557
+ * answering and is no longer billed -- unless another pipeline or model
558
+ * name of yours answers from it too. If one does, that deployment keeps
559
+ * running and billed until you stop it on Deployments, and its trained
560
+ * checkpoint is kept (and billed as storage) until that deployment is
561
+ * deleted. Its history is deleted with it: the checkpoints its attempts
562
+ * trained, the sets they trained on, and every conversation of their
563
+ * comparison and benchmark reports. That happens in the background after
564
+ * this returns. Your samples and their tags are kept. Recording to its own
565
+ * tag stops. It cannot be undone.
548
566
  */
549
567
  async deletePipeline(id) {
550
568
  return this._http.fetchDelete(`/api/loop/pipelines/${encodeURIComponent(id)}`);
@@ -602,6 +620,34 @@ export class Loop {
602
620
  const qs = q.toString();
603
621
  return this._http.fetchGet(`/api/loop/pipelines/${encodeURIComponent(id)}/versions/compare${qs ? `?${qs}` : ''}`);
604
622
  }
623
+ /**
624
+ * Any two attempts of a pipeline side by side, put live or not. `a` and `b`
625
+ * are RUN ids. Each side's held-back numbers (never subtracted: each was
626
+ * compared with its own opponent), every benchmark both replayed with b
627
+ * minus a where comparable, and a page of the held-back conversations both
628
+ * were scored on, each side's score and whether it passed, and whether b
629
+ * scored higher, lower or the same (`tie_band` or more above counts as
630
+ * higher; less than `tie_band` apart is about the same). `shared_sample.a`
631
+ * and `.b` are each attempt's mean and pass rate over those same
632
+ * conversations -- the like-for-like figures; each side's `holdout` is over
633
+ * its own, possibly larger, set. When the two were scored differently
634
+ * (another scoring model or rubric), `shared_sample.comparable` is false,
635
+ * `why` says so, no direction is given and `filter` is refused (400); a
636
+ * conversation whose right answer changed between them has no direction
637
+ * either. Numbers and ids only: read an answer with `listEvaluationItems`.
638
+ */
639
+ async compareAttempts(id, params) {
640
+ const q = new URLSearchParams();
641
+ q.set('a', params.a);
642
+ q.set('b', params.b);
643
+ if (params.filter != null)
644
+ q.set('filter', params.filter);
645
+ if (params.limit != null)
646
+ q.set('limit', String(params.limit));
647
+ if (params.offset != null)
648
+ q.set('offset', String(params.offset));
649
+ return this._http.fetchGet(`/api/loop/pipelines/${encodeURIComponent(id)}/attempts/compare?${q.toString()}`);
650
+ }
605
651
  // ── the comparison report ─────────────────────────────────────────────
606
652
  /**
607
653
  * The comparison behind a verdict: both models on the same held-out rows,
@@ -612,24 +658,38 @@ export class Loop {
612
658
  * your own reviewers, is reported with the warning that says so rather than
613
659
  * withheld. `margin_used` is the thresholds this verdict was measured
614
660
  * against, frozen with the report, so a later policy change cannot rewrite
615
- * what a past decision meant.
661
+ * what a past decision meant. `candidate_pass_rate` and
662
+ * `incumbent_pass_rate` are the share of conversations each side passed
663
+ * (score 0.70 or more).
616
664
  */
617
665
  async getEvaluation(id) {
618
666
  return this._http.fetchGet(`/api/loop/evaluations/${encodeURIComponent(id)}`);
619
667
  }
620
668
  /**
621
- * The paired conversations behind the numbers: one prompt, both answers, the
622
- * scores each earned, and which won.
669
+ * The paired conversations behind the numbers: one prompt, the reference a
670
+ * person gave for it, both answers, what the judge made of each (its scores,
671
+ * its reason, and whether the answer passed: score 0.70 or more), the
672
+ * direct comparison in both orders, and which won.
623
673
  *
624
674
  * Filter by `winner` -- `candidate` (the attempt won), `serving` (the version
625
675
  * serving today won; the item itself says `incumbent`) or `tie` -- and read
626
676
  * `serving` first: the pairs the attempt lost are where a verdict is actually
627
677
  * checked. `limit` is 50 when absent and at most 200.
678
+ *
679
+ * Narrow further by `candidate_passed` and `incumbent_passed` (each `true`
680
+ * or `false`, one side each and composable: `false` is scored below 0.70,
681
+ * so `candidate_passed: false, incumbent_passed: true` is the regressions),
682
+ * `orders` (the two side-by-side orders
683
+ * `agreed` or `disagreed`), `has_reference`, `status` (`scored`, `failed`),
684
+ * order by `sort` (`score_change`: the attempt's score less the other's,
685
+ * largest first), and search with `q` (2 to 200 characters) over each
686
+ * conversation, its right answer, both answers and every reason; `searched`
687
+ * says how many rows were searched.
628
688
  */
629
689
  async listEvaluationItems(id, params = {}) {
630
- const q = new URLSearchParams();
631
- if (params.winner)
632
- q.set('winner', params.winner);
690
+ const q = reportRowQuery(params);
691
+ if (params.orders)
692
+ q.set('orders', params.orders);
633
693
  if (params.limit != null)
634
694
  q.set('limit', String(params.limit));
635
695
  if (params.offset != null)
@@ -649,14 +709,24 @@ export class Loop {
649
709
  * replayed against both models on every run that finishes its comparison,
650
710
  * and reported as two absolute numbers on a scale that does not move.
651
711
  *
652
- * 20 to 200 conversations. A named conversation with nothing to ask a model
653
- * is refused rather than skipped, because pinning 47 of the 50 you chose is
654
- * the set being wrong from the first day and you would never find out.
712
+ * 20 to 200 conversations. A named conversation with nothing to ask a model,
713
+ * or too large to keep in storage, is refused 422 `BENCHMARK_ROW_UNUSABLE`
714
+ * rather than skipped, because pinning 47 of the 50 you chose is the set
715
+ * being wrong from the first day and you would never find out. The set is
716
+ * kept in storage and nowhere else: when it cannot be stored just then the
717
+ * create is refused 409 `CONFLICT` and nothing is saved; try again in a
718
+ * minute.
655
719
  *
656
720
  * The platform freezes the judge and the model it scores on (the ones every
657
721
  * pipeline comparison uses), gives both models the comparison's own answer
658
722
  * length, and sets what one replay may spend, inside the attempt's own
659
723
  * scoring limit; none of that is sent.
724
+ *
725
+ * `check: 'exact'` scores it by the exact check instead: the answer or the
726
+ * tool call must match the right answer pinned with each conversation, and
727
+ * no model is asked. Every conversation then needs a right answer (one a
728
+ * person marked good, or a correction); the ones without are refused 422
729
+ * `BENCHMARK_ROW_HAS_NO_ANSWER`, named, and nothing is saved.
660
730
  */
661
731
  async createBenchmark(params) {
662
732
  const res = await this._http.fetchPost('/api/loop/benchmarks', params);
@@ -752,4 +822,48 @@ export class Loop {
752
822
  const res = await this._http.fetchGet(`/api/loop/benchmark-runs/${encodeURIComponent(id)}`);
753
823
  return res.benchmark_run;
754
824
  }
825
+ /**
826
+ * The conversations behind one replay, in the benchmark's order: the pinned
827
+ * prompt and its reference, both answers, what the judge made of each (its
828
+ * scores, its reason, and whether the answer passed: score 0.70 or more),
829
+ * and which side won it.
830
+ *
831
+ * Filter by `winner` -- `candidate` (the attempt won), `serving` (the
832
+ * version serving today won; the item itself says `incumbent`) or `tie` --
833
+ * exactly as on a comparison report's items. `limit` is 50 when absent and
834
+ * at most 200. A replay that stopped before it began has no conversations:
835
+ * its `status_reason` says why.
836
+ *
837
+ * The same `candidate_passed`, `incumbent_passed`, `has_reference`,
838
+ * `status`, `sort` and `q` as a
839
+ * comparison's items; there is no `orders`.
840
+ */
841
+ async listBenchmarkRunItems(id, params = {}) {
842
+ const q = reportRowQuery(params);
843
+ if (params.limit != null)
844
+ q.set('limit', String(params.limit));
845
+ if (params.offset != null)
846
+ q.set('offset', String(params.offset));
847
+ const qs = q.toString();
848
+ return this._http.fetchGet(`/api/loop/benchmark-runs/${encodeURIComponent(id)}/items${qs ? `?${qs}` : ''}`);
849
+ }
850
+ }
851
+ /** The row filters both report item routes take, in the service's own words. */
852
+ function reportRowQuery(params) {
853
+ const q = new URLSearchParams();
854
+ if (params.winner)
855
+ q.set('winner', params.winner);
856
+ if (params.candidate_passed != null)
857
+ q.set('candidate_passed', String(params.candidate_passed));
858
+ if (params.incumbent_passed != null)
859
+ q.set('incumbent_passed', String(params.incumbent_passed));
860
+ if (params.has_reference != null)
861
+ q.set('has_reference', String(params.has_reference));
862
+ if (params.status)
863
+ q.set('status', params.status);
864
+ if (params.sort)
865
+ q.set('sort', params.sort);
866
+ if (params.q)
867
+ q.set('q', params.q);
868
+ return q;
755
869
  }