runbios-sdk 0.5.0 → 0.6.0-rc.369

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 CHANGED
@@ -5,6 +5,29 @@ surface is added, renamed or removed, the patch for a fix inside an unchanged
5
5
  surface. The SDK, the Python SDK (`runbios-sdk` on PyPI) and the MCP server
6
6
  (`runbios-mcp`) are released together, at one version.
7
7
 
8
+ ## 0.6.0
9
+
10
+ Added
11
+
12
+ Managed training (the platform chooses the hardware; customers pay per trained token)
13
+
14
+ - `managed_options()` / `get_managed_training_options`: the context lengths
15
+ (2K-128K), precisions (`bf16`, `fp8`) and optimizer states (16-bit, 8-bit)
16
+ each model and adapter is tested for.
17
+ - Named inputs for those choices on create and preflight: `precision`,
18
+ `optim` and the validation row count (`precision`, `optim`, `validationRows`), mapped to
19
+ `config.precision`, `config.optim` and `config.split_dataset_samples`.
20
+ - Under managed training, GPU type and count, GPU priorities, the queue
21
+ switch, the hourly price cap, per-device batch, accumulation and checkpoint
22
+ count are chosen by the platform and ignored if sent. A job with no free
23
+ machine waits in the queue automatically, unbilled, and can be cancelled.
24
+ - Training logs and machine metrics (memory, MFU, throughput) are not
25
+ available to customers under managed training; training metrics are.
26
+
27
+ Also
28
+
29
+ - `training.liveDeployments` / `useLiveDeployment` for the Conscious Loop live-redeploy routes.
30
+
8
31
  ## 0.5.0
9
32
 
10
33
  Added
