trainfabric 0.1.33 → 0.1.34

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.
Files changed (2) hide show
  1. package/dist/index.cjs +7 -4
  2. package/package.json +1 -1
package/dist/index.cjs CHANGED
@@ -9156,11 +9156,14 @@ var PRECISION_MODES = /* @__PURE__ */ new Set(["fp16_bf16", "fp8", "fp32"]);
9156
9156
  var INTERCONNECT_TYPES = /* @__PURE__ */ new Set(["pcie", "nvlink"]);
9157
9157
  var BASE_MODELS = new Set(baseModels);
9158
9158
  var TRAINING_MODES = new Set(trainingModes);
9159
- function normalizePositiveInteger(value, label, fallback) {
9159
+ function normalizePositiveInteger(value, label, fallback, max) {
9160
9160
  const parsed = Number(value ?? String(fallback));
9161
9161
  if (!Number.isInteger(parsed) || parsed <= 0) {
9162
9162
  throw new Error(`${label} must be a positive integer.`);
9163
9163
  }
9164
+ if (max !== void 0 && parsed > max) {
9165
+ throw new Error(`${label} must be between 1 and ${max}.`);
9166
+ }
9164
9167
  return parsed;
9165
9168
  }
9166
9169
  function normalizeOptionalPositiveNumber(value, label) {
@@ -9215,8 +9218,8 @@ function normalizeLearningRate(lr) {
9215
9218
  return parsed;
9216
9219
  }
9217
9220
  function buildComputeSpec(options) {
9218
- const gpuCount = normalizePositiveInteger(options.gpus, "GPU count", 1);
9219
- const nodeCount = normalizePositiveInteger(options.nodes, "Node count", 1);
9221
+ const gpuCount = normalizePositiveInteger(options.gpus, "GPU count", 1, 64);
9222
+ const nodeCount = normalizePositiveInteger(options.nodes, "Node count", 1, 16);
9220
9223
  if (nodeCount > gpuCount) {
9221
9224
  throw new Error("Node count cannot exceed GPU count. Request at least one GPU per node.");
9222
9225
  }
@@ -9252,7 +9255,7 @@ function buildComputeSpec(options) {
9252
9255
 
9253
9256
  // src/index.ts
9254
9257
  var DEFAULT_TRAINFABRIC_API_URL2 = "https://api.trainfabric.com";
9255
- var CLI_VERSION = "0.1.33";
9258
+ var CLI_VERSION = "0.1.34";
9256
9259
  var CONFIG_DIR = import_node_path3.default.join(import_node_os2.default.homedir(), ".trainfabric");
9257
9260
  var CONFIG_PATH = import_node_path3.default.join(CONFIG_DIR, "config.json");
9258
9261
  var FALLBACK_SECRET_PATH = import_node_path3.default.join(CONFIG_DIR, "session.enc");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "trainfabric",
3
- "version": "0.1.33",
3
+ "version": "0.1.34",
4
4
  "description": "Trainfabric CLI for launching GPU training jobs on the hosted Trainfabric backend.",
5
5
  "type": "module",
6
6
  "main": "dist/index.cjs",