runbios-sdk 0.2.22-rc.320 → 0.3.0-dev.322

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/CHANGELOG.md ADDED
@@ -0,0 +1,53 @@
1
+ # Changelog
2
+
3
+ `runbios-sdk` on npm. Versions are 0.x semver: the minor moves when a public
4
+ surface is added, renamed or removed, the patch for a fix inside an unchanged
5
+ surface. The SDK, the Python SDK (`runbios-sdk` on PyPI) and the MCP server
6
+ (`runbios-mcp`) are released together, at one version.
7
+
8
+ ## 0.3.0
9
+
10
+ Added
11
+
12
+ - `training.create` and `training.preflight` take `startFrom.exportStep`
13
+ (`'best'`, the default, or `'final'`): which step of a job trained on top of
14
+ earlier versions its merged model is made of. It needs `exportMerged: true`;
15
+ without it, or with any other value, the SDK refuses before sending, as the
16
+ API does. `TrainingStartFrom` echoes `export_step`.
17
+ - Conscious Loop: `inference` chat and messages calls take
18
+ `loop: { pipeline, onSampleId }`, which sends `X-Loop-Pipeline` and hands
19
+ back the sample id (`loop_sample_id`, or to `onSampleId` before the first
20
+ streamed chunk).
21
+ - Conscious Loop: `loop.listPipelineAttempts` pages a pipeline's attempts;
22
+ `loop.listPipelines` takes `limit`, `q` and `status`; a pipeline's training
23
+ settings (`training`, three-state on a write) and `training_defaults`;
24
+ `loop.listModels` also lists the models not offered, with why;
25
+ `loop.getBenchmarkHistory` takes `pipeline`; `loop.listTraces` takes `q`.
26
+ - Feedback (`signal`, `upvote`, `downvote`, `correct`, `gold`) is sent again
27
+ after `Retry-After` while its sample is still being recorded
28
+ (`409 SAMPLE_NOT_YET_RECORDED`), at most 6 tries; `ApiError` carries
29
+ `retryAfter`.
30
+
31
+ Changed
32
+
33
+ - `LoopSignalParams` takes a person's feedback only: `verdict` is
34
+ `LoopFeedbackVerdict` (`accepted`, `rejected`, `edited` or `gold`) and
35
+ `source` is `'human'`; `score` is gone. The API refuses a `scored` verdict,
36
+ any other source, and a `score` on any verdict with 400.
37
+ - A merge-chain attempt replays about half of what it trains on (was a fifth),
38
+ and a version built on one that learned a deleted conversation says so in
39
+ its lineage.
40
+
41
+ Removed
42
+
43
+ - `Pipeline.champion_version` (use `live_version`) and
44
+ `PipelineVersion.is_champion` (use `is_live`), `benchmark_id` and
45
+ `benchmark_name` (use `listPipelineBenchmarks`), `benchmark_min_delta` (the
46
+ least rise a benchmark must show is the platform's; each measurement's
47
+ `reason` in `promotion` says whether it was met), `auto_promote` (use
48
+ `promotion.policy`), and `monthly_ceiling_cents` and `month_spent_cents`:
49
+ the API no longer sends them. `TrainingRuleMonthlyLimitRefusal` keeps
50
+ `error` and `resumes_at`. The monthly safety limit's figures are not fields
51
+ of any answer, and no sentence states them either: `next_reason` and the
52
+ `MONTHLY_LIMIT_REACHED` message say the limit holds the pipeline and when
53
+ the next attempt can start, with no amount.
package/dist/client.js CHANGED
@@ -370,7 +370,7 @@ export class HttpClient {
370
370
  constructor(config) {
371
371
  // Default host stays api.runbios.ai for now; cutover to api.runbios.ai is
372
372
  // planned once its DNS exists.
373
- this.baseUrl = (config.baseUrl || envBaseUrl() || 'https://api-staging.runbios.ai').replace(/\/+$/, '');
373
+ this.baseUrl = (config.baseUrl || envBaseUrl() || 'https://api-dev.runbios.ai').replace(/\/+$/, '');
374
374
  this.apiKey = config.apiKey ?? envApiKey();
375
375
  this.accessToken = config.accessToken;
376
376
  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.22-rc.320";
39
+ export declare const VERSION = "0.3.0-dev.322";
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 AnthropicMessageResponse, type LoopCaptureOption, type LoopSampleIdOnResult, LOOP_PIPELINE_HEADER, LOOP_SAMPLE_ID_HEADER, 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, TrainingStartFromParams, TrainingStartFrom, TrainingListParams, TrainingListResponse, TrainingJob, TrainingMetrics, TrainingResourceMetrics, TrainingDeviceMetrics, MetricPoint, MetricGraphConfig, TrainingCheckpoint, TrainingLogs, TrainingLogEntry, TrainingStopResponse, TrainingResumeResponse, CanonicalTrainingRequest, TrainingPreflightDataset, TrainingPreflightWarning, TrainingPreflightResponse, TrainingCapabilityChoice, TrainingConfigFieldCapability, TrainingCapabilities, TrainingFeature, 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, AttemptExplanation, PipelineAttemptListParams, PipelineAttemptListResponse, PipelineAttemptModelFilter, PipelineAttemptResultFilter, PipelineAttemptTrigger, Lineage, PipelineChain, PipelineChainRebuild, TrainingRunRollbackRefusalCode, LoopTraceRebuild, LoopTraceDeleteResponse, PipelineAttemptOutcome, PipelineLiveDeploymentStatus, PipelineLiveDeployment, LoopStorageWhere, LoopStorage, Pipeline, PipelineListParams, PipelineListStatus, PipelineListResponse, PipelineTrainingSettings, PipelineTrainingDefaults, PipelineTrainingRequest, PipelineResponse, PipelineTrainWhen, PipelineSchedule, PipelineWriteRequest, PipelineMutationResponse, PipelineImportParams, PipelineFloors, HeldBackFloors, LoopModel, LoopModelsResponse, LoopUnavailableModel, LoopUnavailableReasonCode, 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';
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, TrainingStartFromParams, TrainingStartFrom, TrainingExportStep, TrainingListParams, TrainingListResponse, TrainingJob, TrainingMetrics, TrainingResourceMetrics, TrainingDeviceMetrics, MetricPoint, MetricGraphConfig, TrainingCheckpoint, TrainingLogs, TrainingLogEntry, TrainingStopResponse, TrainingResumeResponse, CanonicalTrainingRequest, TrainingPreflightDataset, TrainingPreflightWarning, TrainingPreflightResponse, TrainingCapabilityChoice, TrainingConfigFieldCapability, TrainingCapabilities, TrainingFeature, 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, AttemptExplanation, PipelineAttemptListParams, PipelineAttemptListResponse, PipelineAttemptModelFilter, PipelineAttemptResultFilter, PipelineAttemptTrigger, Lineage, PipelineChain, PipelineChainRebuild, TrainingRunRollbackRefusalCode, LoopTraceRebuild, LoopTraceDeleteResponse, PipelineAttemptOutcome, PipelineLiveDeploymentStatus, PipelineLiveDeployment, LoopStorageWhere, LoopStorage, Pipeline, PipelineListParams, PipelineListStatus, PipelineListResponse, PipelineTrainingSettings, PipelineTrainingDefaults, PipelineTrainingRequest, PipelineResponse, PipelineTrainWhen, PipelineSchedule, PipelineWriteRequest, PipelineMutationResponse, PipelineImportParams, PipelineFloors, HeldBackFloors, LoopModel, LoopModelsResponse, LoopUnavailableModel, LoopUnavailableReasonCode, 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.22-rc.320';
39
+ export const VERSION = '0.3.0-dev.322';
40
40
  export class RunBiOS {
41
41
  /** Search models, fetch configs, check adapter compatibility. */
42
42
  models;
@@ -373,7 +373,7 @@ export class Inference {
373
373
  this.key = config.inferenceKey || envInferenceKey() || envApiKey();
374
374
  // Same default host as HttpClient (api.runbios.ai); api.runbios.ai cutover
375
375
  // is planned once its DNS exists — update both call sites together.
376
- this.baseUrl = (config.baseUrl || envBaseUrl() || 'https://api-staging.runbios.ai').replace(/\/+$/, '');
376
+ this.baseUrl = (config.baseUrl || envBaseUrl() || 'https://api-dev.runbios.ai').replace(/\/+$/, '');
377
377
  this.timeout = config.timeout ?? 900_000;
378
378
  this._http = http;
379
379
  }
@@ -341,9 +341,8 @@ export declare class Loop {
341
341
  * `status` says whether it is the platform working (`running`), the member
342
342
  * who has to act (`needs_review`, `needs_funds`), or nothing at all until
343
343
  * somebody does (`paused`, with `paused_reason` saying why; `complete` at
344
- * `max_versions`). `month_spent_cents` is the figure the
345
- * monthly limit is enforced against: what runs started this month have cost
346
- * at most, not an exact spend.
344
+ * `max_versions`). The monthly safety limit is the platform's and has no
345
+ * field: when it holds the pipeline, `next_reason` says so.
347
346
  */
348
347
  getPipeline(id: string): Promise<Pipeline>;
349
348
  /**
@@ -565,9 +565,8 @@ export class Loop {
565
565
  * `status` says whether it is the platform working (`running`), the member
566
566
  * who has to act (`needs_review`, `needs_funds`), or nothing at all until
567
567
  * somebody does (`paused`, with `paused_reason` saying why; `complete` at
568
- * `max_versions`). `month_spent_cents` is the figure the
569
- * monthly limit is enforced against: what runs started this month have cost
570
- * at most, not an exact spend.
568
+ * `max_versions`). The monthly safety limit is the platform's and has no
569
+ * field: when it holds the pipeline, `next_reason` says so.
571
570
  */
572
571
  async getPipeline(id) {
573
572
  const res = await this._http.fetchGet(`/api/loop/pipelines/${encodeURIComponent(id)}`);
@@ -9,8 +9,9 @@ function trainingIdempotencyKey(explicit) {
9
9
  }
10
10
  /**
11
11
  * `start_from` on the wire. The adapters stay in the order given (oldest
12
- * first: the order they are merged in), and an empty list is refused here
13
- * rather than sent, since the API refuses it too.
12
+ * first: the order they are merged in). An empty list, an `exportStep` other
13
+ * than 'best' or 'final', and an `exportStep` without `exportMerged: true`
14
+ * are refused here rather than sent, since the API refuses each of them too.
14
15
  */
15
16
  function startFromBody(sf) {
16
17
  if (!Array.isArray(sf.adapters) || sf.adapters.length === 0) {
@@ -21,6 +22,15 @@ function startFromBody(sf) {
21
22
  };
22
23
  if (sf.exportMerged !== undefined)
23
24
  body.export_merged = sf.exportMerged;
25
+ if (sf.exportStep !== undefined) {
26
+ if (sf.exportStep !== 'best' && sf.exportStep !== 'final') {
27
+ throw new Error("RunBiOS: startFrom.exportStep must be 'best' (the step validation picked) or 'final' (the last step trained)");
28
+ }
29
+ if (sf.exportMerged !== true) {
30
+ throw new Error('RunBiOS: startFrom.exportStep names the step the merged model is made of, so it needs exportMerged: true');
31
+ }
32
+ body.export_step = sf.exportStep;
33
+ }
24
34
  return body;
25
35
  }
26
36
  function buildTrainingRequest(params) {
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-staging.runbios.ai hostname. */
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-staging.runbios.ai. */
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;
@@ -565,6 +565,11 @@ export interface GPUChoice {
565
565
  * adapter merged into one model: a checkpoint of format `merged`, which is
566
566
  * what deploys (the job's own adapters are not deployable alone).
567
567
  *
568
+ * `exportStep` says which of this job's steps that merged model is made of:
569
+ * `'best'` (the default) is the step the validation loss picked, `'final'`
570
+ * the last step trained. It needs `exportMerged: true`; without it the SDK
571
+ * refuses before sending, as the API does (400 on `start_from.export_step`).
572
+ *
568
573
  * Refusals, all before anything is charged: 404 for an unknown, deleted or
569
574
  * other-workspace checkpoint; 422 START_FROM_BASE_MISMATCH,
570
575
  * START_FROM_CHAIN_BROKEN or START_FROM_LINK_UNREADABLE naming the `index`;
@@ -579,14 +584,22 @@ export interface TrainingStartFromParams {
579
584
  checkpointId: string;
580
585
  }[];
581
586
  exportMerged?: boolean;
587
+ exportStep?: TrainingExportStep;
582
588
  }
583
- /** `start_from` as the API echoes it on create, preflight and the job, with the digest of the chain's exact bytes. */
589
+ /** Which step of a `start_from` job its merged model is made of: the step validation picked, or the last one trained. */
590
+ export type TrainingExportStep = 'best' | 'final';
591
+ /**
592
+ * `start_from` as the API echoes it on create, preflight and the job, with the
593
+ * digest of the chain's exact bytes. `export_step` is echoed only when the
594
+ * request named it; absent, the merged model is of the `'best'` step.
595
+ */
584
596
  export interface TrainingStartFrom {
585
597
  adapters: {
586
598
  job_id: string;
587
599
  checkpoint_id: string;
588
600
  }[];
589
601
  export_merged: boolean;
602
+ export_step?: TrainingExportStep;
590
603
  chain_digest?: string;
591
604
  }
592
605
  /** Parameters for creating a training job. */
@@ -2403,7 +2416,11 @@ export interface ChatCompletionUsage {
2403
2416
  total_tokens: number;
2404
2417
  prompt_tokens_details?: PromptTokensDetails;
2405
2418
  }
2406
- /** Who gave a verdict. Feedback you send is `human` unless you say otherwise. */
2419
+ /**
2420
+ * Who gave a verdict a sample carries. Feedback you send is always `human`:
2421
+ * `verifier`, `judge` and `behavioural` are written by the platform's own
2422
+ * scoring, and the feedback route refuses them (400).
2423
+ */
2407
2424
  export type LoopSource = 'human' | 'verifier' | 'judge' | 'behavioural';
2408
2425
  /**
2409
2426
  * The judgement recorded on an answer.
@@ -2414,8 +2431,11 @@ export type LoopSource = 'human' | 'verifier' | 'judge' | 'behavioural';
2414
2431
  * trained on in place of the model's.
2415
2432
  * `gold` records the reference answer for the question, making no claim about
2416
2433
  * whether the model was right; it is trained on the same way.
2434
+ * `scored` is a score the platform's own scoring wrote; it is read, never sent.
2417
2435
  */
2418
2436
  export type LoopVerdict = 'accepted' | 'rejected' | 'edited' | 'scored' | 'gold';
2437
+ /** The verdicts feedback can send: a person's good, bad, correction or reference answer. */
2438
+ export type LoopFeedbackVerdict = 'accepted' | 'rejected' | 'edited' | 'gold';
2419
2439
  /** A function an assistant turn asked to invoke. `arguments` is JSON-encoded. */
2420
2440
  export interface LoopToolCall {
2421
2441
  id?: string;
@@ -2642,12 +2662,11 @@ export interface LoopSignal {
2642
2662
  created_at: string;
2643
2663
  }
2644
2664
  export interface LoopSignalParams {
2645
- verdict: LoopVerdict;
2646
- source?: LoopSource;
2647
- /** Required when verdict is `edited`. The answer the model should have given. */
2665
+ verdict: LoopFeedbackVerdict;
2666
+ /** Always `human` when sent: feedback is a person's. Other sources are refused 400. */
2667
+ source?: 'human';
2668
+ /** Required when verdict is `edited` or `gold`. The answer the model should have given. */
2648
2669
  correction?: string;
2649
- /** Required when verdict is `scored`: above zero trains the answer as it stands, otherwise it is left out. */
2650
- score?: number;
2651
2670
  /** A value or fact the answer can be checked against. Kept with the verdict; a pipeline trains on `correction`, not on this. */
2652
2671
  ground_truth?: string;
2653
2672
  reason?: string;
@@ -3974,10 +3993,10 @@ export interface BenchmarkRetireParams {
3974
3993
  * after a deleted conversation (`chain.rebuild`) is not held by the limit:
3975
3994
  * Train now starts it, and each one that goes live is a version, so the
3976
3995
  * pipeline can end past its limit.
3977
- * - `MONTHLY_LIMIT_REACHED` (409): the most this month's attempts can have
3978
- * cost plus the most one more may cost would pass the pipeline's internal
3979
- * monthly limit. The body carries the figures:
3980
- * see {@link TrainingRuleMonthlyLimitRefusal}.
3996
+ * - `MONTHLY_LIMIT_REACHED` (409): the pipeline has reached its monthly
3997
+ * safety limit. The body carries `resumes_at`, and `error.message` says
3998
+ * what holds the pipeline and when the next attempt can start, with no
3999
+ * amount: see {@link TrainingRuleMonthlyLimitRefusal}.
3981
4000
  * - `SCORING_CAPPED` (409): the key the comparison runs under is at its
3982
4001
  * monthly cap, so what this attempt trained could not be scored. The body
3983
4002
  * carries `resumes_at`, when the cap lifts (the next UTC month, or sooner
@@ -4063,34 +4082,22 @@ export type TrainingRuleRunRefusalCode = 'NOT_ENOUGH_SAMPLES' | 'PIPELINE_NEEDS_
4063
4082
  export type TrainingRuleSaveRefusalCode = 'PIPELINE_NAME_TAKEN' | 'OWN_TAG_TAKEN' | 'REVISION_MISMATCH' | 'RUN_ACTIVE' | 'NOT_A_SIMPLE_PIPELINE' | 'MODEL_NOT_TRAINABLE' | 'NO_GPU_FITS' | 'TRAINING_SETTING_OUT_OF_RANGE' | 'MODEL_REVISION_UNAVAILABLE' | 'NO_JUDGE_MODEL' | 'PROMOTION_POLICY_UNKNOWN' | 'PROMOTION_K_REQUIRED' | 'PROMOTION_K_UNREACHABLE' | 'PROMOTION_POLICY_NEEDS_BENCHMARK' | 'TRAINING_NOT_ENABLED' | 'METHOD_NOT_ENABLED' | 'CEILING_TOO_LOW' | 'MODELS_UNAVAILABLE' | 'GPU_OPTIONS_UNAVAILABLE' | 'AGENT_COULD_NOT_START';
4064
4083
  /**
4065
4084
  * The body of a manual run refused `409 MONTHLY_LIMIT_REACHED`, as
4066
- * `ApiError.body` carries it.
4067
- *
4068
- * The test is the worst case, not the average: a run may start only if the
4069
- * most the rule's runs this UTC calendar month can have cost
4070
- * (`month_spent_cents`), plus the most the run about to start may spend
4071
- * (`run_max_cents`), fits under the limit.
4085
+ * `ApiError.body` carries it: the pipeline's monthly safety limit holds it.
4086
+ * The limit is the platform's guard, set from the model's prices; the member
4087
+ * never sets it, so its figures are neither fields of the answer nor in
4088
+ * `message`, which says what holds the pipeline and when the next attempt can
4089
+ * start.
4072
4090
  */
4073
4091
  export interface TrainingRuleMonthlyLimitRefusal {
4074
4092
  error: {
4075
4093
  code: 'MONTHLY_LIMIT_REACHED';
4076
4094
  message: string;
4077
4095
  };
4078
- /** What this rule's runs have cost at most this UTC calendar month; see {@link Pipeline.month_spent_cents}. */
4079
- month_spent_cents: number;
4080
- /** The rule's monthly limit. */
4081
- monthly_ceiling_cents: number;
4082
4096
  /**
4083
- * The most one attempt of this rule may spend: its training, its comparison
4084
- * machine and its judging. While no version is live that machine also
4085
- * answers as the base model, so a pipeline's own attempt counts one; a
4086
- * challenger's attempt also counts the base model's own machine beside it.
4087
- */
4088
- run_max_cents: number;
4089
- /**
4090
- * The first instant of the next UTC month, when the counted spend starts
4091
- * again from nothing. When `run_max_cents` alone exceeds the limit, no month
4092
- * will ever fit: saving the pipeline sets the limit again from its model's
4093
- * prices, and nothing else changes it; `message` says which.
4097
+ * The first instant of the next UTC month, when the month's count starts
4098
+ * again from nothing. When one attempt alone can cost more than the whole
4099
+ * limit, no month will ever fit: saving the pipeline sets the limit again
4100
+ * from its model's prices, and nothing else changes it; `message` says which.
4094
4101
  */
4095
4102
  resumes_at: string;
4096
4103
  }
@@ -4168,10 +4175,8 @@ export interface PipelineVersion {
4168
4175
  verdict: TrainingVerdict | null;
4169
4176
  decision: TrainingDecision | null;
4170
4177
  decided_at: string | null;
4171
- /** True for the version the app is served by today (the same as `is_champion`). */
4172
- is_live: boolean;
4173
4178
  /** True for the version the app is served by today. */
4174
- is_champion: boolean;
4179
+ is_live: boolean;
4175
4180
  /** When it was first put live. */
4176
4181
  promoted_at: string | null;
4177
4182
  checkpoint_id: string | null;
@@ -4524,8 +4529,6 @@ export interface Pipeline {
4524
4529
  base_model_revision: string;
4525
4530
  /** The version serving now; null when what serves is not a version of this pipeline. */
4526
4531
  live_version: number | null;
4527
- /** The same number under its older name. */
4528
- champion_version: number | null;
4529
4532
  /**
4530
4533
  * Whether the deployment the live version answers from is up, as the
4531
4534
  * platform last checked it. Null when there is no live version, when what
@@ -4544,10 +4547,6 @@ export interface Pipeline {
4544
4547
  * does. Null when nothing has taken the name over.
4545
4548
  */
4546
4549
  serving_taken_over_by: string | null;
4547
- benchmark_id: string | null;
4548
- benchmark_name: string | null;
4549
- /** The least a benchmark's score has to rise by to count as an improvement under a policy that reads benchmarks. */
4550
- benchmark_min_delta: number;
4551
4550
  status: PipelineStatus;
4552
4551
  /**
4553
4552
  * The rule's own sentence about what it is waiting for or why it stopped,
@@ -4557,7 +4556,6 @@ export interface Pipeline {
4557
4556
  next_reason: string | null;
4558
4557
  last_checked_at: string | null;
4559
4558
  next_due_at: string | null;
4560
- auto_promote: boolean;
4561
4559
  /**
4562
4560
  * Why the platform stopped firing this rule, or null. `consent_invalid` is
4563
4561
  * a pipeline whose settings changed since it was last saved: saving it
@@ -4571,22 +4569,6 @@ export interface Pipeline {
4571
4569
  * trains on its own: an attempt would train and could not be compared.
4572
4570
  */
4573
4571
  scoring_capped_until: string | null;
4574
- /** The rule's monthly limit. Null means it has none. */
4575
- monthly_ceiling_cents: number | null;
4576
- /**
4577
- * What this rule's runs have cost at most, counted toward the monthly limit
4578
- * this UTC calendar month -- the figure the limit is enforced against. An
4579
- * upper bound, not an exact spend. A run counts toward the month it was
4580
- * created in, and a run still in progress also counts toward the current
4581
- * month, at the most it may cost (as `run_max_cents` counts it, a base
4582
- * model's machine included where the attempt has one of its own) or what it
4583
- * has been billed when that is more. A finished run counts what it was billed, and its comparison
4584
- * machines are billed at the most they could have cost (each machine's
4585
- * hourly cap for the time it was up, never more than its own amount). A run created in
4586
- * an earlier month that finishes in this one counts here only while it is
4587
- * still running.
4588
- */
4589
- month_spent_cents: number;
4590
4572
  active_run: PipelineActiveRun | null;
4591
4573
  /** How many versions it has made: every one is in `versions` from `getPipeline`, only the latest few and the live one on `listPipelines`. */
4592
4574
  versions_total: number;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "runbios-sdk",
3
- "version": "0.2.22-rc.320",
3
+ "version": "0.3.0-dev.322",
4
4
  "description": "Official TypeScript SDK for the Run BiOS training and deployment platform API",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -16,7 +16,8 @@
16
16
  "dist/**/*.d.ts",
17
17
  "!dist/**/*.map",
18
18
  "!dist/**/*.d.ts.map",
19
- "README.md"
19
+ "README.md",
20
+ "CHANGELOG.md"
20
21
  ],
21
22
  "scripts": {
22
23
  "build": "tsc",