package/dist/client.js CHANGED
@@ -431,7 +431,7 @@ export class HttpClient {
431
431
  constructor(config) {
432
432
  // Default host stays api.runbios.ai for now; cutover to api.runbios.ai is
433
433
  // planned once its DNS exists.
434
- this.baseUrl = (config.baseUrl || envBaseUrl() || 'https://api.runbios.ai').replace(/\/+$/, '');
434
+ this.baseUrl = (config.baseUrl || envBaseUrl() || 'https://api-staging.runbios.ai').replace(/\/+$/, '');
435
435
  this.apiKey = config.apiKey ?? envApiKey();
436
436
  this.accessToken = config.accessToken;
437
437
  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.5.0";
39
+ export declare const VERSION = "0.6.0-rc.369";
40
40
  export declare class RunBiOS {
41
41
  /** Search models, fetch configs, check adapter compatibility. */
42
42
  readonly models: Models;
@@ -79,7 +79,7 @@ export { Wallet } from './resources/wallet.js';
79
79
  export { GPU, type GPURecommendation } from './resources/gpu.js';
80
80
  export { LoopNoVersionError, type LoopChatParams, type LoopChatResult, } from './resources/loop-chat.js';
81
81
  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';
82
- 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, BenchmarkQuestionsParams, BenchmarkQuestionsTraining, BenchmarkQuestionResult, BenchmarkQuestion, BenchmarkQuestionsResponse, TrainingCurvePoint, TrainingCurve, TrainingRuleRunRefusalCode, TrainingRuleSaveRefusalCode, TrainingRuleMonthlyLimitRefusal, PipelineStatus, PipelineActiveRun, PipelineVersion, PipelineAttempt, AttemptExplanation, AttemptMissedBar, PipelineModelRole, PipelineComparedWith, PipelineTotals, PipelineTrainingsByResult, PipelineTrainingsByModel, PipelineSpentParts, PipelineAttemptListParams, PipelineAttemptListResponse, PipelineAttemptModelFilter, PipelineAttemptResultFilter, PipelineAttemptTrigger, PipelineSecondModel, PipelineSecondModelState, Lineage, PipelineChain, PipelineChainRebuild, TrainingRunRollbackRefusalCode, TrainingRunRetestRefusalCode, 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, LoopCaptureFeedback, LoopFeedbackWord, LoopCaptureHealth, LoopCaptureMiss, LoopSignalManyItem, LoopSignalManyResult, PromotionPolicyState, RuleBenchmark, PipelineBenchmarksResponse, PipelineBenchmarkAttachParams, PipelineBenchmarkMoveParams, CompareBenchmark, VersionBenchmarkScore, PromotionMeasurement, PromotionOutcome, VersionHoldout, VersionCommonSet, VersionScores, VersionScoreDifference, VersionCompareResponse, VersionCompareParams, TrainingRunPromotion, VerdictCheck, VerdictCheckKey, VerdictChecksWithheld, TrainingRunCost, AttemptDirection, AttemptHoldout, AttemptCompareSide, AttemptSharedSample, AttemptSharedFigures, AttemptBenchmarkSide, AttemptCompareBenchmark, AttemptCompareItemSide, AttemptCompareItem, AttemptCompareResponse, AttemptCompareParams, LoopTraceJudge, LoopJudgeFilter, LoopSampleState, LoopSampleStateName, LoopSampleDay, LoopImportRefusal, PipelineAutoScoring, PipelineAutoScoringStatus, LoopDatasetFeedback, LoopSampleOrigin, LoopFeedbackCounts, LoopPipelineCounts, LoopDatasetPipelineRef, LoopDataset, LoopDatasetWrite, LoopDatasetCreate, LoopDatasetPreviewParams, LoopDatasetPreviewModel, LoopDatasetPreview, LoopDatasetListParams, LoopDatasetListResponse, LoopDatasetCreator, LoopDatasetLearnedBy, LoopDatasetExportParams, LoopDatasetExportLine, LoopDatasetExport, LoopDatasetDeleteResponse, PipelineDatasetRef, PipelineConditions, PipelineConditionsWrite, TrainedOnDataset, TrainedOn, } from './types.js';
82
+ 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, TrainingCostEstimate, ManagedTrainingOption, ManagedTrainingOptions, ManagedTrainingOptionsParams, 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, BenchmarkQuestionsParams, BenchmarkQuestionsTraining, BenchmarkQuestionResult, BenchmarkQuestion, BenchmarkQuestionsResponse, TrainingCurvePoint, TrainingCurve, TrainingRuleRunRefusalCode, TrainingRuleSaveRefusalCode, TrainingRuleMonthlyLimitRefusal, PipelineStatus, PipelineActiveRun, PipelineVersion, PipelineAttempt, AttemptExplanation, AttemptMissedBar, PipelineModelRole, PipelineComparedWith, PipelineTotals, PipelineTrainingsByResult, PipelineTrainingsByModel, PipelineSpentParts, PipelineAttemptListParams, PipelineAttemptListResponse, PipelineAttemptModelFilter, PipelineAttemptResultFilter, PipelineAttemptTrigger, PipelineSecondModel, PipelineSecondModelState, Lineage, PipelineChain, PipelineChainRebuild, TrainingRunRollbackRefusalCode, TrainingRunRetestRefusalCode, 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, LoopCaptureFeedback, LoopFeedbackWord, LoopCaptureHealth, LoopCaptureMiss, LoopSignalManyItem, LoopSignalManyResult, PromotionPolicyState, RuleBenchmark, PipelineBenchmarksResponse, PipelineBenchmarkAttachParams, PipelineBenchmarkMoveParams, CompareBenchmark, VersionBenchmarkScore, PromotionMeasurement, PromotionOutcome, VersionHoldout, VersionCommonSet, VersionScores, VersionScoreDifference, VersionCompareResponse, VersionCompareParams, TrainingRunPromotion, VerdictCheck, VerdictCheckKey, VerdictChecksWithheld, TrainingRunCost, AttemptDirection, AttemptHoldout, AttemptCompareSide, AttemptSharedSample, AttemptSharedFigures, AttemptBenchmarkSide, AttemptCompareBenchmark, AttemptCompareItemSide, AttemptCompareItem, AttemptCompareResponse, AttemptCompareParams, LoopTraceJudge, LoopJudgeFilter, LoopSampleState, LoopSampleStateName, LoopSampleDay, LoopImportRefusal, PipelineAutoScoring, PipelineAutoScoringStatus, LoopDatasetFeedback, LoopSampleOrigin, LoopFeedbackCounts, LoopPipelineCounts, LoopDatasetPipelineRef, LoopDataset, LoopDatasetWrite, LoopDatasetCreate, LoopDatasetPreviewParams, LoopDatasetPreviewModel, LoopDatasetPreview, LoopDatasetListParams, LoopDatasetListResponse, LoopDatasetCreator, LoopDatasetLearnedBy, LoopDatasetExportParams, LoopDatasetExportLine, LoopDatasetExport, LoopDatasetDeleteResponse, PipelineDatasetRef, PipelineConditions, PipelineConditionsWrite, TrainedOnDataset, TrainedOn, } from './types.js';
83
83
  /** The closed set of run states a training run never leaves. */
84
84
  export { TERMINAL_RUN_STATES } from './types.js';
85
85
  /** 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.5.0';
39
+ export const VERSION = '0.6.0-rc.369';
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.runbios.ai').replace(/\/+$/, '');
376
+ this.baseUrl = (config.baseUrl || envBaseUrl() || 'https://api-staging.runbios.ai').replace(/\/+$/, '');
377
377
  this.timeout = config.timeout ?? 900_000;
378
378
  this._http = http;
379
379
  }
@@ -598,6 +598,22 @@ export declare class Loop {
598
598
  * the base on every remaining sample, with no wait for new ones.
599
599
  */
600
600
  runPipeline(id: string): Promise<PipelineMutationResponse>;
601
+ /**
602
+ * The workspace's deployments serving exactly the live version's weights.
603
+ * For a live version whose deployment was deleted: deploy its weights again
604
+ * (`live.training_job_id`, `live.checkpoint_id`), then pick the deployment
605
+ * with {@link useLiveDeployment}. 409 `NO_LIVE_VERSION` when it has none.
606
+ */
607
+ liveDeployments(id: string): Promise<LiveDeploymentsResponse>;
608
+ /**
609
+ * Answer the pipeline's model name from this deployment of the live
610
+ * version's weights. Nothing is trained again; the deployment bills you by
611
+ * the hour, like any deployment. Refused while the pipeline's own
612
+ * deployment still exists (409 `LIVE_DEPLOYMENT_PRESENT`: start it again
613
+ * instead), for other weights (422 `DEPLOYMENT_WEIGHTS_DIFFER`) and for a
614
+ * deployment that is not running (409 `DEPLOYMENT_NOT_RUNNING`).
615
+ */
616
+ useLiveDeployment(id: string, deploymentId: string): Promise<UseLiveDeploymentResponse>;
601
617
  /**
602
618
  * {@link importRows}, with every row given the pipeline's own tag. `source`
603
619
  * defaults to that tag; the rows, the answer and the retry rules are the
@@ -851,3 +867,30 @@ export declare class Loop {
851
867
  */
852
868
  listBenchmarkRunItems(id: string, params?: BenchmarkRunItemListParams): Promise<BenchmarkRunItemsResponse>;
853
869
  }
