runbios-sdk 0.2.20-rc.291 → 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 +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.js +1 -1
- package/dist/resources/inference.js +1 -1
- package/dist/resources/loop.d.ts +57 -8
- package/dist/resources/loop.js +90 -13
- package/dist/types.d.ts +481 -21
- package/package.json +1 -1
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-
|
|
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.
|
|
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, EvaluationItemJudge, EvaluationReferenceKind, EvaluationReference, EvaluationPairwiseOrder, EvaluationItemPairwise, EvaluationItemSide, EvaluationItem, EvaluationItemListParams, BenchmarkStatus, BenchmarkSourceKind, BenchmarkRunStatus, BenchmarkScoring, 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, 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, VersionHoldout, 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.
|
|
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-
|
|
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
|
}
|
package/dist/resources/loop.d.ts
CHANGED
|
@@ -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, BenchmarkRunItemListParams, BenchmarkRunItemsResponse, 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.
|
|
@@ -371,7 +371,12 @@ export declare class Loop {
|
|
|
371
371
|
* fixed `floors` a pipeline is held to: the samples its first attempt
|
|
372
372
|
* needs, and the new samples each later attempt waits for
|
|
373
373
|
* (`new_samples`, or `new_samples_percent` of the rows the last trained
|
|
374
|
-
* attempt trained on when that is more)
|
|
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.
|
|
375
380
|
*/
|
|
376
381
|
listModels(): Promise<LoopModelsResponse>;
|
|
377
382
|
/**
|
|
@@ -382,14 +387,17 @@ export declare class Loop {
|
|
|
382
387
|
* the platform trains a new version on GPUs it chooses, compares it with what
|
|
383
388
|
* serves your traffic, and promotes it by the pipeline's promotion policy.
|
|
384
389
|
* What is charged is the GPU time the runs actually use; the platform's own
|
|
385
|
-
* 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.
|
|
386
393
|
*/
|
|
387
394
|
createPipeline(params: PipelineWriteRequest): Promise<PipelineMutationResponse>;
|
|
388
395
|
/**
|
|
389
396
|
* Edit a pipeline. Only the fields sent change; `max_versions: null` removes
|
|
390
397
|
* the limit and `challenger_model: null` removes the challenger. `promotion`
|
|
391
|
-
* is how the promotion policy is set.
|
|
392
|
-
*
|
|
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.
|
|
393
401
|
*/
|
|
394
402
|
updatePipeline(id: string, params: PipelineWriteRequest): Promise<PipelineMutationResponse>;
|
|
395
403
|
/**
|
|
@@ -438,6 +446,23 @@ export declare class Loop {
|
|
|
438
446
|
* VERSION numbers; with both, `differences` says b minus a per benchmark.
|
|
439
447
|
*/
|
|
440
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>;
|
|
441
466
|
/**
|
|
442
467
|
* The comparison behind a verdict: both models on the same held-out rows,
|
|
443
468
|
* with identical decoding, scored by the same judge.
|
|
@@ -462,6 +487,16 @@ export declare class Loop {
|
|
|
462
487
|
* serving today won; the item itself says `incumbent`) or `tie` -- and read
|
|
463
488
|
* `serving` first: the pairs the attempt lost are where a verdict is actually
|
|
464
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.
|
|
465
500
|
*/
|
|
466
501
|
listEvaluationItems(id: string, params?: EvaluationItemListParams): Promise<EvaluationItemsResponse>;
|
|
467
502
|
/**
|
|
@@ -475,14 +510,24 @@ export declare class Loop {
|
|
|
475
510
|
* replayed against both models on every run that finishes its comparison,
|
|
476
511
|
* and reported as two absolute numbers on a scale that does not move.
|
|
477
512
|
*
|
|
478
|
-
* 20 to 200 conversations. A named conversation with nothing to ask a model
|
|
479
|
-
*
|
|
480
|
-
*
|
|
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.
|
|
481
520
|
*
|
|
482
521
|
* The platform freezes the judge and the model it scores on (the ones every
|
|
483
522
|
* pipeline comparison uses), gives both models the comparison's own answer
|
|
484
523
|
* length, and sets what one replay may spend, inside the attempt's own
|
|
485
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.
|
|
486
531
|
*/
|
|
487
532
|
createBenchmark(params: BenchmarkCreateParams): Promise<Benchmark>;
|
|
488
533
|
/** Your benchmarks, newest first. Filter by `status` to hide retired ones. */
|
|
@@ -551,6 +596,10 @@ export declare class Loop {
|
|
|
551
596
|
* exactly as on a comparison report's items. `limit` is 50 when absent and
|
|
552
597
|
* at most 200. A replay that stopped before it began has no conversations:
|
|
553
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`.
|
|
554
603
|
*/
|
|
555
604
|
listBenchmarkRunItems(id: string, params?: BenchmarkRunItemListParams): Promise<BenchmarkRunItemsResponse>;
|
|
556
605
|
}
|
package/dist/resources/loop.js
CHANGED
|
@@ -515,7 +515,12 @@ export class Loop {
|
|
|
515
515
|
* fixed `floors` a pipeline is held to: the samples its first attempt
|
|
516
516
|
* needs, and the new samples each later attempt waits for
|
|
517
517
|
* (`new_samples`, or `new_samples_percent` of the rows the last trained
|
|
518
|
-
* attempt trained on when that is more)
|
|
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.
|
|
519
524
|
*/
|
|
520
525
|
async listModels() {
|
|
521
526
|
const res = await this._http.fetchGet('/api/loop/models');
|
|
@@ -529,7 +534,9 @@ export class Loop {
|
|
|
529
534
|
* the platform trains a new version on GPUs it chooses, compares it with what
|
|
530
535
|
* serves your traffic, and promotes it by the pipeline's promotion policy.
|
|
531
536
|
* What is charged is the GPU time the runs actually use; the platform's own
|
|
532
|
-
* 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.
|
|
533
540
|
*/
|
|
534
541
|
async createPipeline(params) {
|
|
535
542
|
return this._http.fetchPost('/api/loop/pipelines', params);
|
|
@@ -537,8 +544,9 @@ export class Loop {
|
|
|
537
544
|
/**
|
|
538
545
|
* Edit a pipeline. Only the fields sent change; `max_versions: null` removes
|
|
539
546
|
* the limit and `challenger_model: null` removes the challenger. `promotion`
|
|
540
|
-
* is how the promotion policy is set.
|
|
541
|
-
*
|
|
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.
|
|
542
550
|
*/
|
|
543
551
|
async updatePipeline(id, params) {
|
|
544
552
|
return this._http.fetchPut(`/api/loop/pipelines/${encodeURIComponent(id)}`, params);
|
|
@@ -612,6 +620,34 @@ export class Loop {
|
|
|
612
620
|
const qs = q.toString();
|
|
613
621
|
return this._http.fetchGet(`/api/loop/pipelines/${encodeURIComponent(id)}/versions/compare${qs ? `?${qs}` : ''}`);
|
|
614
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
|
+
}
|
|
615
651
|
// ── the comparison report ─────────────────────────────────────────────
|
|
616
652
|
/**
|
|
617
653
|
* The comparison behind a verdict: both models on the same held-out rows,
|
|
@@ -639,11 +675,21 @@ export class Loop {
|
|
|
639
675
|
* serving today won; the item itself says `incumbent`) or `tie` -- and read
|
|
640
676
|
* `serving` first: the pairs the attempt lost are where a verdict is actually
|
|
641
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.
|
|
642
688
|
*/
|
|
643
689
|
async listEvaluationItems(id, params = {}) {
|
|
644
|
-
const q =
|
|
645
|
-
if (params.
|
|
646
|
-
q.set('
|
|
690
|
+
const q = reportRowQuery(params);
|
|
691
|
+
if (params.orders)
|
|
692
|
+
q.set('orders', params.orders);
|
|
647
693
|
if (params.limit != null)
|
|
648
694
|
q.set('limit', String(params.limit));
|
|
649
695
|
if (params.offset != null)
|
|
@@ -663,14 +709,24 @@ export class Loop {
|
|
|
663
709
|
* replayed against both models on every run that finishes its comparison,
|
|
664
710
|
* and reported as two absolute numbers on a scale that does not move.
|
|
665
711
|
*
|
|
666
|
-
* 20 to 200 conversations. A named conversation with nothing to ask a model
|
|
667
|
-
*
|
|
668
|
-
*
|
|
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.
|
|
669
719
|
*
|
|
670
720
|
* The platform freezes the judge and the model it scores on (the ones every
|
|
671
721
|
* pipeline comparison uses), gives both models the comparison's own answer
|
|
672
722
|
* length, and sets what one replay may spend, inside the attempt's own
|
|
673
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.
|
|
674
730
|
*/
|
|
675
731
|
async createBenchmark(params) {
|
|
676
732
|
const res = await this._http.fetchPost('/api/loop/benchmarks', params);
|
|
@@ -777,11 +833,13 @@ export class Loop {
|
|
|
777
833
|
* exactly as on a comparison report's items. `limit` is 50 when absent and
|
|
778
834
|
* at most 200. A replay that stopped before it began has no conversations:
|
|
779
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`.
|
|
780
840
|
*/
|
|
781
841
|
async listBenchmarkRunItems(id, params = {}) {
|
|
782
|
-
const q =
|
|
783
|
-
if (params.winner)
|
|
784
|
-
q.set('winner', params.winner);
|
|
842
|
+
const q = reportRowQuery(params);
|
|
785
843
|
if (params.limit != null)
|
|
786
844
|
q.set('limit', String(params.limit));
|
|
787
845
|
if (params.offset != null)
|
|
@@ -790,3 +848,22 @@ export class Loop {
|
|
|
790
848
|
return this._http.fetchGet(`/api/loop/benchmark-runs/${encodeURIComponent(id)}/items${qs ? `?${qs}` : ''}`);
|
|
791
849
|
}
|
|
792
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;
|
|
869
|
+
}
|
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-
|
|
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-
|
|
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;
|
|
@@ -749,6 +749,14 @@ export interface TrainingJob {
|
|
|
749
749
|
has_cached_dataset?: boolean;
|
|
750
750
|
final_model_s3_key?: string | null;
|
|
751
751
|
final_artifact_verified?: boolean;
|
|
752
|
+
/** Final model of a completed run: 'verified' (stored), 'deleted' (was saved and
|
|
753
|
+
* verified, then deleted on purpose; not a failed save), 'unavailable' (never
|
|
754
|
+
* committed). '' for runs that are not completed; absent on older backends. */
|
|
755
|
+
final_artifact_state?: 'verified' | 'deleted' | 'unavailable' | '';
|
|
756
|
+
/** When a 'deleted' final model was removed. */
|
|
757
|
+
final_artifact_deleted_at?: string | null;
|
|
758
|
+
/** Who removed it: 'you' | 'member' | 'system:pipeline_deleted' | 'system:save_total_limit' | other 'system:*'. */
|
|
759
|
+
final_artifact_deleted_by?: string | null;
|
|
752
760
|
mix_manifest?: Record<string, unknown> | null;
|
|
753
761
|
preserve_on_stop?: boolean;
|
|
754
762
|
desired_state?: 'running' | 'stopped';
|
|
@@ -2894,9 +2902,34 @@ export type TrainingRunState = 'built' | 'registering' | 'dataset_validating' |
|
|
|
2894
2902
|
/** The closed set a run never leaves. */
|
|
2895
2903
|
export declare const TERMINAL_RUN_STATES: readonly TrainingRunState[];
|
|
2896
2904
|
export type TrainingVerdict = 'better' | 'not_better' | 'inconclusive' | 'not_evaluated';
|
|
2897
|
-
|
|
2905
|
+
/**
|
|
2906
|
+
* What was decided about a compared attempt, and who decided: `promoted` (a
|
|
2907
|
+
* member put it live), `auto_promoted`, `rejected` (a member chose not to
|
|
2908
|
+
* publish it), `auto_rejected` (the pipeline's rule turned it down on its
|
|
2909
|
+
* own), `expired` (nobody decided before the review deadline, so it was
|
|
2910
|
+
* retired; its verdict, `better` included, stands) or `rolled_back`.
|
|
2911
|
+
*/
|
|
2912
|
+
export type TrainingDecision = 'auto_promoted' | 'promoted' | 'rejected' | 'auto_rejected' | 'expired' | 'rolled_back';
|
|
2898
2913
|
export type EvaluationStatus = 'open' | 'done' | 'failed' | 'budget_stopped';
|
|
2899
2914
|
export type EvaluationItemStatus = 'pending' | 'working' | 'done' | 'failed';
|
|
2915
|
+
/**
|
|
2916
|
+
* Why a failed conversation of a report failed (`error_code` on both items
|
|
2917
|
+
* routes), from a closed set; the row's `error` is the sentence for a person.
|
|
2918
|
+
* unreadable / unprepared: the conversation could not be read or prepared to
|
|
2919
|
+
* be asked. too_large_to_keep: too large to keep in storage. no_right_answer:
|
|
2920
|
+
* an exact-check benchmark's conversation with no right answer.
|
|
2921
|
+
* incumbent_unanswered / candidate_unanswered / scorer_failed: on its last
|
|
2922
|
+
* try the other side, or the new model, could not answer, or an answer could
|
|
2923
|
+
* not be scored. ended_outage / ended_deployment_stopped / ended_unscorable:
|
|
2924
|
+
* the comparison ended before it (an outage on the platform's side, a
|
|
2925
|
+
* stopped deployment, nothing able to score it). run_ended / replay_ended: its
|
|
2926
|
+
* attempt or replay ended first. answers_not_kept: replayed, its answers
|
|
2927
|
+
* held until storage could keep them, and storage could not before the
|
|
2928
|
+
* replay ended (a conversation never asked is replay_ended). not_finished:
|
|
2929
|
+
* its tries (or the comparison's money) ran out with nothing more particular
|
|
2930
|
+
* recorded.
|
|
2931
|
+
*/
|
|
2932
|
+
export type ItemErrorCode = 'unreadable' | 'unprepared' | 'too_large_to_keep' | 'no_right_answer' | 'incumbent_unanswered' | 'candidate_unanswered' | 'scorer_failed' | 'ended_outage' | 'ended_deployment_stopped' | 'ended_unscorable' | 'run_ended' | 'replay_ended' | 'answers_not_kept' | 'not_finished';
|
|
2900
2933
|
export type EvaluationWinner = 'candidate' | 'incumbent' | 'tie';
|
|
2901
2934
|
/** Typed warning codes. Each surface renders its own plain sentence. */
|
|
2902
2935
|
export type EvaluationWarningCode = 'holdout_too_small' | 'judge_unreliable' | 'graders_not_applied' | 'many_failures' | 'no_judge' | 'judge_labelled_training_rows' | 'capture_source_moved';
|
|
@@ -3237,10 +3270,15 @@ export type EvaluationReferenceKind = 'good' | 'correction' | 'gold';
|
|
|
3237
3270
|
/**
|
|
3238
3271
|
* What a person said the right answer is, frozen with the report and shown
|
|
3239
3272
|
* to the judge beside both answers. Null on a conversation nobody gave one.
|
|
3273
|
+
*
|
|
3274
|
+
* A right answer is its text AND the tool calls it makes: an answer marked
|
|
3275
|
+
* good that only calls a tool has `answer` `""` and its calls.
|
|
3276
|
+
* `tool_calls` is null when it makes none.
|
|
3240
3277
|
*/
|
|
3241
3278
|
export interface EvaluationReference {
|
|
3242
3279
|
answer: string;
|
|
3243
3280
|
kind: EvaluationReferenceKind;
|
|
3281
|
+
tool_calls: TrainingToolCall[] | null;
|
|
3244
3282
|
}
|
|
3245
3283
|
/** Which answer the judge preferred in one order of showing them, and why. */
|
|
3246
3284
|
export interface EvaluationPairwiseOrder {
|
|
@@ -3291,6 +3329,8 @@ export interface EvaluationItem {
|
|
|
3291
3329
|
winner: EvaluationWinner | null;
|
|
3292
3330
|
status: EvaluationItemStatus;
|
|
3293
3331
|
error: string | null;
|
|
3332
|
+
/** Why the row failed; null unless it failed, and on a row failed before causes were kept. */
|
|
3333
|
+
error_code: ItemErrorCode | null;
|
|
3294
3334
|
}
|
|
3295
3335
|
/**
|
|
3296
3336
|
* Which pairs to read: the ones the attempt won (`candidate`), the ones the
|
|
@@ -3298,8 +3338,39 @@ export interface EvaluationItem {
|
|
|
3298
3338
|
* or the ties.
|
|
3299
3339
|
*/
|
|
3300
3340
|
export type EvaluationItemWinnerFilter = 'candidate' | 'serving' | 'tie';
|
|
3341
|
+
/** A row's status: scored, or failed (could not be scored). */
|
|
3342
|
+
export type ReportStatusFilter = 'scored' | 'failed';
|
|
3343
|
+
/**
|
|
3344
|
+
* The order of a report's rows: its own (`ordinal`, the default), or the new
|
|
3345
|
+
* model's score less the other's, largest first (`score_change`).
|
|
3346
|
+
*/
|
|
3347
|
+
export type ReportSort = 'ordinal' | 'score_change';
|
|
3348
|
+
/**
|
|
3349
|
+
* Which rows of a report to read, and in what order. Every filter narrows the
|
|
3350
|
+
* page and `total` alike; a value the service does not take is refused 400
|
|
3351
|
+
* naming it. `candidate_passed` and `incumbent_passed` are one side each and
|
|
3352
|
+
* compose: `true` is that side's answer passed (score 0.70 or more), `false`
|
|
3353
|
+
* that it was scored below 0.70, and a side with no score matches neither --
|
|
3354
|
+
* `candidate_passed: false, incumbent_passed: true` is the regressions,
|
|
3355
|
+
* `candidate_passed: false` alone every row the new model did not pass.
|
|
3356
|
+
* `q` (2 to 200 characters) searches, case-insensitively, what a
|
|
3357
|
+
* reader of each row sees -- the conversation, the right answer, both answers
|
|
3358
|
+
* and their tool calls, every reason -- read from storage by the service; the
|
|
3359
|
+
* answer's `searched` says how many rows it searched. A search can be refused
|
|
3360
|
+
* 429 `RATE_LIMITED`, with `Retry-After`, while this workspace already has a
|
|
3361
|
+
* search running or while the service is running as many searches as it can
|
|
3362
|
+
* at once; try again after `Retry-After` seconds (the message says how many).
|
|
3363
|
+
*/
|
|
3301
3364
|
export interface EvaluationItemListParams {
|
|
3302
3365
|
winner?: EvaluationItemWinnerFilter;
|
|
3366
|
+
candidate_passed?: boolean;
|
|
3367
|
+
incumbent_passed?: boolean;
|
|
3368
|
+
/** Whether the two side-by-side orders picked the same side. */
|
|
3369
|
+
orders?: 'agreed' | 'disagreed';
|
|
3370
|
+
has_reference?: boolean;
|
|
3371
|
+
status?: ReportStatusFilter;
|
|
3372
|
+
sort?: ReportSort;
|
|
3373
|
+
q?: string;
|
|
3303
3374
|
/** 50 when absent; at most 200. */
|
|
3304
3375
|
limit?: number;
|
|
3305
3376
|
offset?: number;
|
|
@@ -3350,11 +3421,31 @@ export type BenchmarkRunStatus = 'open' | 'done' | 'failed' | 'budget_stopped' |
|
|
|
3350
3421
|
* is a missing number, never a lower one.
|
|
3351
3422
|
*/
|
|
3352
3423
|
export interface BenchmarkScoring {
|
|
3424
|
+
/** `judge_overall` (a scoring model) or `exact_match` (the exact check). */
|
|
3353
3425
|
metric: string;
|
|
3354
3426
|
scale: string;
|
|
3355
3427
|
aggregate: string;
|
|
3356
3428
|
require_all_rows: boolean;
|
|
3357
3429
|
}
|
|
3430
|
+
/**
|
|
3431
|
+
* How a benchmark's answers are scored, chosen when it is made and frozen:
|
|
3432
|
+
*
|
|
3433
|
+
* - `judge` (the default): a scoring model reads both answers against the
|
|
3434
|
+
* right answer, as for the held-back set.
|
|
3435
|
+
* - `exact`: the answer or the tool call must match the right answer, and no
|
|
3436
|
+
* model is asked. When the right answer calls tools, the answer must make
|
|
3437
|
+
* the same calls (the same tools with JSON-equal arguments, in any order,
|
|
3438
|
+
* none left out and none extra; its text is not read); otherwise its text
|
|
3439
|
+
* must be the right answer's ignoring case and spacing, or both the same
|
|
3440
|
+
* number (a currency or percent sign on one side only is ignored; `$20` is
|
|
3441
|
+
* not `20%` or `€20`). 1 or 0, and each side's `judge` is
|
|
3442
|
+
* `{overall, dimensions: {match}, reason}`, the reason saying what matched
|
|
3443
|
+
* or what differed. Every conversation needs a right answer. A value hidden
|
|
3444
|
+
* when the conversation was captured (an email, a long number, an IP
|
|
3445
|
+
* address or a key, kept as `[redacted:...]`) cannot be checked: an answer
|
|
3446
|
+
* that matches everywhere else still scores 0, and the reason says so.
|
|
3447
|
+
*/
|
|
3448
|
+
export type BenchmarkCheck = 'judge' | 'exact';
|
|
3358
3449
|
/**
|
|
3359
3450
|
* One rubric dimension of one replay, for both models.
|
|
3360
3451
|
*
|
|
@@ -3367,6 +3458,19 @@ export interface BenchmarkDimensionScore {
|
|
|
3367
3458
|
candidate: number;
|
|
3368
3459
|
delta: number;
|
|
3369
3460
|
}
|
|
3461
|
+
/**
|
|
3462
|
+
* What a pipeline's history, or a benchmark's pinned set, takes up in storage
|
|
3463
|
+
* right now. Conversations, answers and scoring, and the training rows of a
|
|
3464
|
+
* pipeline's curated sets, are kept in storage only, never in the database. Not billed; it counts toward the workspace's storage
|
|
3465
|
+
* quota and is deleted with the pipeline (a benchmark's with the workspace).
|
|
3466
|
+
* `where` is null while nothing is stored.
|
|
3467
|
+
*/
|
|
3468
|
+
export type LoopStorageWhere = 'platform' | 'your_storage' | 'both';
|
|
3469
|
+
export interface LoopStorage {
|
|
3470
|
+
bytes: number;
|
|
3471
|
+
objects: number;
|
|
3472
|
+
where: LoopStorageWhere | null;
|
|
3473
|
+
}
|
|
3370
3474
|
/**
|
|
3371
3475
|
* The frozen definition: the oracle, the scoring rule and the fingerprint of
|
|
3372
3476
|
* the set. The conversations themselves are their own paged route.
|
|
@@ -3376,6 +3480,11 @@ export interface Benchmark {
|
|
|
3376
3480
|
workspace_id: string;
|
|
3377
3481
|
name: string;
|
|
3378
3482
|
status: BenchmarkStatus;
|
|
3483
|
+
/**
|
|
3484
|
+
* How its answers are scored (`scoring.metric` read out). On an `exact`
|
|
3485
|
+
* benchmark `judge_model` is `""` and the judge fields describe the check.
|
|
3486
|
+
*/
|
|
3487
|
+
check: BenchmarkCheck;
|
|
3379
3488
|
/** Provenance only: everything needed from the judge is copied below it. */
|
|
3380
3489
|
judge_id: string | null;
|
|
3381
3490
|
judge_name: string;
|
|
@@ -3391,6 +3500,8 @@ export interface Benchmark {
|
|
|
3391
3500
|
created_at: string;
|
|
3392
3501
|
retired_at: string | null;
|
|
3393
3502
|
retired_by: string | null;
|
|
3503
|
+
/** What the pinned set takes up in storage. */
|
|
3504
|
+
storage: LoopStorage;
|
|
3394
3505
|
}
|
|
3395
3506
|
/**
|
|
3396
3507
|
* One pinned conversation.
|
|
@@ -3407,6 +3518,8 @@ export interface BenchmarkItem {
|
|
|
3407
3518
|
source_trace_url: string | null;
|
|
3408
3519
|
prompt: TrainingMessage[];
|
|
3409
3520
|
tools: unknown[] | null;
|
|
3521
|
+
/** The right answer pinned with it, calls and all; null when nobody gave one. */
|
|
3522
|
+
reference: EvaluationReference | null;
|
|
3410
3523
|
}
|
|
3411
3524
|
/**
|
|
3412
3525
|
* One replay: this benchmark, on this training run, against both models.
|
|
@@ -3453,7 +3566,9 @@ export interface BenchmarkRun {
|
|
|
3453
3566
|
candidate_pass_rate: number | null;
|
|
3454
3567
|
/**
|
|
3455
3568
|
* Conversations the attempt scored higher on (`wins`), lower on (`losses`),
|
|
3456
|
-
* or
|
|
3569
|
+
* or about the same on (`ties`) as the serving version, by the tie band
|
|
3570
|
+
* promotion uses: 0.02 or more above counts as higher; less than 0.02 apart
|
|
3571
|
+
* is about the same.
|
|
3457
3572
|
* Null unless `status` is `done`.
|
|
3458
3573
|
*/
|
|
3459
3574
|
wins: number | null;
|
|
@@ -3498,9 +3613,15 @@ export interface BenchmarkHistoryPoint {
|
|
|
3498
3613
|
status: BenchmarkRunStatus;
|
|
3499
3614
|
status_reason: string | null;
|
|
3500
3615
|
}
|
|
3501
|
-
/**
|
|
3616
|
+
/**
|
|
3617
|
+
* One model's answer to one pinned conversation in a replay -- its text and
|
|
3618
|
+
* the tool calls it made (null when none, and on a replay scored before they
|
|
3619
|
+
* were kept) -- and its score. On an exact benchmark `judge` is the exact
|
|
3620
|
+
* check's verdict.
|
|
3621
|
+
*/
|
|
3502
3622
|
export interface BenchmarkRunItemSide {
|
|
3503
3623
|
completion: string | null;
|
|
3624
|
+
tool_calls: TrainingToolCall[] | null;
|
|
3504
3625
|
judge: EvaluationItemJudge | null;
|
|
3505
3626
|
score: number | null;
|
|
3506
3627
|
/** True when it passed (score 0.70 or more); null when it has no score. */
|
|
@@ -3510,8 +3631,9 @@ export interface BenchmarkRunItemSide {
|
|
|
3510
3631
|
* One pinned conversation of one replay: the prompt, both answers, what the
|
|
3511
3632
|
* judge made of each, and which side won it.
|
|
3512
3633
|
*
|
|
3513
|
-
* `winner` compares the two scores
|
|
3514
|
-
*
|
|
3634
|
+
* `winner` compares the two scores by the tie band promotion uses: the side
|
|
3635
|
+
* scoring 0.02 or more above the other, `tie` when they are less than 0.02
|
|
3636
|
+
* apart, and null until both are scored.
|
|
3515
3637
|
* `source_trace_id` goes null once the conversation it was pinned from is
|
|
3516
3638
|
* deleted; the pinned copy stays.
|
|
3517
3639
|
*/
|
|
@@ -3529,10 +3651,21 @@ export interface BenchmarkRunItem {
|
|
|
3529
3651
|
winner: EvaluationWinner | null;
|
|
3530
3652
|
status: EvaluationItemStatus;
|
|
3531
3653
|
error: string | null;
|
|
3654
|
+
/** Why the row failed; null unless it failed, and on a row failed before causes were kept. */
|
|
3655
|
+
error_code: ItemErrorCode | null;
|
|
3532
3656
|
}
|
|
3533
|
-
/**
|
|
3657
|
+
/**
|
|
3658
|
+
* Which conversations of a replay to read: the filters a report's items take,
|
|
3659
|
+
* but `orders` -- a replay has no side-by-side reading.
|
|
3660
|
+
*/
|
|
3534
3661
|
export interface BenchmarkRunItemListParams {
|
|
3535
3662
|
winner?: EvaluationItemWinnerFilter;
|
|
3663
|
+
candidate_passed?: boolean;
|
|
3664
|
+
incumbent_passed?: boolean;
|
|
3665
|
+
has_reference?: boolean;
|
|
3666
|
+
status?: ReportStatusFilter;
|
|
3667
|
+
sort?: ReportSort;
|
|
3668
|
+
q?: string;
|
|
3536
3669
|
/** 50 when absent; at most 200. */
|
|
3537
3670
|
limit?: number;
|
|
3538
3671
|
offset?: number;
|
|
@@ -3550,20 +3683,30 @@ export interface BenchmarkSource {
|
|
|
3550
3683
|
/**
|
|
3551
3684
|
* The pin: 20 to 200 conversations, and a judge with a rubric to measure them.
|
|
3552
3685
|
*
|
|
3553
|
-
* A conversation with nothing to ask a model
|
|
3686
|
+
* A conversation with nothing to ask a model, or too large to keep in
|
|
3687
|
+
* storage, is refused (422 `BENCHMARK_ROW_UNUSABLE`) rather than skipped.
|
|
3554
3688
|
* Pinning 47 of the 50 somebody chose is the set being wrong from the first
|
|
3555
3689
|
* day, and they would never find out.
|
|
3556
3690
|
*/
|
|
3557
3691
|
/**
|
|
3558
|
-
* A name and
|
|
3559
|
-
* and the model it scores on, gives both models
|
|
3560
|
-
* length, and sets what one replay may spend;
|
|
3561
|
-
* service refuses `judge_id`, `judge_model`,
|
|
3562
|
-
* `per_run_ceiling_cents` by name).
|
|
3692
|
+
* A name, the conversations and how they are scored, nothing else. The
|
|
3693
|
+
* platform freezes the judge and the model it scores on, gives both models
|
|
3694
|
+
* the comparison's own answer length, and sets what one replay may spend;
|
|
3695
|
+
* none of that is sent (the service refuses `judge_id`, `judge_model`,
|
|
3696
|
+
* `max_tokens` and `per_run_ceiling_cents` by name).
|
|
3697
|
+
*
|
|
3698
|
+
* `check` is `judge` when absent. An `exact` benchmark needs a right answer
|
|
3699
|
+
* on every conversation: one without is refused 422
|
|
3700
|
+
* `BENCHMARK_ROW_HAS_NO_ANSWER`, naming it, and nothing is saved. One with
|
|
3701
|
+
* nothing to ask a model, or too large to keep in storage, is refused 422
|
|
3702
|
+
* `BENCHMARK_ROW_UNUSABLE`, naming it; and when the conversations cannot be
|
|
3703
|
+
* stored just then the create is refused 409 `CONFLICT` with nothing saved
|
|
3704
|
+
* (try again in a minute).
|
|
3563
3705
|
*/
|
|
3564
3706
|
export interface BenchmarkCreateParams {
|
|
3565
3707
|
name: string;
|
|
3566
3708
|
source: BenchmarkSource;
|
|
3709
|
+
check?: BenchmarkCheck;
|
|
3567
3710
|
}
|
|
3568
3711
|
export interface BenchmarkListParams {
|
|
3569
3712
|
status?: BenchmarkStatus;
|
|
@@ -3644,7 +3787,9 @@ export type TrainingRuleRunRefusalCode = 'NOT_ENOUGH_SAMPLES' | 'PIPELINE_NEEDS_
|
|
|
3644
3787
|
*
|
|
3645
3788
|
* An edit only:
|
|
3646
3789
|
* - `REVISION_MISMATCH` (409): `expected_revision` is not the pipeline's
|
|
3647
|
-
* revision any more
|
|
3790
|
+
* revision any more, or the pipeline changed while the edit was being saved
|
|
3791
|
+
* (a version went live, which can change its models). Nothing was saved.
|
|
3792
|
+
* Read it again and resend.
|
|
3648
3793
|
* - `RUN_ACTIVE` (409): the model cannot change while an attempt is running.
|
|
3649
3794
|
* - `NOT_A_SIMPLE_PIPELINE` (409): a tag, use case or challenger edit on a
|
|
3650
3795
|
* pipeline created before pipelines had them; its other settings can
|
|
@@ -3652,7 +3797,10 @@ export type TrainingRuleRunRefusalCode = 'NOT_ENOUGH_SAMPLES' | 'PIPELINE_NEEDS_
|
|
|
3652
3797
|
*
|
|
3653
3798
|
* The model and how it is promoted:
|
|
3654
3799
|
* - `MODEL_NOT_TRAINABLE` (422): `model.id` or `challenger_model.id` is not a
|
|
3655
|
-
* model `listModels` offers, or the challenger is the model itself.
|
|
3800
|
+
* model `listModels` offers, or the challenger is the model itself. On an
|
|
3801
|
+
* edit only a changed id is checked against the list: an id equal to the
|
|
3802
|
+
* pipeline's current one (ignoring case) is kept, and whether it can still
|
|
3803
|
+
* be trained is checked when an attempt starts.
|
|
3656
3804
|
* - `NO_GPU_FITS` (422): no machines can train or serve the model right now.
|
|
3657
3805
|
* - `MODEL_REVISION_UNAVAILABLE` (422): the model could not be pinned to an
|
|
3658
3806
|
* exact revision because the training service did not answer. Try again
|
|
@@ -3877,6 +4025,14 @@ export interface PipelineAttempt {
|
|
|
3877
4025
|
base_model_id: string | null;
|
|
3878
4026
|
model_family: string | null;
|
|
3879
4027
|
outcome: PipelineAttemptOutcome;
|
|
4028
|
+
/**
|
|
4029
|
+
* What was decided about it once it was compared; null while nothing has
|
|
4030
|
+
* been. A member's rejection is `rejected` where the outcome says `stopped`.
|
|
4031
|
+
*/
|
|
4032
|
+
decision: TrainingDecision | null;
|
|
4033
|
+
/** The samples its set trained on and held back; null until its set was built. */
|
|
4034
|
+
train_rows: number | null;
|
|
4035
|
+
holdout_rows: number | null;
|
|
3880
4036
|
/** The version it became, when it became one. */
|
|
3881
4037
|
version: number | null;
|
|
3882
4038
|
created_at: string;
|
|
@@ -3928,9 +4084,27 @@ export interface PipelineSchedule {
|
|
|
3928
4084
|
export interface PipelineTrainWhen {
|
|
3929
4085
|
schedule: PipelineSchedule | null;
|
|
3930
4086
|
}
|
|
3931
|
-
/**
|
|
4087
|
+
/**
|
|
4088
|
+
* What is held back to judge each attempt by, and never trained on:
|
|
4089
|
+
* max(`min_rows`, `percent`% of the pipeline's samples). The set is sticky:
|
|
4090
|
+
* lowering the percent releases no sample already held back, and raising it
|
|
4091
|
+
* holds back only samples no attempt trained on.
|
|
4092
|
+
*/
|
|
3932
4093
|
export interface PipelineHoldout {
|
|
4094
|
+
/** The pipeline's share, 5 to 20 (5 unless a member chose more); set with `holdout.percent`. */
|
|
4095
|
+
percent: number;
|
|
4096
|
+
/** The floor, 100, held back whatever the share says. */
|
|
3933
4097
|
min_rows: number;
|
|
4098
|
+
/** How many samples it holds back today (= `holdout_size`). Detail only; null on the list. */
|
|
4099
|
+
rows: number | null;
|
|
4100
|
+
/**
|
|
4101
|
+
* How many of `rows` are held back because an earlier run of the pipeline
|
|
4102
|
+
* held them back: they stay held back whatever became of that run and
|
|
4103
|
+
* whatever the share says; the rest are the share's. Before the first
|
|
4104
|
+
* version it is what raises `minimums.needed` above the share's own (these
|
|
4105
|
+
* rows plus the 1,000 to train on). Detail only; null on the list.
|
|
4106
|
+
*/
|
|
4107
|
+
held_before: number | null;
|
|
3934
4108
|
}
|
|
3935
4109
|
/**
|
|
3936
4110
|
* How far the data is from the next attempt, by the platform's fixed
|
|
@@ -3941,7 +4115,13 @@ export interface PipelineHoldout {
|
|
|
3941
4115
|
* usable samples the last trained attempt did not have, which is
|
|
3942
4116
|
* `floors.new_samples` or `floors.new_samples_percent` of the rows that
|
|
3943
4117
|
* attempt trained on, whichever is more. `have`, `short` and `message` are
|
|
3944
|
-
* measured on the detail only.
|
|
4118
|
+
* measured on the detail only. There, after an attempt has trained, `short`
|
|
4119
|
+
* is how many more new samples have to arrive: new samples fill the held-back
|
|
4120
|
+
* set first, so after the held-back share is raised it can be more than
|
|
4121
|
+
* `needed` - `have`; and `have` is the new samples the next attempt would
|
|
4122
|
+
* train on, or the samples since that attempt when that count is what it
|
|
4123
|
+
* waits for. Train now's 422 NOT_ENOUGH_SAMPLES carries the same `have` and
|
|
4124
|
+
* `need`.
|
|
3945
4125
|
*/
|
|
3946
4126
|
export interface PipelineMinimums {
|
|
3947
4127
|
basis: 'first_version' | 'new_rows';
|
|
@@ -3984,8 +4164,9 @@ export interface Pipeline {
|
|
|
3984
4164
|
tags: string[];
|
|
3985
4165
|
/**
|
|
3986
4166
|
* A second base model trained on the same data after each attempt; it
|
|
3987
|
-
* becomes the next version only if it beats the live one
|
|
3988
|
-
*
|
|
4167
|
+
* becomes the next version only if it beats the live one, and then it
|
|
4168
|
+
* becomes the pipeline's model (`base_model_id`) while the model it replaced
|
|
4169
|
+
* becomes this one. `revision` is the commit the server pinned.
|
|
3989
4170
|
*/
|
|
3990
4171
|
challenger_model: PipelineModelRef | null;
|
|
3991
4172
|
train_when: PipelineTrainWhen;
|
|
@@ -4007,6 +4188,8 @@ export interface Pipeline {
|
|
|
4007
4188
|
* serves is not a deployment, or before the first check of that deployment.
|
|
4008
4189
|
*/
|
|
4009
4190
|
live_deployment: PipelineLiveDeployment | null;
|
|
4191
|
+
/** What the pipeline's history takes up in storage. */
|
|
4192
|
+
storage: LoopStorage;
|
|
4010
4193
|
/** The name the app calls. It does not change when a version is promoted. */
|
|
4011
4194
|
serving_name: string;
|
|
4012
4195
|
/**
|
|
@@ -4101,6 +4284,80 @@ export interface TrainingRunResponse {
|
|
|
4101
4284
|
benchmark_runs: TrainingRunBenchmarkRun[];
|
|
4102
4285
|
links: TrainingRunLinks;
|
|
4103
4286
|
available_actions: TrainingRunActions;
|
|
4287
|
+
/** What became of the attempt and why, measurement by measurement. */
|
|
4288
|
+
promotion: TrainingRunPromotion;
|
|
4289
|
+
/**
|
|
4290
|
+
* Every bar the held-back verdict applied, with what it needed, what it got
|
|
4291
|
+
* and whether it was met: the rule itself, which the verdict is read off.
|
|
4292
|
+
* Null until the comparison is finished, when no thresholds were recorded,
|
|
4293
|
+
* and for a report decided under an earlier rule that this list would read
|
|
4294
|
+
* differently from its verdict (`verdict_checks_withheld` says so).
|
|
4295
|
+
*/
|
|
4296
|
+
verdict_checks: VerdictCheck[] | null;
|
|
4297
|
+
/**
|
|
4298
|
+
* Why a finished report's `verdict_checks` is null although its thresholds
|
|
4299
|
+
* were recorded: `decided_under_earlier_rule` when an earlier version of
|
|
4300
|
+
* the rule decided it, so today's bars would not explain its verdict. Null
|
|
4301
|
+
* for every other null (not finished, no thresholds recorded) and when the
|
|
4302
|
+
* list is shown. Never rebuild the bars from today's rule for such a report.
|
|
4303
|
+
*/
|
|
4304
|
+
verdict_checks_withheld: VerdictChecksWithheld | null;
|
|
4305
|
+
/** What the attempt has cost, part by part, from the charges recorded on it. */
|
|
4306
|
+
cost: TrainingRunCost;
|
|
4307
|
+
}
|
|
4308
|
+
/** Why a run detail's `verdict_checks` is withheld. */
|
|
4309
|
+
export type VerdictChecksWithheld = 'decided_under_earlier_rule';
|
|
4310
|
+
/**
|
|
4311
|
+
* What became of an attempt and why. `decision` is what was done, and who
|
|
4312
|
+
* did it: `rejected` is a member choosing not to publish it, beside a
|
|
4313
|
+
* `verdict` that may say `better`; `auto_rejected` is the pipeline's rule
|
|
4314
|
+
* turning it down; `expired` is nobody deciding before the review deadline,
|
|
4315
|
+
* with `outcome` `stopped` when it was better. `policy` to `measurements` are the promotion rule's record, null
|
|
4316
|
+
* (and `[]`) when it recorded none: an attempt still being compared, one that
|
|
4317
|
+
* ended before it was, or one decided before the record was kept.
|
|
4318
|
+
*/
|
|
4319
|
+
export interface TrainingRunPromotion {
|
|
4320
|
+
/** As the pipeline's attempts list says it (`PipelineAttempt.outcome`). */
|
|
4321
|
+
outcome: PipelineAttemptOutcome;
|
|
4322
|
+
decision: TrainingDecision | null;
|
|
4323
|
+
policy: string | null;
|
|
4324
|
+
k: number | null;
|
|
4325
|
+
verdict: string | null;
|
|
4326
|
+
reason: string | null;
|
|
4327
|
+
weighted_delta: number | null;
|
|
4328
|
+
/** The held-back comparison first, then each benchmark, each with its outcome and reason. */
|
|
4329
|
+
measurements: PromotionMeasurement[];
|
|
4330
|
+
}
|
|
4331
|
+
/** The bars a held-back verdict applies. */
|
|
4332
|
+
export type VerdictCheckKey = 'rows_scored' | 'failures' | 'rubric' | 'mean_change' | 'win_rate' | 'beyond_chance';
|
|
4333
|
+
/**
|
|
4334
|
+
* One bar of the held-back verdict. `needed` and `got` are on the bar's own
|
|
4335
|
+
* scale -- conversations for `rows_scored` (at least) and `failures` (at
|
|
4336
|
+
* most), the score change for `mean_change` (at least), a share for
|
|
4337
|
+
* `win_rate` (at least), a probability for `beyond_chance` (at most) -- and
|
|
4338
|
+
* null where the bar has no number (`rubric`) or nothing produced one.
|
|
4339
|
+
*/
|
|
4340
|
+
export interface VerdictCheck {
|
|
4341
|
+
key: VerdictCheckKey;
|
|
4342
|
+
/** The bar in plain words, its direction included. */
|
|
4343
|
+
label: string;
|
|
4344
|
+
needed: number | null;
|
|
4345
|
+
got: number | null;
|
|
4346
|
+
met: boolean;
|
|
4347
|
+
}
|
|
4348
|
+
/**
|
|
4349
|
+
* An attempt's cost in cents, part by part. `total_cents` is the attempt's
|
|
4350
|
+
* `cost_cents` on the pipeline. `up_to` says `comparison_cents` (and so the
|
|
4351
|
+
* total) is the most the comparison machines can have cost rather than what
|
|
4352
|
+
* they did; the other three parts are always charges.
|
|
4353
|
+
*/
|
|
4354
|
+
export interface TrainingRunCost {
|
|
4355
|
+
training_cents: number;
|
|
4356
|
+
comparison_cents: number;
|
|
4357
|
+
scoring_cents: number;
|
|
4358
|
+
benchmark_cents: number;
|
|
4359
|
+
total_cents: number;
|
|
4360
|
+
up_to: boolean;
|
|
4104
4361
|
}
|
|
4105
4362
|
export interface TrainingRunActionResponse {
|
|
4106
4363
|
run: TrainingRun;
|
|
@@ -4110,12 +4367,16 @@ export interface TrainingRunActionResponse {
|
|
|
4110
4367
|
export interface EvaluationItemsResponse {
|
|
4111
4368
|
items: EvaluationItem[];
|
|
4112
4369
|
total: number;
|
|
4370
|
+
/** How many rows a `q` search read and searched; null without `q`. */
|
|
4371
|
+
searched: number | null;
|
|
4113
4372
|
}
|
|
4114
4373
|
/** A page of one replay's conversations, in the benchmark's order. */
|
|
4115
4374
|
export interface BenchmarkRunItemsResponse {
|
|
4116
4375
|
items: BenchmarkRunItem[];
|
|
4117
4376
|
/** Every conversation the filter matches, not only this page. */
|
|
4118
4377
|
total: number;
|
|
4378
|
+
/** How many rows a `q` search read and searched; null without `q`. */
|
|
4379
|
+
searched: number | null;
|
|
4119
4380
|
}
|
|
4120
4381
|
export interface InferenceAliasListResponse {
|
|
4121
4382
|
aliases: InferenceAlias[];
|
|
@@ -4193,6 +4454,21 @@ export interface PipelineWriteRequest {
|
|
|
4193
4454
|
policy: PipelinePromotion['policy'];
|
|
4194
4455
|
k?: number;
|
|
4195
4456
|
};
|
|
4457
|
+
/**
|
|
4458
|
+
* The share of the pipeline's samples held back to judge each attempt and
|
|
4459
|
+
* never trained on: a whole number from 5 to 20 (5 when absent on a
|
|
4460
|
+
* create; unchanged when absent on an edit). At least 100 are held back
|
|
4461
|
+
* whatever it says. Anything else is 400 naming `holdout.percent`, and
|
|
4462
|
+
* null is 400. It does not change what the pipeline may spend and nothing
|
|
4463
|
+
* is asked again: a new share is a new revision, saved at once. But a
|
|
4464
|
+
* larger share means more held-back samples are scored on each attempt (at
|
|
4465
|
+
* most `floors.held_back.scored_rows`), and scoring is paid from the
|
|
4466
|
+
* wallet. Lowering it keeps every sample already held back; raising it
|
|
4467
|
+
* holds back only new samples, which then do not count as new work.
|
|
4468
|
+
*/
|
|
4469
|
+
holdout?: {
|
|
4470
|
+
percent: number;
|
|
4471
|
+
};
|
|
4196
4472
|
/** 1 to 100, or null for no limit (the default). Counts versions, not attempts. */
|
|
4197
4473
|
max_versions?: number | null;
|
|
4198
4474
|
enabled?: boolean;
|
|
@@ -4221,7 +4497,11 @@ export interface LoopModel {
|
|
|
4221
4497
|
* sets them.
|
|
4222
4498
|
*/
|
|
4223
4499
|
export interface PipelineFloors {
|
|
4224
|
-
/**
|
|
4500
|
+
/**
|
|
4501
|
+
* Samples a new pipeline's first attempt needs at the default held-back
|
|
4502
|
+
* share: the rows it trains on plus the held-back set (a pipeline holding
|
|
4503
|
+
* back more needs more; its own `minimums` says how many).
|
|
4504
|
+
*/
|
|
4225
4505
|
first_version_samples: number;
|
|
4226
4506
|
/** The fewest new samples any later attempt waits for. */
|
|
4227
4507
|
new_samples: number;
|
|
@@ -4230,6 +4510,21 @@ export interface PipelineFloors {
|
|
|
4230
4510
|
* that a later attempt must add when that is more than `new_samples`.
|
|
4231
4511
|
*/
|
|
4232
4512
|
new_samples_percent: number;
|
|
4513
|
+
/** The held-back rule a pipeline chooses its share within. */
|
|
4514
|
+
held_back: HeldBackFloors;
|
|
4515
|
+
}
|
|
4516
|
+
/**
|
|
4517
|
+
* The held-back rule: a pipeline holds back max(`min_rows`, its percent of its
|
|
4518
|
+
* samples), and chooses the percent from `default_percent` to `max_percent`
|
|
4519
|
+
* (the body's `holdout.percent`). Each attempt is judged on at most
|
|
4520
|
+
* `scored_rows` of them (the same ones every time); a share that holds back
|
|
4521
|
+
* more than that only keeps samples out of training.
|
|
4522
|
+
*/
|
|
4523
|
+
export interface HeldBackFloors {
|
|
4524
|
+
min_rows: number;
|
|
4525
|
+
default_percent: number;
|
|
4526
|
+
max_percent: number;
|
|
4527
|
+
scored_rows: number;
|
|
4233
4528
|
}
|
|
4234
4529
|
export interface LoopModelsResponse {
|
|
4235
4530
|
models: LoopModel[];
|
|
@@ -4250,6 +4545,10 @@ export interface RuleBenchmark {
|
|
|
4250
4545
|
benchmark_status: string;
|
|
4251
4546
|
item_count: number;
|
|
4252
4547
|
items_digest: string;
|
|
4548
|
+
/** How it scores an answer: a scoring model reading its rubric (`judge`) or an exact check against its right answer (`exact`). */
|
|
4549
|
+
check: BenchmarkCheck;
|
|
4550
|
+
/** What its pinned set takes up in storage now: the figure the benchmark itself carries, this workspace's alone. */
|
|
4551
|
+
storage: LoopStorage;
|
|
4253
4552
|
/** False for a benchmark this pipeline stopped using; its history stays. */
|
|
4254
4553
|
attached: boolean;
|
|
4255
4554
|
/** 1 is the primary; null once removed. */
|
|
@@ -4284,6 +4583,8 @@ export interface CompareBenchmark {
|
|
|
4284
4583
|
name: string;
|
|
4285
4584
|
benchmark_status: string;
|
|
4286
4585
|
items_digest: string;
|
|
4586
|
+
/** How it scores an answer: `judge` or `exact`. */
|
|
4587
|
+
check: BenchmarkCheck;
|
|
4287
4588
|
attached: boolean;
|
|
4288
4589
|
priority: number | null;
|
|
4289
4590
|
added_at: string | null;
|
|
@@ -4382,6 +4683,165 @@ export interface VersionCompareParams {
|
|
|
4382
4683
|
a?: number;
|
|
4383
4684
|
b?: number;
|
|
4384
4685
|
}
|
|
4686
|
+
/**
|
|
4687
|
+
* b's score against a's on one held-back conversation, by the tie band:
|
|
4688
|
+
* 0.02 or more above counts as higher; less than 0.02 apart is about the same.
|
|
4689
|
+
*/
|
|
4690
|
+
export type AttemptDirection = 'higher' | 'lower' | 'same';
|
|
4691
|
+
/**
|
|
4692
|
+
* One attempt's held-back comparison against what it was compared with on its
|
|
4693
|
+
* day, over ITS OWN held-back set (the set grows between attempts: the
|
|
4694
|
+
* like-for-like figures are `shared_sample.a` and `.b`). Every number is null
|
|
4695
|
+
* until the comparison is finished; two attempts' win rates are never
|
|
4696
|
+
* subtracted, since their opponents differ.
|
|
4697
|
+
*/
|
|
4698
|
+
export interface AttemptHoldout {
|
|
4699
|
+
evaluation_id: string | null;
|
|
4700
|
+
status: EvaluationStatus | null;
|
|
4701
|
+
/** The scoring model its comparison froze when it opened; null for an attempt never compared. */
|
|
4702
|
+
judge_model: string | null;
|
|
4703
|
+
rows_scored: number | null;
|
|
4704
|
+
wins: number | null;
|
|
4705
|
+
losses: number | null;
|
|
4706
|
+
ties: number | null;
|
|
4707
|
+
win_rate: number | null;
|
|
4708
|
+
mean_delta: number | null;
|
|
4709
|
+
incumbent_mean: number | null;
|
|
4710
|
+
candidate_mean: number | null;
|
|
4711
|
+
/** The share each side passed (score 0.70 or more). */
|
|
4712
|
+
incumbent_pass_rate: number | null;
|
|
4713
|
+
candidate_pass_rate: number | null;
|
|
4714
|
+
}
|
|
4715
|
+
/** One side of an attempt comparison. */
|
|
4716
|
+
export interface AttemptCompareSide {
|
|
4717
|
+
run_id: string;
|
|
4718
|
+
attempt: number | null;
|
|
4719
|
+
version: number | null;
|
|
4720
|
+
trigger: PipelineAttemptTrigger;
|
|
4721
|
+
base_model_id: string | null;
|
|
4722
|
+
model_family: string | null;
|
|
4723
|
+
outcome: PipelineAttemptOutcome;
|
|
4724
|
+
verdict: TrainingVerdict | null;
|
|
4725
|
+
decision: TrainingDecision | null;
|
|
4726
|
+
train_rows: number | null;
|
|
4727
|
+
holdout_rows: number | null;
|
|
4728
|
+
finished_at: string | null;
|
|
4729
|
+
holdout: AttemptHoldout;
|
|
4730
|
+
}
|
|
4731
|
+
/**
|
|
4732
|
+
* The held-back conversations both attempts were scored on (`rows`), matched
|
|
4733
|
+
* by the conversation they came from.
|
|
4734
|
+
*
|
|
4735
|
+
* `comparable` says both were scored the same way: the same scoring model and
|
|
4736
|
+
* the same rubric, both recorded. When not, `why` says so, naming both scoring
|
|
4737
|
+
* models, and `higher`, `lower`, `same`, `a` and `b` are null: the two scores
|
|
4738
|
+
* are not on one scale. `answer_changed` counts the conversations whose right
|
|
4739
|
+
* answer a member changed between the two attempts; they have no direction
|
|
4740
|
+
* and are left out of `a` and `b`. `answer_unknown` counts the ones whose
|
|
4741
|
+
* right answer one of the two comparisons did not record which it was (it was
|
|
4742
|
+
* compared before that was kept), so whether both were scored against the same
|
|
4743
|
+
* answer is not known: no direction either, left out of `a` and `b`, and
|
|
4744
|
+
* never counted as changed. When comparable, rows = higher + lower + same +
|
|
4745
|
+
* answer_changed + answer_unknown.
|
|
4746
|
+
*/
|
|
4747
|
+
export interface AttemptSharedSample {
|
|
4748
|
+
rows: number;
|
|
4749
|
+
comparable: boolean;
|
|
4750
|
+
why: string | null;
|
|
4751
|
+
answer_changed: number;
|
|
4752
|
+
answer_unknown: number;
|
|
4753
|
+
higher: number | null;
|
|
4754
|
+
lower: number | null;
|
|
4755
|
+
same: number | null;
|
|
4756
|
+
/**
|
|
4757
|
+
* Each attempt over the same conversations (`rows` less `answer_changed`
|
|
4758
|
+
* and `answer_unknown`):
|
|
4759
|
+
* the like-for-like figures, which may be subtracted. Null when there are
|
|
4760
|
+
* none, when the two were not scored the same way, and while either
|
|
4761
|
+
* comparison is still being scored.
|
|
4762
|
+
*/
|
|
4763
|
+
a: AttemptSharedFigures | null;
|
|
4764
|
+
b: AttemptSharedFigures | null;
|
|
4765
|
+
}
|
|
4766
|
+
/** One attempt over the shared conversations: its mean score and how many passed (score 0.70 or more) of `rows`. */
|
|
4767
|
+
export interface AttemptSharedFigures {
|
|
4768
|
+
rows: number;
|
|
4769
|
+
mean: number;
|
|
4770
|
+
passed: number;
|
|
4771
|
+
pass_rate: number;
|
|
4772
|
+
}
|
|
4773
|
+
/** One attempt's replay of a benchmark. `score` and `pass_rate` are null unless it published a score. */
|
|
4774
|
+
export interface AttemptBenchmarkSide {
|
|
4775
|
+
benchmark_run_id: string;
|
|
4776
|
+
status: BenchmarkRunStatus;
|
|
4777
|
+
rows_scored: number;
|
|
4778
|
+
rows_total: number;
|
|
4779
|
+
score: number | null;
|
|
4780
|
+
pass_rate: number | null;
|
|
4781
|
+
}
|
|
4782
|
+
/**
|
|
4783
|
+
* A benchmark both attempts replayed. `delta` is b minus a, null unless
|
|
4784
|
+
* `comparable` (both scored on the same revision of it, every conversation);
|
|
4785
|
+
* `why` says why not.
|
|
4786
|
+
*/
|
|
4787
|
+
export interface AttemptCompareBenchmark {
|
|
4788
|
+
benchmark_id: string;
|
|
4789
|
+
name: string;
|
|
4790
|
+
/** How it scores an answer: a rubric (`judge`) or an exact check (`exact`). */
|
|
4791
|
+
check: 'judge' | 'exact';
|
|
4792
|
+
a: AttemptBenchmarkSide;
|
|
4793
|
+
b: AttemptBenchmarkSide;
|
|
4794
|
+
delta: number | null;
|
|
4795
|
+
comparable: boolean;
|
|
4796
|
+
why: string | null;
|
|
4797
|
+
}
|
|
4798
|
+
/**
|
|
4799
|
+
* One attempt's own answer on a shared conversation, as its comparison scored
|
|
4800
|
+
* it. The answer itself is the `evaluation_item_id` row of
|
|
4801
|
+
* `listEvaluationItems(holdout.evaluation_id)`.
|
|
4802
|
+
*/
|
|
4803
|
+
export interface AttemptCompareItemSide {
|
|
4804
|
+
evaluation_item_id: number;
|
|
4805
|
+
score: number;
|
|
4806
|
+
passed: boolean;
|
|
4807
|
+
}
|
|
4808
|
+
/**
|
|
4809
|
+
* One held-back conversation both attempts were scored on. `direction` is null
|
|
4810
|
+
* when the two scores are not on one scale, and `why` then says why (the two
|
|
4811
|
+
* attempts were scored differently, this conversation's right answer
|
|
4812
|
+
* changed between them, or which right answer one of them was scored against
|
|
4813
|
+
* was not recorded); both scores are listed either way.
|
|
4814
|
+
*/
|
|
4815
|
+
export interface AttemptCompareItem {
|
|
4816
|
+
trace_id: string;
|
|
4817
|
+
a: AttemptCompareItemSide;
|
|
4818
|
+
b: AttemptCompareItemSide;
|
|
4819
|
+
direction: AttemptDirection | null;
|
|
4820
|
+
why: string | null;
|
|
4821
|
+
}
|
|
4822
|
+
/** `GET /api/loop/pipelines/{id}/attempts/compare`: numbers and ids only. */
|
|
4823
|
+
export interface AttemptCompareResponse {
|
|
4824
|
+
rule_id: string;
|
|
4825
|
+
a: AttemptCompareSide;
|
|
4826
|
+
b: AttemptCompareSide;
|
|
4827
|
+
/** Closer than this on one conversation is `same`. */
|
|
4828
|
+
tie_band: number;
|
|
4829
|
+
shared_sample: AttemptSharedSample;
|
|
4830
|
+
benchmarks: AttemptCompareBenchmark[];
|
|
4831
|
+
/** One page of the shared sample, in a's order, narrowed by `filter`. */
|
|
4832
|
+
items: AttemptCompareItem[];
|
|
4833
|
+
/** Every conversation the filter matches, not only this page. */
|
|
4834
|
+
total: number;
|
|
4835
|
+
}
|
|
4836
|
+
/** Which two attempts to set side by side, by RUN id, and which page of their shared conversations. */
|
|
4837
|
+
export interface AttemptCompareParams {
|
|
4838
|
+
a: string;
|
|
4839
|
+
b: string;
|
|
4840
|
+
filter?: AttemptDirection;
|
|
4841
|
+
/** 1 to 200; 50 when absent. */
|
|
4842
|
+
limit?: number;
|
|
4843
|
+
offset?: number;
|
|
4844
|
+
}
|
|
4385
4845
|
/**
|
|
4386
4846
|
* `POST /api/loop/pipelines/{id}/import`: the import body, `source` optional.
|
|
4387
4847
|
* `default_feedback: 'good'` records every answered row without a verdict of
|