runbios-sdk 0.6.4 → 0.6.5-dev.411
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 +6 -0
- package/README.md +12 -2
- 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/training.d.ts +4 -2
- package/dist/resources/training.js +7 -1
- package/dist/types.d.ts +35 -3
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,12 @@ 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.5
|
|
9
|
+
|
|
10
|
+
- Training job details, list entries and metrics reports expose completed steps, planned steps, percentage of plan and the recorded stop reason. A missing historical plan or reason is null.
|
|
11
|
+
- `getCheckpointDownloadManifest` issues 15-minute checkpoint file and ZIP links for the requesting user and workspace. Call it again to renew links. Weight downloads require the workspace’s model-download permission.
|
|
12
|
+
- Dataset multipart uploads keep the same part-URL and completion payloads. The service now issues short-lived Run BiOS addresses for uploading parts and reading previews.
|
|
13
|
+
|
|
8
14
|
## 0.6.4
|
|
9
15
|
|
|
10
16
|
Changed
|
package/README.md
CHANGED
|
@@ -589,7 +589,12 @@ const job = await client.training.create(request);
|
|
|
589
589
|
const jobs = await client.training.list({ status: 'running' });
|
|
590
590
|
const page = await client.training.listPage({ limit: 50, offset: 0 });
|
|
591
591
|
|
|
592
|
-
//
|
|
592
|
+
// Read the actual step and the original plan. A completed run may end below its plan.
|
|
593
|
+
const detail = await client.training.get('job_abc123');
|
|
594
|
+
const progress = detail.step_progress;
|
|
595
|
+
if (progress) console.log(progress.completed_steps, progress.planned_steps, progress.stop_reason);
|
|
596
|
+
|
|
597
|
+
// Read metric averages, ranges and best steps.
|
|
593
598
|
const report = await client.training.getMetrics('job_abc123', { view: 'summary' });
|
|
594
599
|
for (const metric of report.metric_summaries ?? []) {
|
|
595
600
|
console.log(metric.label, metric.latest, metric.average, metric.best);
|
|
@@ -601,8 +606,13 @@ for (const point of metrics.metrics) console.log(point.step, point.loss);
|
|
|
601
606
|
|
|
602
607
|
// Get checkpoints
|
|
603
608
|
const checkpoints = await client.training.getCheckpoints('job_abc123');
|
|
609
|
+
if (checkpoints.length) {
|
|
610
|
+
const manifest = await client.training.getCheckpointDownloadManifest('job_abc123', checkpoints[0].id);
|
|
611
|
+
console.log(manifest.expires_at, manifest.files.map(f => f.name));
|
|
612
|
+
// Pass a file name as the third argument to renew just its download link.
|
|
613
|
+
}
|
|
604
614
|
|
|
605
|
-
//
|
|
615
|
+
// On workspaces with access to trainer logs
|
|
606
616
|
const logs = await client.training.getLogs('job_abc123');
|
|
607
617
|
for (const entry of logs.logs) console.log(entry.level, entry.message);
|
|
608
618
|
|
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-dev.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.6.
|
|
39
|
+
export declare const VERSION = "0.6.5-dev.411";
|
|
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, TrainingSaveCheckpointResponse, 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';
|
|
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, CheckpointDownloadFile, CheckpointDownloadManifest, TrainingLogs, TrainingLogEntry, TrainingStopResponse, TrainingSaveCheckpointResponse, 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.6.
|
|
39
|
+
export const VERSION = '0.6.5-dev.411';
|
|
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-dev.runbios.ai').replace(/\/+$/, '');
|
|
377
377
|
this.timeout = config.timeout ?? 900_000;
|
|
378
378
|
this._http = http;
|
|
379
379
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { HttpClient } from '../client.js';
|
|
2
|
-
import type { TrainingCreateParams, TrainingListParams, TrainingJob, TrainingListResponse, TrainingMetrics, TrainingMetricsOptions, TrainingCheckpoint, TrainingLogs, TrainingStopResponse, TrainingSaveCheckpointResponse, TrainingResumeResponse, TrainingPreflightResponse, TrainingRecommendParams, TrainingAdvisorVerdict, TrainingCapabilities, ManagedTrainingOptions, ManagedTrainingOptionsParams } from '../types.js';
|
|
2
|
+
import type { TrainingCreateParams, TrainingListParams, TrainingJob, TrainingListResponse, TrainingMetrics, TrainingMetricsOptions, TrainingCheckpoint, CheckpointDownloadManifest, TrainingLogs, TrainingStopResponse, TrainingSaveCheckpointResponse, TrainingResumeResponse, TrainingPreflightResponse, TrainingRecommendParams, TrainingAdvisorVerdict, TrainingCapabilities, ManagedTrainingOptions, ManagedTrainingOptionsParams } from '../types.js';
|
|
3
3
|
/**
|
|
4
4
|
* Create, monitor, and manage fine-tuning training jobs.
|
|
5
5
|
*/
|
|
@@ -108,7 +108,7 @@ export declare class Training {
|
|
|
108
108
|
* @example
|
|
109
109
|
* ```ts
|
|
110
110
|
* const job = await client.training.get('job_abc123');
|
|
111
|
-
* console.log(
|
|
111
|
+
* console.log(job.status, job.step_progress?.completed_steps, job.step_progress?.planned_steps);
|
|
112
112
|
* ```
|
|
113
113
|
*/
|
|
114
114
|
get(id: string): Promise<TrainingJob>;
|
|
@@ -141,6 +141,8 @@ export declare class Training {
|
|
|
141
141
|
* ```
|
|
142
142
|
*/
|
|
143
143
|
getCheckpoints(id: string): Promise<TrainingCheckpoint[]>;
|
|
144
|
+
/** Issue fresh 15-minute links for this caller and workspace. A file filter returns one entry. */
|
|
145
|
+
getCheckpointDownloadManifest(jobId: string, checkpointId: string, file?: string): Promise<CheckpointDownloadManifest>;
|
|
144
146
|
/**
|
|
145
147
|
* Get training logs for a job.
|
|
146
148
|
*
|
|
@@ -397,7 +397,7 @@ export class Training {
|
|
|
397
397
|
* @example
|
|
398
398
|
* ```ts
|
|
399
399
|
* const job = await client.training.get('job_abc123');
|
|
400
|
-
* console.log(
|
|
400
|
+
* console.log(job.status, job.step_progress?.completed_steps, job.step_progress?.planned_steps);
|
|
401
401
|
* ```
|
|
402
402
|
*/
|
|
403
403
|
async get(id) {
|
|
@@ -458,6 +458,12 @@ export class Training {
|
|
|
458
458
|
const result = await this._http.fetchGet(`/api/training/jobs/${encodeURIComponent(id)}/checkpoints`);
|
|
459
459
|
return Array.isArray(result) ? result : result.checkpoints || [];
|
|
460
460
|
}
|
|
461
|
+
/** Issue fresh 15-minute links for this caller and workspace. A file filter returns one entry. */
|
|
462
|
+
async getCheckpointDownloadManifest(jobId, checkpointId, file) {
|
|
463
|
+
const path = `/api/training/jobs/${encodeURIComponent(jobId)}/checkpoints/${encodeURIComponent(checkpointId)}/download`;
|
|
464
|
+
const query = file === undefined ? '' : '?' + new URLSearchParams({ file }).toString();
|
|
465
|
+
return this._http.fetchGet(path + query);
|
|
466
|
+
}
|
|
461
467
|
/**
|
|
462
468
|
* Get training logs for a job.
|
|
463
469
|
*
|
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-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.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;
|
|
@@ -773,7 +773,15 @@ export interface TrainingJobPhase {
|
|
|
773
773
|
updated_at?: string;
|
|
774
774
|
}
|
|
775
775
|
/** A training job. */
|
|
776
|
+
export interface TrainingStepProgress {
|
|
777
|
+
completed_steps: number;
|
|
778
|
+
planned_steps: number | null;
|
|
779
|
+
percent_of_plan: number | null;
|
|
780
|
+
ended_before_plan: boolean | null;
|
|
781
|
+
stop_reason: 'early_stopping' | 'user' | 'platform' | null;
|
|
782
|
+
}
|
|
776
783
|
export interface TrainingJob {
|
|
784
|
+
step_progress?: TrainingStepProgress;
|
|
777
785
|
id: string;
|
|
778
786
|
/** Present on create/resume responses; id is always normalized from this value. */
|
|
779
787
|
job_id?: string;
|
|
@@ -815,7 +823,6 @@ export interface TrainingJob {
|
|
|
815
823
|
resume_count?: number;
|
|
816
824
|
can_resume?: boolean;
|
|
817
825
|
has_cached_dataset?: boolean;
|
|
818
|
-
final_model_s3_key?: string | null;
|
|
819
826
|
/** Whether a completed run's final model is saved. */
|
|
820
827
|
final_model_saved?: boolean;
|
|
821
828
|
/** Final model of a completed run: 'saved', 'deleted' (saved, then deleted on
|
|
@@ -997,7 +1004,9 @@ export interface TrainingMetricsRunContext {
|
|
|
997
1004
|
model_id: string;
|
|
998
1005
|
model_revision: string;
|
|
999
1006
|
current_step: number;
|
|
1007
|
+
/** Recorded plan, or zero when unavailable. step_progress keeps unknown values nullable. */
|
|
1000
1008
|
total_steps: number;
|
|
1009
|
+
step_progress?: TrainingStepProgress;
|
|
1001
1010
|
gpu_type: string;
|
|
1002
1011
|
gpu_count: number;
|
|
1003
1012
|
parameters: Record<string, unknown>;
|
|
@@ -1065,6 +1074,29 @@ export interface TrainingCheckpoint {
|
|
|
1065
1074
|
/** On a merged model: the adapter checkpoint it was merged from. */
|
|
1066
1075
|
merged_of_checkpoint_id?: string;
|
|
1067
1076
|
}
|
|
1077
|
+
/** One checkpoint file and its authenticated Run BiOS download link. */
|
|
1078
|
+
export interface CheckpointDownloadFile {
|
|
1079
|
+
name: string;
|
|
1080
|
+
size_bytes: number;
|
|
1081
|
+
source: string;
|
|
1082
|
+
url: string;
|
|
1083
|
+
expires_at: string;
|
|
1084
|
+
}
|
|
1085
|
+
export interface CheckpointDownloadManifest {
|
|
1086
|
+
files: CheckpointDownloadFile[];
|
|
1087
|
+
total_bytes: number;
|
|
1088
|
+
artifact_kind: 'lora_adapter' | 'full_model';
|
|
1089
|
+
expires_at: string;
|
|
1090
|
+
zip_name: string;
|
|
1091
|
+
/** Present when the complete checkpoint can be downloaded as a ZIP. */
|
|
1092
|
+
zip_url?: string;
|
|
1093
|
+
missing_optional_assets: string[];
|
|
1094
|
+
adapter_missing_modules: string[];
|
|
1095
|
+
model_missing_tensors: string[];
|
|
1096
|
+
base_model_id: string;
|
|
1097
|
+
base_model_revision: string;
|
|
1098
|
+
immutable_base_model_source: string;
|
|
1099
|
+
}
|
|
1068
1100
|
/** Training logs response. */
|
|
1069
1101
|
export interface TrainingLogs {
|
|
1070
1102
|
logs: TrainingLogEntry[];
|