runbios-sdk 0.2.19 → 0.2.20-dev.286
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 +64 -33
- package/dist/resources/loop.js +73 -32
- package/dist/types.d.ts +398 -138
- 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.20-dev.286";
|
|
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,
|
|
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';
|
|
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.20-dev.286';
|
|
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 } from '../types.js';
|
|
3
3
|
/**
|
|
4
4
|
* The Conscious Loop -- pipelines that keep improving a model from the
|
|
5
5
|
* conversations you send them.
|
|
@@ -88,10 +88,10 @@ export declare class Loop {
|
|
|
88
88
|
* a corpus from a pile.
|
|
89
89
|
*
|
|
90
90
|
* Each row is read for what it actually is. A `prompt`/`chosen`/`rejected`
|
|
91
|
-
* triple becomes a
|
|
92
|
-
* thumbs verdict; a question and an answer waits for
|
|
93
|
-
* no answer waits for an answer; a paragraph of prose
|
|
94
|
-
* is not a conversation.
|
|
91
|
+
* triple becomes a correction (`chosen` is learned from); an answer plus a
|
|
92
|
+
* yes-or-no becomes a thumbs verdict; a question and an answer waits for
|
|
93
|
+
* review; a question with no answer waits for an answer; a paragraph of prose
|
|
94
|
+
* is refused, because it is not a conversation.
|
|
95
95
|
*
|
|
96
96
|
* A verdict that arrives *with* the file is kept -- discarding somebody's
|
|
97
97
|
* judgement would be worse -- but it is recorded as having come from your
|
|
@@ -138,7 +138,14 @@ export declare class Loop {
|
|
|
138
138
|
importRows(params: LoopImportParams): Promise<LoopImportResult>;
|
|
139
139
|
/** List captured conversations, newest first. */
|
|
140
140
|
listTraces(params?: LoopTraceListParams): Promise<LoopTraceListResponse>;
|
|
141
|
-
/**
|
|
141
|
+
/**
|
|
142
|
+
* Read one conversation, with every verdict and tag recorded on it.
|
|
143
|
+
*
|
|
144
|
+
* A conversation kept in your own storage carries `payload_stored_externally`.
|
|
145
|
+
* When its text could not be read just now it also carries
|
|
146
|
+
* `payload_unavailable`, with `messages` null and `completion` empty: it is
|
|
147
|
+
* not an empty conversation. Read it again later rather than reviewing it.
|
|
148
|
+
*/
|
|
142
149
|
getTrace(id: string): Promise<LoopTrace>;
|
|
143
150
|
/**
|
|
144
151
|
* Delete a conversation.
|
|
@@ -158,11 +165,11 @@ export declare class Loop {
|
|
|
158
165
|
* Append-only: posting a second verdict does not replace the first. Two
|
|
159
166
|
* reviewers disagreeing about an answer is information worth keeping.
|
|
160
167
|
*
|
|
161
|
-
*
|
|
162
|
-
*
|
|
163
|
-
* `
|
|
164
|
-
*
|
|
165
|
-
*
|
|
168
|
+
* What a pipeline trains on (every pipeline fine-tunes on examples): an
|
|
169
|
+
* `accepted` answer is an example as it stands; the `correction` of an
|
|
170
|
+
* `edited` or `gold` verdict is the example, in place of the model's answer;
|
|
171
|
+
* a `rejected` answer is left out. Nothing is learned from an answer that was
|
|
172
|
+
* rejected or replaced. `source` defaults to `human`.
|
|
166
173
|
*/
|
|
167
174
|
signal(traceId: string, params: LoopSignalParams): Promise<LoopSignal>;
|
|
168
175
|
/**
|
|
@@ -182,23 +189,18 @@ export declare class Loop {
|
|
|
182
189
|
/**
|
|
183
190
|
* The model was wrong; here is what it should have said.
|
|
184
191
|
*
|
|
185
|
-
* The most valuable feedback there is
|
|
186
|
-
*
|
|
187
|
-
* avoid its own.
|
|
192
|
+
* The most valuable feedback there is: your answer is trained on in place of
|
|
193
|
+
* the model's. Nothing is learned from the answer it replaced.
|
|
188
194
|
*/
|
|
189
195
|
correct(traceId: string, answer: string, reason?: string): Promise<LoopSignal>;
|
|
190
196
|
/**
|
|
191
197
|
* Record the GOLD answer for this question — the reference, regardless of
|
|
192
198
|
* what the model happened to say.
|
|
193
199
|
*
|
|
194
|
-
*
|
|
195
|
-
*
|
|
196
|
-
*
|
|
197
|
-
*
|
|
198
|
-
*
|
|
199
|
-
* It is the most reusable thing you can record: it trains SFT, forms a DPO
|
|
200
|
-
* pair when it differs from the answer, and stands in as the GRPO reference
|
|
201
|
-
* when you have not supplied a separate ground truth.
|
|
200
|
+
* A pipeline trains on it exactly as it does on a correction: the gold
|
|
201
|
+
* answer is the example, in place of the model's. The difference is only
|
|
202
|
+
* what it says: a correction says the model was wrong, a gold answer says
|
|
203
|
+
* nothing about the model.
|
|
202
204
|
*/
|
|
203
205
|
gold(traceId: string, answer: string, reason?: string): Promise<LoopSignal>;
|
|
204
206
|
/** Every verdict on one conversation, oldest first. */
|
|
@@ -356,8 +358,8 @@ export declare class Loop {
|
|
|
356
358
|
*
|
|
357
359
|
* `status` says whether it is the platform working (`running`), the member
|
|
358
360
|
* who has to act (`needs_review`, `needs_funds`), or nothing at all until
|
|
359
|
-
* somebody does (`paused`, with `paused_reason`
|
|
360
|
-
*
|
|
361
|
+
* somebody does (`paused`, with `paused_reason` saying why; `complete` at
|
|
362
|
+
* `max_versions`). `month_spent_cents` is the figure the
|
|
361
363
|
* monthly limit is enforced against: what runs started this month have cost
|
|
362
364
|
* at most, not an exact spend.
|
|
363
365
|
*/
|
|
@@ -366,8 +368,10 @@ export declare class Loop {
|
|
|
366
368
|
* The base models a pipeline can train: only those the engine trains with
|
|
367
369
|
* LoRA SFT and the platform can serve for the comparison, recommended first.
|
|
368
370
|
* The one list {@link createPipeline} accepts a `model.id` from, with the
|
|
369
|
-
* `floors` a
|
|
370
|
-
* 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). They are read-only.
|
|
371
375
|
*/
|
|
372
376
|
listModels(): Promise<LoopModelsResponse>;
|
|
373
377
|
/**
|
|
@@ -389,9 +393,17 @@ export declare class Loop {
|
|
|
389
393
|
*/
|
|
390
394
|
updatePipeline(id: string, params: PipelineWriteRequest): Promise<PipelineMutationResponse>;
|
|
391
395
|
/**
|
|
392
|
-
* Delete a pipeline: an attempt still running is cancelled
|
|
393
|
-
*
|
|
394
|
-
*
|
|
396
|
+
* Delete a pipeline: an attempt still running is cancelled, the deployment
|
|
397
|
+
* its live version answers from is stopped and deleted -- it stops
|
|
398
|
+
* answering and is no longer billed -- unless another pipeline or model
|
|
399
|
+
* name of yours answers from it too. If one does, that deployment keeps
|
|
400
|
+
* running and billed until you stop it on Deployments, and its trained
|
|
401
|
+
* checkpoint is kept (and billed as storage) until that deployment is
|
|
402
|
+
* deleted. Its history is deleted with it: the checkpoints its attempts
|
|
403
|
+
* trained, the sets they trained on, and every conversation of their
|
|
404
|
+
* comparison and benchmark reports. That happens in the background after
|
|
405
|
+
* this returns. Your samples and their tags are kept. Recording to its own
|
|
406
|
+
* tag stops. It cannot be undone.
|
|
395
407
|
*/
|
|
396
408
|
deletePipeline(id: string): Promise<TrainingRuleDeleteResponse>;
|
|
397
409
|
/**
|
|
@@ -400,7 +412,9 @@ export declare class Loop {
|
|
|
400
412
|
* numbers `minimums` shows. 503 `AGENT_COULD_NOT_START` means the key the
|
|
401
413
|
* attempt would be scored with could not be renewed just then: nothing was
|
|
402
414
|
* started, so press train now again in a minute. Every refusal is a
|
|
403
|
-
* `TrainingRuleRunRefusalCode`.
|
|
415
|
+
* `TrainingRuleRunRefusalCode`. When the attempt in flight is waiting for
|
|
416
|
+
* GPUs to compare (`active_run.state` `waiting_gpus`), this books its two
|
|
417
|
+
* comparison machines again at once instead of starting another attempt.
|
|
404
418
|
*/
|
|
405
419
|
runPipeline(id: string): Promise<PipelineMutationResponse>;
|
|
406
420
|
/**
|
|
@@ -433,12 +447,16 @@ export declare class Loop {
|
|
|
433
447
|
* your own reviewers, is reported with the warning that says so rather than
|
|
434
448
|
* withheld. `margin_used` is the thresholds this verdict was measured
|
|
435
449
|
* against, frozen with the report, so a later policy change cannot rewrite
|
|
436
|
-
* what a past decision meant.
|
|
450
|
+
* what a past decision meant. `candidate_pass_rate` and
|
|
451
|
+
* `incumbent_pass_rate` are the share of conversations each side passed
|
|
452
|
+
* (score 0.70 or more).
|
|
437
453
|
*/
|
|
438
454
|
getEvaluation(id: string): Promise<Evaluation>;
|
|
439
455
|
/**
|
|
440
|
-
* The paired conversations behind the numbers: one prompt,
|
|
441
|
-
*
|
|
456
|
+
* The paired conversations behind the numbers: one prompt, the reference a
|
|
457
|
+
* person gave for it, both answers, what the judge made of each (its scores,
|
|
458
|
+
* its reason, and whether the answer passed: score 0.70 or more), the
|
|
459
|
+
* direct comparison in both orders, and which won.
|
|
442
460
|
*
|
|
443
461
|
* Filter by `winner` -- `candidate` (the attempt won), `serving` (the version
|
|
444
462
|
* serving today won; the item itself says `incumbent`) or `tie` -- and read
|
|
@@ -522,4 +540,17 @@ export declare class Loop {
|
|
|
522
540
|
* different set, which is the exact defect a standing benchmark removes.
|
|
523
541
|
*/
|
|
524
542
|
getBenchmarkRun(id: string): Promise<BenchmarkRun>;
|
|
543
|
+
/**
|
|
544
|
+
* The conversations behind one replay, in the benchmark's order: the pinned
|
|
545
|
+
* prompt and its reference, both answers, what the judge made of each (its
|
|
546
|
+
* scores, its reason, and whether the answer passed: score 0.70 or more),
|
|
547
|
+
* and which side won it.
|
|
548
|
+
*
|
|
549
|
+
* Filter by `winner` -- `candidate` (the attempt won), `serving` (the
|
|
550
|
+
* version serving today won; the item itself says `incumbent`) or `tie` --
|
|
551
|
+
* exactly as on a comparison report's items. `limit` is 50 when absent and
|
|
552
|
+
* at most 200. A replay that stopped before it began has no conversations:
|
|
553
|
+
* its `status_reason` says why.
|
|
554
|
+
*/
|
|
555
|
+
listBenchmarkRunItems(id: string, params?: BenchmarkRunItemListParams): Promise<BenchmarkRunItemsResponse>;
|
|
525
556
|
}
|
package/dist/resources/loop.js
CHANGED
|
@@ -91,10 +91,10 @@ export class Loop {
|
|
|
91
91
|
* a corpus from a pile.
|
|
92
92
|
*
|
|
93
93
|
* Each row is read for what it actually is. A `prompt`/`chosen`/`rejected`
|
|
94
|
-
* triple becomes a
|
|
95
|
-
* thumbs verdict; a question and an answer waits for
|
|
96
|
-
* no answer waits for an answer; a paragraph of prose
|
|
97
|
-
* is not a conversation.
|
|
94
|
+
* triple becomes a correction (`chosen` is learned from); an answer plus a
|
|
95
|
+
* yes-or-no becomes a thumbs verdict; a question and an answer waits for
|
|
96
|
+
* review; a question with no answer waits for an answer; a paragraph of prose
|
|
97
|
+
* is refused, because it is not a conversation.
|
|
98
98
|
*
|
|
99
99
|
* A verdict that arrives *with* the file is kept -- discarding somebody's
|
|
100
100
|
* judgement would be worse -- but it is recorded as having come from your
|
|
@@ -182,7 +182,14 @@ export class Loop {
|
|
|
182
182
|
const qs = q.toString();
|
|
183
183
|
return this._http.fetchGet(`/api/loop/traces${qs ? `?${qs}` : ''}`);
|
|
184
184
|
}
|
|
185
|
-
/**
|
|
185
|
+
/**
|
|
186
|
+
* Read one conversation, with every verdict and tag recorded on it.
|
|
187
|
+
*
|
|
188
|
+
* A conversation kept in your own storage carries `payload_stored_externally`.
|
|
189
|
+
* When its text could not be read just now it also carries
|
|
190
|
+
* `payload_unavailable`, with `messages` null and `completion` empty: it is
|
|
191
|
+
* not an empty conversation. Read it again later rather than reviewing it.
|
|
192
|
+
*/
|
|
186
193
|
async getTrace(id) {
|
|
187
194
|
const res = await this._http.fetchGet(`/api/loop/traces/${encodeURIComponent(id)}`);
|
|
188
195
|
return res.trace;
|
|
@@ -205,11 +212,11 @@ export class Loop {
|
|
|
205
212
|
* Append-only: posting a second verdict does not replace the first. Two
|
|
206
213
|
* reviewers disagreeing about an answer is information worth keeping.
|
|
207
214
|
*
|
|
208
|
-
*
|
|
209
|
-
*
|
|
210
|
-
* `
|
|
211
|
-
*
|
|
212
|
-
*
|
|
215
|
+
* What a pipeline trains on (every pipeline fine-tunes on examples): an
|
|
216
|
+
* `accepted` answer is an example as it stands; the `correction` of an
|
|
217
|
+
* `edited` or `gold` verdict is the example, in place of the model's answer;
|
|
218
|
+
* a `rejected` answer is left out. Nothing is learned from an answer that was
|
|
219
|
+
* rejected or replaced. `source` defaults to `human`.
|
|
213
220
|
*/
|
|
214
221
|
async signal(traceId, params) {
|
|
215
222
|
const res = await this._http.fetchPost(`/api/loop/traces/${encodeURIComponent(traceId)}/signals`, params);
|
|
@@ -236,9 +243,8 @@ export class Loop {
|
|
|
236
243
|
/**
|
|
237
244
|
* The model was wrong; here is what it should have said.
|
|
238
245
|
*
|
|
239
|
-
* The most valuable feedback there is
|
|
240
|
-
*
|
|
241
|
-
* avoid its own.
|
|
246
|
+
* The most valuable feedback there is: your answer is trained on in place of
|
|
247
|
+
* the model's. Nothing is learned from the answer it replaced.
|
|
242
248
|
*/
|
|
243
249
|
async correct(traceId, answer, reason) {
|
|
244
250
|
return this.signal(traceId, { verdict: 'edited', correction: answer, reason });
|
|
@@ -247,14 +253,10 @@ export class Loop {
|
|
|
247
253
|
* Record the GOLD answer for this question — the reference, regardless of
|
|
248
254
|
* what the model happened to say.
|
|
249
255
|
*
|
|
250
|
-
*
|
|
251
|
-
*
|
|
252
|
-
*
|
|
253
|
-
*
|
|
254
|
-
*
|
|
255
|
-
* It is the most reusable thing you can record: it trains SFT, forms a DPO
|
|
256
|
-
* pair when it differs from the answer, and stands in as the GRPO reference
|
|
257
|
-
* when you have not supplied a separate ground truth.
|
|
256
|
+
* A pipeline trains on it exactly as it does on a correction: the gold
|
|
257
|
+
* answer is the example, in place of the model's. The difference is only
|
|
258
|
+
* what it says: a correction says the model was wrong, a gold answer says
|
|
259
|
+
* nothing about the model.
|
|
258
260
|
*/
|
|
259
261
|
async gold(traceId, answer, reason) {
|
|
260
262
|
return this.signal(traceId, { verdict: 'gold', correction: answer, reason });
|
|
@@ -491,8 +493,8 @@ export class Loop {
|
|
|
491
493
|
*
|
|
492
494
|
* `status` says whether it is the platform working (`running`), the member
|
|
493
495
|
* who has to act (`needs_review`, `needs_funds`), or nothing at all until
|
|
494
|
-
* somebody does (`paused`, with `paused_reason`
|
|
495
|
-
*
|
|
496
|
+
* somebody does (`paused`, with `paused_reason` saying why; `complete` at
|
|
497
|
+
* `max_versions`). `month_spent_cents` is the figure the
|
|
496
498
|
* monthly limit is enforced against: what runs started this month have cost
|
|
497
499
|
* at most, not an exact spend.
|
|
498
500
|
*/
|
|
@@ -510,8 +512,10 @@ export class Loop {
|
|
|
510
512
|
* The base models a pipeline can train: only those the engine trains with
|
|
511
513
|
* LoRA SFT and the platform can serve for the comparison, recommended first.
|
|
512
514
|
* The one list {@link createPipeline} accepts a `model.id` from, with the
|
|
513
|
-
* `floors` a
|
|
514
|
-
* 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). They are read-only.
|
|
515
519
|
*/
|
|
516
520
|
async listModels() {
|
|
517
521
|
const res = await this._http.fetchGet('/api/loop/models');
|
|
@@ -540,9 +544,17 @@ export class Loop {
|
|
|
540
544
|
return this._http.fetchPut(`/api/loop/pipelines/${encodeURIComponent(id)}`, params);
|
|
541
545
|
}
|
|
542
546
|
/**
|
|
543
|
-
* Delete a pipeline: an attempt still running is cancelled
|
|
544
|
-
*
|
|
545
|
-
*
|
|
547
|
+
* Delete a pipeline: an attempt still running is cancelled, the deployment
|
|
548
|
+
* its live version answers from is stopped and deleted -- it stops
|
|
549
|
+
* answering and is no longer billed -- unless another pipeline or model
|
|
550
|
+
* name of yours answers from it too. If one does, that deployment keeps
|
|
551
|
+
* running and billed until you stop it on Deployments, and its trained
|
|
552
|
+
* checkpoint is kept (and billed as storage) until that deployment is
|
|
553
|
+
* deleted. Its history is deleted with it: the checkpoints its attempts
|
|
554
|
+
* trained, the sets they trained on, and every conversation of their
|
|
555
|
+
* comparison and benchmark reports. That happens in the background after
|
|
556
|
+
* this returns. Your samples and their tags are kept. Recording to its own
|
|
557
|
+
* tag stops. It cannot be undone.
|
|
546
558
|
*/
|
|
547
559
|
async deletePipeline(id) {
|
|
548
560
|
return this._http.fetchDelete(`/api/loop/pipelines/${encodeURIComponent(id)}`);
|
|
@@ -553,7 +565,9 @@ export class Loop {
|
|
|
553
565
|
* numbers `minimums` shows. 503 `AGENT_COULD_NOT_START` means the key the
|
|
554
566
|
* attempt would be scored with could not be renewed just then: nothing was
|
|
555
567
|
* started, so press train now again in a minute. Every refusal is a
|
|
556
|
-
* `TrainingRuleRunRefusalCode`.
|
|
568
|
+
* `TrainingRuleRunRefusalCode`. When the attempt in flight is waiting for
|
|
569
|
+
* GPUs to compare (`active_run.state` `waiting_gpus`), this books its two
|
|
570
|
+
* comparison machines again at once instead of starting another attempt.
|
|
557
571
|
*/
|
|
558
572
|
async runPipeline(id) {
|
|
559
573
|
return this._http.fetchPost(`/api/loop/pipelines/${encodeURIComponent(id)}/run`, {});
|
|
@@ -608,14 +622,18 @@ export class Loop {
|
|
|
608
622
|
* your own reviewers, is reported with the warning that says so rather than
|
|
609
623
|
* withheld. `margin_used` is the thresholds this verdict was measured
|
|
610
624
|
* against, frozen with the report, so a later policy change cannot rewrite
|
|
611
|
-
* what a past decision meant.
|
|
625
|
+
* what a past decision meant. `candidate_pass_rate` and
|
|
626
|
+
* `incumbent_pass_rate` are the share of conversations each side passed
|
|
627
|
+
* (score 0.70 or more).
|
|
612
628
|
*/
|
|
613
629
|
async getEvaluation(id) {
|
|
614
630
|
return this._http.fetchGet(`/api/loop/evaluations/${encodeURIComponent(id)}`);
|
|
615
631
|
}
|
|
616
632
|
/**
|
|
617
|
-
* The paired conversations behind the numbers: one prompt,
|
|
618
|
-
*
|
|
633
|
+
* The paired conversations behind the numbers: one prompt, the reference a
|
|
634
|
+
* person gave for it, both answers, what the judge made of each (its scores,
|
|
635
|
+
* its reason, and whether the answer passed: score 0.70 or more), the
|
|
636
|
+
* direct comparison in both orders, and which won.
|
|
619
637
|
*
|
|
620
638
|
* Filter by `winner` -- `candidate` (the attempt won), `serving` (the version
|
|
621
639
|
* serving today won; the item itself says `incumbent`) or `tie` -- and read
|
|
@@ -748,4 +766,27 @@ export class Loop {
|
|
|
748
766
|
const res = await this._http.fetchGet(`/api/loop/benchmark-runs/${encodeURIComponent(id)}`);
|
|
749
767
|
return res.benchmark_run;
|
|
750
768
|
}
|
|
769
|
+
/**
|
|
770
|
+
* The conversations behind one replay, in the benchmark's order: the pinned
|
|
771
|
+
* prompt and its reference, both answers, what the judge made of each (its
|
|
772
|
+
* scores, its reason, and whether the answer passed: score 0.70 or more),
|
|
773
|
+
* and which side won it.
|
|
774
|
+
*
|
|
775
|
+
* Filter by `winner` -- `candidate` (the attempt won), `serving` (the
|
|
776
|
+
* version serving today won; the item itself says `incumbent`) or `tie` --
|
|
777
|
+
* exactly as on a comparison report's items. `limit` is 50 when absent and
|
|
778
|
+
* at most 200. A replay that stopped before it began has no conversations:
|
|
779
|
+
* its `status_reason` says why.
|
|
780
|
+
*/
|
|
781
|
+
async listBenchmarkRunItems(id, params = {}) {
|
|
782
|
+
const q = new URLSearchParams();
|
|
783
|
+
if (params.winner)
|
|
784
|
+
q.set('winner', params.winner);
|
|
785
|
+
if (params.limit != null)
|
|
786
|
+
q.set('limit', String(params.limit));
|
|
787
|
+
if (params.offset != null)
|
|
788
|
+
q.set('offset', String(params.offset));
|
|
789
|
+
const qs = q.toString();
|
|
790
|
+
return this._http.fetchGet(`/api/loop/benchmark-runs/${encodeURIComponent(id)}/items${qs ? `?${qs}` : ''}`);
|
|
791
|
+
}
|
|
751
792
|
}
|