runbios-sdk 0.2.1-dev.114 → 0.2.1-dev.116

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/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.1-dev.114";
39
+ export declare const VERSION = "0.2.1-dev.116";
40
40
  export declare class RunBiOS {
41
41
  /** Search models, fetch configs, check adapter compatibility. */
42
42
  readonly models: Models;
@@ -75,4 +75,4 @@ 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, } from './resources/inference.js';
78
- export type { BiOSConfig, PaginatedResponse, ApiErrorBody, AvailableGpuAlternative, CapacityMinimumRequirement, InferenceBookingAccepted, Model, ModelSearchParams, ModelSearchResponse, ModelDetailResponse, ModelConfig, Dataset, DatasetListParams, DatasetListResponse, DatasetUploadParams, DatasetPreview, DatasetPreviewParams, DatasetImportHFParams, DatasetRegisterHFParams, DatasetHubSearchParams, DatasetHubPreviewParams, DatasetValidation, DatasetFormatVariant, DatasetFormatSpec, DatasetFormatSpecs, DatasetStorageUsage, TrainingMethod, RLHFAlgorithm, AdapterType, TrainingJobStatus, TrainingStatusFilter, TrainingCreateParams, TrainingListParams, TrainingListResponse, TrainingJob, TrainingMetrics, MetricPoint, MetricGraphConfig, TrainingCheckpoint, TrainingLogs, TrainingLogEntry, TrainingStopResponse, TrainingResumeResponse, CanonicalTrainingRequest, TrainingPreflightDataset, TrainingPreflightWarning, TrainingPreflightResponse, TrainingCapabilityChoice, TrainingConfigFieldCapability, TrainingCapabilities, GPUChoice, WalletBalance, Transaction, TransactionListResponse, TransactionListParams, GPUInfo, GPUPricingResponse, GPUOptionsParams, 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, } from './types.js';
78
+ export type { BiOSConfig, PaginatedResponse, ApiErrorBody, AvailableGpuAlternative, CapacityMinimumRequirement, InferenceBookingAccepted, Model, ModelSearchParams, ModelSearchResponse, ModelDetailResponse, ModelConfig, Dataset, DatasetListParams, DatasetListResponse, DatasetUploadParams, DatasetPreview, DatasetPreviewParams, DatasetImportHFParams, DatasetRegisterHFParams, DatasetHubSearchParams, DatasetHubPreviewParams, DatasetValidation, DatasetFormatVariant, DatasetFormatSpec, DatasetFormatSpecs, DatasetStorageUsage, TrainingMethod, RLHFAlgorithm, AdapterType, TrainingJobStatus, TrainingStatusFilter, TrainingCreateParams, TrainingListParams, TrainingListResponse, TrainingJob, TrainingMetrics, TrainingResourceMetrics, TrainingDeviceMetrics, MetricPoint, MetricGraphConfig, TrainingCheckpoint, TrainingLogs, TrainingLogEntry, TrainingStopResponse, TrainingResumeResponse, CanonicalTrainingRequest, TrainingPreflightDataset, TrainingPreflightWarning, TrainingPreflightResponse, TrainingCapabilityChoice, TrainingConfigFieldCapability, TrainingCapabilities, GPUChoice, WalletBalance, Transaction, TransactionListResponse, TransactionListParams, GPUInfo, GPUPricingResponse, GPUOptionsParams, 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, } from './types.js';
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.1-dev.114';
39
+ export const VERSION = '0.2.1-dev.116';
40
40
  export class RunBiOS {
41
41
  /** Search models, fetch configs, check adapter compatibility. */
42
42
  models;
@@ -1,5 +1,5 @@
1
1
  import type { HttpClient } from '../client.js';
2
- import type { LoopTrace, LoopTraceListResponse, LoopTraceListParams, LoopCaptureParams, LoopCaptureResult, LoopSignal, LoopSignalParams, LoopCandidate, LoopCandidateParams, LoopGrader, LoopGraderParams, LoopLabel, LoopLabelCount, LoopGradeResult, LoopDataset, LoopDatasetListParams, LoopDatasetItem, LoopDatasetCreateParams, LoopConfig, LoopConfigParams, LoopStats, LoopJudge, LoopJudgeParams, LoopJudgeRun, LoopJudgeWork, LoopJudgeVerdict, LoopJudgeVerdictResult } from '../types.js';
2
+ import type { LoopTrace, LoopTraceListResponse, LoopTraceListParams, LoopCaptureParams, LoopCaptureResult, LoopImportParams, LoopImportResult, LoopSignal, LoopSignalParams, LoopCandidate, LoopCandidateParams, LoopGrader, LoopGraderParams, LoopLabel, LoopLabelCount, LoopGradeResult, LoopDataset, LoopDatasetListParams, LoopDatasetItem, LoopDatasetCreateParams, LoopConfig, LoopConfigParams, LoopStats, LoopJudge, LoopJudgeParams, LoopJudgeRun, LoopJudgeWork, LoopJudgeVerdict, LoopJudgeVerdictResult } from '../types.js';
3
3
  /**
4
4
  * The Conscious Loop -- capture what your model was asked and answered, record
5
5
  * whether it was right, and turn those judgements into training data.
@@ -59,6 +59,33 @@ export declare class Loop {
59
59
  * your application.
60
60
  */
61
61
  capture(params: LoopCaptureParams): Promise<LoopCaptureResult>;
62
+ /**
63
+ * Bring data you already have into the loop.
64
+ *
65
+ * This does NOT create a training set. It creates conversations, in the same
66
+ * place captured ones live and subject to the same review, rules, judges and
67
+ * labels. A row becomes trainable when something says it is good, never
68
+ * because it arrived in a file -- which is the one guarantee that separates
69
+ * a corpus from a pile.
70
+ *
71
+ * Each row is read for what it actually is. A `prompt`/`chosen`/`rejected`
72
+ * triple becomes a preference pair; an answer plus a yes-or-no becomes a
73
+ * thumbs verdict; a question and an answer waits for review; a question with
74
+ * no answer waits for an answer; a paragraph of prose is refused, because it
75
+ * is not a conversation.
76
+ *
77
+ * A verdict that arrives *with* the file is kept -- discarding somebody's
78
+ * judgement would be worse -- but it is recorded as having come from your
79
+ * earlier process rather than from a reviewer here, and the conversation
80
+ * records that it was imported. Neither fact can be reconstructed later, so
81
+ * both are written at the door.
82
+ *
83
+ * `source` is required and becomes the id every imported conversation is
84
+ * filed under: "everything in one bucket called import" is a corpus nobody
85
+ * can slice afterwards. At most 5000 rows per call, because the call is
86
+ * synchronous and somebody is waiting on it.
87
+ */
88
+ importRows(params: LoopImportParams): Promise<LoopImportResult>;
62
89
  /** List captured conversations, newest first. */
63
90
  listTraces(params?: LoopTraceListParams): Promise<LoopTraceListResponse>;
64
91
  /** Read one conversation, with every verdict recorded on it. */
@@ -62,6 +62,35 @@ export class Loop {
62
62
  async capture(params) {
63
63
  return this._http.fetchPost('/api/loop/traces', params);
64
64
  }
65
+ /**
66
+ * Bring data you already have into the loop.
67
+ *
68
+ * This does NOT create a training set. It creates conversations, in the same
69
+ * place captured ones live and subject to the same review, rules, judges and
70
+ * labels. A row becomes trainable when something says it is good, never
71
+ * because it arrived in a file -- which is the one guarantee that separates
72
+ * a corpus from a pile.
73
+ *
74
+ * Each row is read for what it actually is. A `prompt`/`chosen`/`rejected`
75
+ * triple becomes a preference pair; an answer plus a yes-or-no becomes a
76
+ * thumbs verdict; a question and an answer waits for review; a question with
77
+ * no answer waits for an answer; a paragraph of prose is refused, because it
78
+ * is not a conversation.
79
+ *
80
+ * A verdict that arrives *with* the file is kept -- discarding somebody's
81
+ * judgement would be worse -- but it is recorded as having come from your
82
+ * earlier process rather than from a reviewer here, and the conversation
83
+ * records that it was imported. Neither fact can be reconstructed later, so
84
+ * both are written at the door.
85
+ *
86
+ * `source` is required and becomes the id every imported conversation is
87
+ * filed under: "everything in one bucket called import" is a corpus nobody
88
+ * can slice afterwards. At most 5000 rows per call, because the call is
89
+ * synchronous and somebody is waiting on it.
90
+ */
91
+ async importRows(params) {
92
+ return this._http.fetchPost('/api/loop/import', params);
93
+ }
65
94
  // ── traces ────────────────────────────────────────────────────────────
66
95
  /** List captured conversations, newest first. */
67
96
  async listTraces(params = {}) {
package/dist/types.d.ts CHANGED
@@ -759,12 +759,37 @@ export interface TrainingListResponse {
759
759
  limit: number;
760
760
  offset: number;
761
761
  }
762
+ export interface TrainingDeviceMetrics {
763
+ memory_used_mib: number | null;
764
+ memory_total_mib: number | null;
765
+ utilization_pct: number | null;
766
+ temperature_c: number | null;
767
+ }
768
+ export interface TrainingResourceMetrics {
769
+ scope: 'worker';
770
+ sampled_at: string | null;
771
+ received_at: string;
772
+ gpu_count: number | null;
773
+ gpu_memory_used_mib: number | null;
774
+ gpu_memory_total_mib: number | null;
775
+ gpu_utilization_pct: number | null;
776
+ gpu_temperature_c: number | null;
777
+ host_ram_used_gib: number | null;
778
+ host_ram_limit_gib: number | null;
779
+ host_ram_pct: number | null;
780
+ host_cpu_usage_pct: number | null;
781
+ host_cpu_limit_cores: number | null;
782
+ disk_used_gib: number | null;
783
+ disk_total_gib: number | null;
784
+ gpus: TrainingDeviceMetrics[];
785
+ }
762
786
  /** Training metrics for a job. */
763
787
  export interface TrainingMetrics {
764
788
  metrics: MetricPoint[];
765
789
  training_method?: string | null;
766
790
  rlhf_type?: string | null;
767
791
  graph_configs: MetricGraphConfig[];
792
+ resource_metrics?: TrainingResourceMetrics | null;
768
793
  /** @deprecated Use metrics. Populated as a compatibility alias. */
769
794
  steps?: MetricPoint[];
770
795
  }
@@ -921,6 +946,8 @@ export interface TrainingConfigFieldCapability {
921
946
  label: string;
922
947
  type: 'integer' | 'number' | 'boolean' | 'string' | 'string_array' | 'string_or_string_array' | 'object';
923
948
  default: unknown;
949
+ default_by_adapter?: Record<string, number>;
950
+ requires_step_horizon?: boolean;
924
951
  enabled: boolean;
925
952
  disabled_reason?: string;
926
953
  aliases?: string[];
@@ -2019,6 +2046,35 @@ export interface LoopCaptureResult {
2019
2046
  /** Why nothing was stored, e.g. `capture_disabled`, `not_sampled`. */
2020
2047
  reason?: string;
2021
2048
  }
2049
+ export interface LoopImportParams {
2050
+ /**
2051
+ * Where this came from. Required, and becomes the id every imported
2052
+ * conversation is filed under, so the import stays sliceable later.
2053
+ */
2054
+ source: string;
2055
+ /** The file, already parsed. At most 5000 rows per call. */
2056
+ rows: Record<string, unknown>[];
2057
+ /** Which model produced these, when the rows do not say per-row. */
2058
+ model?: string;
2059
+ /** Applied to every row: importing a dump is when somebody knows what it is. */
2060
+ labels?: string[];
2061
+ attributes?: Record<string, string>;
2062
+ }
2063
+ export interface LoopImportResult {
2064
+ imported: number;
2065
+ /**
2066
+ * How many arrived carrying a verdict. Reported apart from `imported`
2067
+ * because it is the difference between data you can train on and data
2068
+ * somebody still has to look at.
2069
+ */
2070
+ reviewed: number;
2071
+ needs_review: number;
2072
+ refused: number;
2073
+ /** How many rows of each recognised shape, so a mis-shaped file is visible. */
2074
+ by_shape: Record<string, number>;
2075
+ refused_why: Record<string, number>;
2076
+ notes: string[];
2077
+ }
2022
2078
  export interface LoopSignal {
2023
2079
  id: string;
2024
2080
  trace_id: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "runbios-sdk",
3
- "version": "0.2.1-dev.114",
3
+ "version": "0.2.1-dev.116",
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",
@@ -20,7 +20,7 @@
20
20
  ],
21
21
  "scripts": {
22
22
  "build": "tsc",
23
- "test": "npm run build && node --test test/contracts.test.mjs test/capacity-contract.test.mjs test/contract-drift.test.mjs test/inference-param-naming.test.mjs test/coming-soon.test.mjs",
23
+ "test": "npm run build && node --test \"test/*.test.mjs\"",
24
24
  "clean": "rm -rf dist",
25
25
  "prepack": "npm run clean && npm run build"
26
26
  },