runbios-sdk 0.2.20 → 0.2.21-dev.297
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 +92 -15
- package/dist/resources/loop.js +132 -17
- package/dist/types.d.ts +716 -54
- 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.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.
|
|
39
|
+
export declare const VERSION = "0.2.21-dev.297";
|
|
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.
|
|
39
|
+
export const VERSION = '0.2.21-dev.297';
|
|
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
|
}
|
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, 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
|
|
372
|
-
* the
|
|
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.
|
|
390
|
-
*
|
|
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
|
|
395
|
-
*
|
|
396
|
-
*
|
|
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,32 @@ 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,
|
|
445
|
-
*
|
|
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 (not the system prompt every row shares), its right answer,
|
|
499
|
+
* both answers and every reason; `searched`
|
|
500
|
+
* says how many rows were searched.
|
|
451
501
|
*/
|
|
452
502
|
listEvaluationItems(id: string, params?: EvaluationItemListParams): Promise<EvaluationItemsResponse>;
|
|
453
503
|
/**
|
|
@@ -461,14 +511,24 @@ export declare class Loop {
|
|
|
461
511
|
* replayed against both models on every run that finishes its comparison,
|
|
462
512
|
* and reported as two absolute numbers on a scale that does not move.
|
|
463
513
|
*
|
|
464
|
-
* 20 to 200 conversations. A named conversation with nothing to ask a model
|
|
465
|
-
*
|
|
466
|
-
*
|
|
514
|
+
* 20 to 200 conversations. A named conversation with nothing to ask a model,
|
|
515
|
+
* or too large to keep in storage, is refused 422 `BENCHMARK_ROW_UNUSABLE`
|
|
516
|
+
* rather than skipped, because pinning 47 of the 50 you chose is the set
|
|
517
|
+
* being wrong from the first day and you would never find out. The set is
|
|
518
|
+
* kept in storage and nowhere else: when it cannot be stored just then the
|
|
519
|
+
* create is refused 409 `CONFLICT` and nothing is saved; try again in a
|
|
520
|
+
* minute.
|
|
467
521
|
*
|
|
468
522
|
* The platform freezes the judge and the model it scores on (the ones every
|
|
469
523
|
* pipeline comparison uses), gives both models the comparison's own answer
|
|
470
524
|
* length, and sets what one replay may spend, inside the attempt's own
|
|
471
525
|
* scoring limit; none of that is sent.
|
|
526
|
+
*
|
|
527
|
+
* `check: 'exact'` scores it by the exact check instead: the answer or the
|
|
528
|
+
* tool call must match the right answer pinned with each conversation, and
|
|
529
|
+
* no model is asked. Every conversation then needs a right answer (one a
|
|
530
|
+
* person marked good, or a correction); the ones without are refused 422
|
|
531
|
+
* `BENCHMARK_ROW_HAS_NO_ANSWER`, named, and nothing is saved.
|
|
472
532
|
*/
|
|
473
533
|
createBenchmark(params: BenchmarkCreateParams): Promise<Benchmark>;
|
|
474
534
|
/** Your benchmarks, newest first. Filter by `status` to hide retired ones. */
|
|
@@ -526,4 +586,21 @@ export declare class Loop {
|
|
|
526
586
|
* different set, which is the exact defect a standing benchmark removes.
|
|
527
587
|
*/
|
|
528
588
|
getBenchmarkRun(id: string): Promise<BenchmarkRun>;
|
|
589
|
+
/**
|
|
590
|
+
* The conversations behind one replay, in the benchmark's order: the pinned
|
|
591
|
+
* prompt and its reference, both answers, what the judge made of each (its
|
|
592
|
+
* scores, its reason, and whether the answer passed: score 0.70 or more),
|
|
593
|
+
* and which side won it.
|
|
594
|
+
*
|
|
595
|
+
* Filter by `winner` -- `candidate` (the attempt won), `serving` (the
|
|
596
|
+
* version serving today won; the item itself says `incumbent`) or `tie` --
|
|
597
|
+
* exactly as on a comparison report's items. `limit` is 50 when absent and
|
|
598
|
+
* at most 200. A replay that stopped before it began has no conversations:
|
|
599
|
+
* its `status_reason` says why.
|
|
600
|
+
*
|
|
601
|
+
* The same `candidate_passed`, `incumbent_passed`, `has_reference`,
|
|
602
|
+
* `status`, `sort` and `q` as a
|
|
603
|
+
* comparison's items; there is no `orders`.
|
|
604
|
+
*/
|
|
605
|
+
listBenchmarkRunItems(id: string, params?: BenchmarkRunItemListParams): Promise<BenchmarkRunItemsResponse>;
|
|
529
606
|
}
|
package/dist/resources/loop.js
CHANGED
|
@@ -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
|
|
516
|
-
* the
|
|
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.
|
|
539
|
-
*
|
|
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
|
|
546
|
-
*
|
|
547
|
-
*
|
|
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,39 @@ 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,
|
|
622
|
-
*
|
|
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 (not the system prompt every row shares), its right answer,
|
|
687
|
+
* both answers and every reason; `searched`
|
|
688
|
+
* says how many rows were searched.
|
|
628
689
|
*/
|
|
629
690
|
async listEvaluationItems(id, params = {}) {
|
|
630
|
-
const q =
|
|
631
|
-
if (params.
|
|
632
|
-
q.set('
|
|
691
|
+
const q = reportRowQuery(params);
|
|
692
|
+
if (params.orders)
|
|
693
|
+
q.set('orders', params.orders);
|
|
633
694
|
if (params.limit != null)
|
|
634
695
|
q.set('limit', String(params.limit));
|
|
635
696
|
if (params.offset != null)
|
|
@@ -649,14 +710,24 @@ export class Loop {
|
|
|
649
710
|
* replayed against both models on every run that finishes its comparison,
|
|
650
711
|
* and reported as two absolute numbers on a scale that does not move.
|
|
651
712
|
*
|
|
652
|
-
* 20 to 200 conversations. A named conversation with nothing to ask a model
|
|
653
|
-
*
|
|
654
|
-
*
|
|
713
|
+
* 20 to 200 conversations. A named conversation with nothing to ask a model,
|
|
714
|
+
* or too large to keep in storage, is refused 422 `BENCHMARK_ROW_UNUSABLE`
|
|
715
|
+
* rather than skipped, because pinning 47 of the 50 you chose is the set
|
|
716
|
+
* being wrong from the first day and you would never find out. The set is
|
|
717
|
+
* kept in storage and nowhere else: when it cannot be stored just then the
|
|
718
|
+
* create is refused 409 `CONFLICT` and nothing is saved; try again in a
|
|
719
|
+
* minute.
|
|
655
720
|
*
|
|
656
721
|
* The platform freezes the judge and the model it scores on (the ones every
|
|
657
722
|
* pipeline comparison uses), gives both models the comparison's own answer
|
|
658
723
|
* length, and sets what one replay may spend, inside the attempt's own
|
|
659
724
|
* scoring limit; none of that is sent.
|
|
725
|
+
*
|
|
726
|
+
* `check: 'exact'` scores it by the exact check instead: the answer or the
|
|
727
|
+
* tool call must match the right answer pinned with each conversation, and
|
|
728
|
+
* no model is asked. Every conversation then needs a right answer (one a
|
|
729
|
+
* person marked good, or a correction); the ones without are refused 422
|
|
730
|
+
* `BENCHMARK_ROW_HAS_NO_ANSWER`, named, and nothing is saved.
|
|
660
731
|
*/
|
|
661
732
|
async createBenchmark(params) {
|
|
662
733
|
const res = await this._http.fetchPost('/api/loop/benchmarks', params);
|
|
@@ -752,4 +823,48 @@ export class Loop {
|
|
|
752
823
|
const res = await this._http.fetchGet(`/api/loop/benchmark-runs/${encodeURIComponent(id)}`);
|
|
753
824
|
return res.benchmark_run;
|
|
754
825
|
}
|
|
826
|
+
/**
|
|
827
|
+
* The conversations behind one replay, in the benchmark's order: the pinned
|
|
828
|
+
* prompt and its reference, both answers, what the judge made of each (its
|
|
829
|
+
* scores, its reason, and whether the answer passed: score 0.70 or more),
|
|
830
|
+
* and which side won it.
|
|
831
|
+
*
|
|
832
|
+
* Filter by `winner` -- `candidate` (the attempt won), `serving` (the
|
|
833
|
+
* version serving today won; the item itself says `incumbent`) or `tie` --
|
|
834
|
+
* exactly as on a comparison report's items. `limit` is 50 when absent and
|
|
835
|
+
* at most 200. A replay that stopped before it began has no conversations:
|
|
836
|
+
* its `status_reason` says why.
|
|
837
|
+
*
|
|
838
|
+
* The same `candidate_passed`, `incumbent_passed`, `has_reference`,
|
|
839
|
+
* `status`, `sort` and `q` as a
|
|
840
|
+
* comparison's items; there is no `orders`.
|
|
841
|
+
*/
|
|
842
|
+
async listBenchmarkRunItems(id, params = {}) {
|
|
843
|
+
const q = reportRowQuery(params);
|
|
844
|
+
if (params.limit != null)
|
|
845
|
+
q.set('limit', String(params.limit));
|
|
846
|
+
if (params.offset != null)
|
|
847
|
+
q.set('offset', String(params.offset));
|
|
848
|
+
const qs = q.toString();
|
|
849
|
+
return this._http.fetchGet(`/api/loop/benchmark-runs/${encodeURIComponent(id)}/items${qs ? `?${qs}` : ''}`);
|
|
850
|
+
}
|
|
851
|
+
}
|
|
852
|
+
/** The row filters both report item routes take, in the service's own words. */
|
|
853
|
+
function reportRowQuery(params) {
|
|
854
|
+
const q = new URLSearchParams();
|
|
855
|
+
if (params.winner)
|
|
856
|
+
q.set('winner', params.winner);
|
|
857
|
+
if (params.candidate_passed != null)
|
|
858
|
+
q.set('candidate_passed', String(params.candidate_passed));
|
|
859
|
+
if (params.incumbent_passed != null)
|
|
860
|
+
q.set('incumbent_passed', String(params.incumbent_passed));
|
|
861
|
+
if (params.has_reference != null)
|
|
862
|
+
q.set('has_reference', String(params.has_reference));
|
|
863
|
+
if (params.status)
|
|
864
|
+
q.set('status', params.status);
|
|
865
|
+
if (params.sort)
|
|
866
|
+
q.set('sort', params.sort);
|
|
867
|
+
if (params.q)
|
|
868
|
+
q.set('q', params.q);
|
|
869
|
+
return q;
|
|
755
870
|
}
|