870
+ /** What {@link Loop.liveDeployments} answers. */
871
+ export interface LiveDeploymentsResponse {
872
+ live: {
873
+ run_id: string;
874
+ version: number;
875
+ checkpoint_id: string;
876
+ training_job_id: string | null;
877
+ };
878
+ current_deployment_id: string | null;
879
+ deployments: Array<{
880
+ id: string;
881
+ name: string;
882
+ status: string;
883
+ }>;
884
+ }
885
+ /** What {@link Loop.useLiveDeployment} answers. */
886
+ export interface UseLiveDeploymentResponse {
887
+ live: {
888
+ run_id: string;
889
+ version: number;
890
+ checkpoint_id: string;
891
+ training_job_id: string | null;
892
+ };
893
+ deployment_id: string;
894
+ status: string;
895
+ serving_name: string;
896
+ }
@@ -954,6 +954,26 @@ export class Loop {
954
954
  async runPipeline(id) {
955
955
  return this._http.fetchPost(`/api/loop/pipelines/${encodeURIComponent(id)}/run`, {});
956
956
  }
957
+ /**
958
+ * The workspace's deployments serving exactly the live version's weights.
959
+ * For a live version whose deployment was deleted: deploy its weights again
960
+ * (`live.training_job_id`, `live.checkpoint_id`), then pick the deployment
961
+ * with {@link useLiveDeployment}. 409 `NO_LIVE_VERSION` when it has none.
962
+ */
963
+ async liveDeployments(id) {
964
+ return this._http.fetchGet(`/api/loop/pipelines/${encodeURIComponent(id)}/live/deployments`);
965
+ }
966
+ /**
967
+ * Answer the pipeline's model name from this deployment of the live
968
+ * version's weights. Nothing is trained again; the deployment bills you by
969
+ * the hour, like any deployment. Refused while the pipeline's own
970
+ * deployment still exists (409 `LIVE_DEPLOYMENT_PRESENT`: start it again
971
+ * instead), for other weights (422 `DEPLOYMENT_WEIGHTS_DIFFER`) and for a
972
+ * deployment that is not running (409 `DEPLOYMENT_NOT_RUNNING`).
973
+ */
974
+ async useLiveDeployment(id, deploymentId) {
975
+ return this._http.fetchPost(`/api/loop/pipelines/${encodeURIComponent(id)}/live/deployment`, { deployment_id: deploymentId });
976
+ }
957
977
  /**
958
978
  * {@link importRows}, with every row given the pipeline's own tag. `source`
959
979
  * defaults to that tag; the rows, the answer and the retry rules are the
@@ -1,5 +1,5 @@
1
1
  import type { HttpClient } from '../client.js';
2
- import type { TrainingCreateParams, TrainingListParams, TrainingJob, TrainingListResponse, TrainingMetrics, TrainingMetricsOptions, TrainingCheckpoint, TrainingLogs, TrainingStopResponse, TrainingResumeResponse, TrainingPreflightResponse, TrainingRecommendParams, TrainingAdvisorVerdict, TrainingCapabilities } from '../types.js';
2
+ import type { TrainingCreateParams, TrainingListParams, TrainingJob, TrainingListResponse, TrainingMetrics, TrainingMetricsOptions, TrainingCheckpoint, TrainingLogs, TrainingStopResponse, TrainingResumeResponse, TrainingPreflightResponse, TrainingRecommendParams, TrainingAdvisorVerdict, TrainingCapabilities, ManagedTrainingOptions, ManagedTrainingOptionsParams } from '../types.js';
3
3
  /**
4
4
  * Create, monitor, and manage fine-tuning training jobs.
5
5
  */
@@ -35,6 +35,21 @@ export declare class Training {
35
35
  * when the alternatives list is empty; waiting is unbilled. The SDK never
36
36
  * auto-substitutes a GPU; a transient 503 is a retry, never a capacity verdict.
37
37
  *
38
+ * Managed training: when `capabilities().features` lists `managed_training`
39
+ * enabled, the platform chooses the hardware. Choose the context length,
40
+ * precision and optimizer state from `managedOptions()` (context 2K-128K,
41
+ * `bf16`/`fp8`, `adamw_torch_fused` 16-bit or `adamw_8bit` 8-bit state).
42
+ * `gpuType`, `gpuCount`, `gpuPriorities`, `queueIfUnavailable`,
43
+ * `maxPriceHourCents`, batch size, gradient accumulation and checkpoint
44
+ * count are then ignored (preflight warns `FIELD_IGNORED`). The schedule,
45
+ * validation rows (`split_dataset_samples`) and early stopping stay yours.
46
+ * Validation rows must be between 100 (or 5% of the rows when that is under
47
+ * 100) and 40% of the training rows; unset, 5% capped at 1,000 rows is held
48
+ * out unless the job has evaluation datasets, and preflight returns the
49
+ * exact rows and range in `validation`. The schedule defaults to cosine. It waits unbilled when no machine is free, keeps its best
50
+ * and latest checkpoints, and with `token_billing` is charged per trained
51
+ * token (`preflight` returns `estimate`).
52
+ *
38
53
  * @example
39
54
  * ```ts
40
55
  * const job = await client.training.create({
@@ -55,6 +70,14 @@ export declare class Training {
55
70
  create(params: TrainingCreateParams): Promise<TrainingJob>;
56
71
  /** Validate and canonicalize a training request without creating or billing a job. */
57
72
  preflight(params: TrainingCreateParams): Promise<TrainingPreflightResponse>;
73
+ /**
74
+ * Managed training: what this model, method and adapter can be trained with
75
+ * -- the context lengths, precisions (`bf16`, `fp8`) and optimizer states
76
+ * (`adamw_torch_fused` = 16-bit, `adamw_8bit` = 8-bit) its certified setups
77
+ * cover. The platform chooses the hardware; every option listed is accepted
78
+ * by `preflight` and `create`. Empty `options`: not trainable yet.
79
+ */
80
+ managedOptions(params: ManagedTrainingOptionsParams): Promise<ManagedTrainingOptions>;
58
81
  /**
59
82
  * Ask the trainer's own sizing model what to run: per-device batch,
60
83
  * accumulation, learning rate, warmup, predicted peak memory, minimum GPU
@@ -121,6 +144,11 @@ export declare class Training {
121
144
  /**
122
145
  * Get training logs for a job.
123
146
  *
147
+ * Not available when managed training is enabled (the server answers 404
148
+ * `LOGS_NOT_AVAILABLE`): progress is on {@link get} and training metrics on
149
+ * `getMetrics`, which then carry training metrics only (no memory, MFU or
150
+ * throughput).
151
+ *
124
152
  * @param id - Training job ID.
125
153
  * @param tail - Maximum newest entries to return (server clamps to 1-1000).
126
154
  *
@@ -160,6 +160,13 @@ function buildTrainingRequest(params) {
160
160
  config.early_stopping_patience = params.earlyStoppingPatience;
161
161
  if (params.overlongPolicy !== undefined)
162
162
  config.overlong_policy = params.overlongPolicy;
163
+ // Managed training choices (see managedOptions()).
164
+ if (params.precision !== undefined)
165
+ config.precision = params.precision;
166
+ if (params.optim !== undefined)
167
+ config.optim = params.optim;
168
+ if (params.validationRows !== undefined)
169
+ config.split_dataset_samples = params.validationRows;
163
170
  if (params.extraConfig)
164
171
  Object.assign(config, params.extraConfig);
165
172
  if (Object.keys(config).length > 0)
@@ -241,6 +248,21 @@ export class Training {
241
248
  * when the alternatives list is empty; waiting is unbilled. The SDK never
242
249
  * auto-substitutes a GPU; a transient 503 is a retry, never a capacity verdict.
243
250
  *
251
+ * Managed training: when `capabilities().features` lists `managed_training`
252
+ * enabled, the platform chooses the hardware. Choose the context length,
253
+ * precision and optimizer state from `managedOptions()` (context 2K-128K,
254
+ * `bf16`/`fp8`, `adamw_torch_fused` 16-bit or `adamw_8bit` 8-bit state).
255
+ * `gpuType`, `gpuCount`, `gpuPriorities`, `queueIfUnavailable`,
256
+ * `maxPriceHourCents`, batch size, gradient accumulation and checkpoint
257
+ * count are then ignored (preflight warns `FIELD_IGNORED`). The schedule,
258
+ * validation rows (`split_dataset_samples`) and early stopping stay yours.
259
+ * Validation rows must be between 100 (or 5% of the rows when that is under
260
+ * 100) and 40% of the training rows; unset, 5% capped at 1,000 rows is held
261
+ * out unless the job has evaluation datasets, and preflight returns the
262
+ * exact rows and range in `validation`. The schedule defaults to cosine. It waits unbilled when no machine is free, keeps its best
263
+ * and latest checkpoints, and with `token_billing` is charged per trained
264
+ * token (`preflight` returns `estimate`).
265
+ *
244
266
  * @example
245
267
  * ```ts
246
268
  * const job = await client.training.create({
@@ -280,6 +302,21 @@ export class Training {
280
302
  const { body } = buildTrainingRequest(params);
281
303
  return this._http.fetchPost('/api/training/preflight', body);
282
304
  }
305
+ /**
306
+ * Managed training: what this model, method and adapter can be trained with
307
+ * -- the context lengths, precisions (`bf16`, `fp8`) and optimizer states
308
+ * (`adamw_torch_fused` = 16-bit, `adamw_8bit` = 8-bit) its certified setups
309
+ * cover. The platform chooses the hardware; every option listed is accepted
310
+ * by `preflight` and `create`. Empty `options`: not trainable yet.
311
+ */
312
+ async managedOptions(params) {
313
+ const q = new URLSearchParams({
314
+ model_id: params.model,
315
+ training_method: params.method === 'cpt' ? 'pt' : params.method || 'sft',
316
+ train_type: params.adapter || 'lora',
317
+ });
318
+ return this._http.fetchGet(`/api/training/managed-options?${q}`);
319
+ }
283
320
  /**
284
321
  * Ask the trainer's own sizing model what to run: per-device batch,
285
322
  * accumulation, learning rate, warmup, predicted peak memory, minimum GPU
@@ -424,6 +461,11 @@ export class Training {
424
461
  /**
425
462
  * Get training logs for a job.
426
463
  *
464
+ * Not available when managed training is enabled (the server answers 404
465
+ * `LOGS_NOT_AVAILABLE`): progress is on {@link get} and training metrics on
466
+ * `getMetrics`, which then carry training metrics only (no memory, MFU or
467
+ * throughput).
468
+ *
427
469
  * @param id - Training job ID.
428
470
  * @param tail - Maximum newest entries to return (server clamps to 1-1000).
429
471
  *
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.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-staging.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.runbios.ai. */
17
+ /** Inference base URL. Defaults to baseUrl, then https://api-staging.runbios.ai. */
18
18
  inferenceBaseUrl?: string;
19
19
  /** End-to-end inference timeout in milliseconds. Defaults to 15 minutes. */
20
20
  inferenceTimeout?: number;
@@ -730,6 +730,12 @@ export interface TrainingCreateParams {
730
730
  earlyStoppingPatience?: number;
731
731
  /** Samples longer than maxSeqLength: 'truncate' keeps the last tokens (default), 'drop' skips them. */
732
732
  overlongPolicy?: 'truncate' | 'drop';
733
+ /** Managed training: precision recipe from managedOptions() (bf16 or fp8). */
734
+ precision?: 'bf16' | 'fp8';
735
+ /** Managed training: optimizer state, adamw_torch_fused (16-bit) or adamw_8bit (8-bit). */
736
+ optim?: 'adamw_torch_fused' | 'adamw_8bit';
737
+ /** Managed training: validation rows held out and never trained on (0 turns validation off). */
738
+ validationRows?: number;
733
739
  /** Additional configuration passed directly to the training backend. */
734
740
  extraConfig?: Record<string, unknown>;
735
741
  }
@@ -1163,6 +1169,55 @@ export interface TrainingPreflightResponse {
1163
1169
  * you asked for is predicted to fit. Absent when no advisor is deployed.
1164
1170
  */
1165
1171
  advisor?: TrainingAdvisorVerdict;
1172
+ /**
1173
+ * Token and price estimate of a managed, token-billed run (present when the
1174
+ * capabilities list `token_billing` enabled). You are charged the exact
1175
+ * tokens trained; this is the estimate before launch.
1176
+ */
1177
+ estimate?: TrainingCostEstimate;
1178
+ }
1179
+ /** Estimated tokens and price of a managed training run. */
1180
+ /** One precision + optimizer-state combination a managed job may choose for a
1181
+ * model, method and adapter, with the context lengths a certified setup covers
1182
+ * for it. Names no hardware. Every option is accepted by preflight and create. */
1183
+ export interface ManagedTrainingOption {
1184
+ /** `bf16` or `fp8`. */
1185
+ precision: string;
1186
+ /** `adamw_torch_fused` (16-bit state) or `adamw_8bit` (8-bit state). */
1187
+ optim: string;
1188
+ max_length: number;
1189
+ /** Context lengths offered for this option: 2048 ... 131072. */
1190
+ context_lengths: number[];
1191
+ }
1192
+ export interface ManagedTrainingOptions {
1193
+ model_id: string;
1194
+ /** Whether managed training is on in this environment. */
1195
+ enabled: boolean;
1196
+ /** Default (bf16, 16-bit state) first. Empty: not trainable yet. */
1197
+ options: ManagedTrainingOption[];
1198
+ all_context_bands: number[];
1199
+ default_max_length: number;
1200
+ }
1201
+ export interface ManagedTrainingOptionsParams {
1202
+ model: string;
1203
+ /** sft (default), pt or cpt. */
1204
+ method?: string;
1205
+ /** lora (default), qlora or full. */
1206
+ adapter?: string;
1207
+ }
1208
+ export interface TrainingCostEstimate {
1209
+ train_rows: number;
1210
+ mean_tokens_per_row: number;
1211
+ max_length: number;
1212
+ epochs: number;
1213
+ max_steps?: number;
1214
+ tokens_per_epoch: number;
1215
+ estimated_tokens: number;
1216
+ cents_per_million_tokens: number;
1217
+ minimum_charge_cents: number;
1218
+ estimated_cents: number;
1219
+ image_tokens_included: boolean;
1220
+ basis: string;
1166
1221
  }
1167
1222
  /** Parameters for `training.recommend()` (GET /api/training/recommend). */
1168
1223
  export interface TrainingRecommendParams {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "runbios-sdk",
3
- "version": "0.5.0",
3
+ "version": "0.6.0-rc.369",
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",