trainfabric 0.1.33 → 0.1.35

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 +15 -9
  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.35";
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");
@@ -9973,10 +9976,12 @@ program2.command("runtime:detect").option("--project <projectId>").option("--rep
9973
9976
  program2.command("runtime:build").option("--project <projectId>").requiredOption("--detection <detectionId>").description("Build or reuse a cached runtime image from a runtime detection").action(async (options) => {
9974
9977
  const config = loadConfig();
9975
9978
  printJson(
9976
- await createClient(config).runtime.build({
9977
- projectId: requireProjectId(options, config),
9978
- detectionId: normalizeId(options.detection, "detection", "Runtime detection ID")
9979
- })
9979
+ redactInlineSource(
9980
+ await createClient(config).runtime.build({
9981
+ projectId: requireProjectId(options, config),
9982
+ detectionId: normalizeId(options.detection, "detection", "Runtime detection ID")
9983
+ })
9984
+ )
9980
9985
  );
9981
9986
  });
9982
9987
  program2.command("runs:quote").option("--project <projectId>").requiredOption("--dataset <datasetId>").requiredOption("--model <baseModel>").option("--eval <evalDatasetId>").option("--gpus <gpuCount>", "gpu count", "1").option("--nodes <nodeCount>", "node count", "1").option("--accelerator <acceleratorClass>", "optional hard accelerator constraint (for example: a10g, a100, h100)").option("--min-memory <gigabytes>", "minimum GPU memory in GB").option("--precision <precision>", "fp16_bf16, fp8, or fp32").option("--interconnect <interconnect>", "pcie or nvlink").option("--mode <mode>", "efficient, balanced, or power").option("--repo <path>").option("--git <url>").option("--branch <branch>").option("--summary", "print a human-readable price summary instead of raw JSON").description("Preview Efficient, Balanced, and Power launch options").action(async (options) => {
@@ -9996,7 +10001,8 @@ program2.command("runs:list").option("--project <projectId>").description("List
9996
10001
  printJson(await createClient(loadConfig()).runs.list(normalizeOptionalId(options.project, "project", "Project ID")));
9997
10002
  });
9998
10003
  program2.command("runs:status").argument("<runId>").description("Fetch full run detail").action(async (runId) => {
9999
- printJson(await createClient(loadConfig()).runs.get(normalizeId(runId, "run", "Run ID")));
10004
+ const detail = await createClient(loadConfig()).runs.get(normalizeId(runId, "run", "Run ID"));
10005
+ printJson({ ...detail, ...detail.run });
10000
10006
  });
10001
10007
  program2.command("runs:logs").argument("<runId>").description("Fetch run logs").action(async (runId) => {
10002
10008
  printJson(await createClient(loadConfig()).runs.logs(normalizeId(runId, "run", "Run ID")));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "trainfabric",
3
- "version": "0.1.33",
3
+ "version": "0.1.35",
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",