trainfabric 0.1.40 → 0.1.42

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 +14 -2
  2. package/package.json +1 -1
package/dist/index.cjs CHANGED
@@ -8925,6 +8925,7 @@ var idPatterns = {
8925
8925
  supplier: /^[A-Za-z][A-Za-z0-9_-]*$/
8926
8926
  };
8927
8927
  var allowedBillingUnits = /* @__PURE__ */ new Set(["normalized_tflop_seconds", "reserved_gpu_seconds", "usd"]);
8928
+ var allowedApiKeyOwnerTypes = /* @__PURE__ */ new Set(["user", "service_account"]);
8928
8929
  function collectRuntimeFiles(repoPath) {
8929
8930
  const manifestFiles = /* @__PURE__ */ new Set([
8930
8931
  "training.yaml",
@@ -9162,6 +9163,13 @@ function normalizeOptionalBillingUnit(value) {
9162
9163
  }
9163
9164
  return unit;
9164
9165
  }
9166
+ function normalizeApiKeyOwnerType(value) {
9167
+ const ownerType = String(value ?? "").trim();
9168
+ if (!allowedApiKeyOwnerTypes.has(ownerType)) {
9169
+ throw new Error("Owner type is invalid. Use user or service_account.");
9170
+ }
9171
+ return ownerType;
9172
+ }
9165
9173
 
9166
9174
  // src/run_input.ts
9167
9175
  var BASE_MODEL_ALIASES = {
@@ -9180,6 +9188,7 @@ var PRECISION_MODES = /* @__PURE__ */ new Set(["fp16_bf16", "fp8", "fp32"]);
9180
9188
  var INTERCONNECT_TYPES = /* @__PURE__ */ new Set(["pcie", "nvlink"]);
9181
9189
  var BASE_MODELS = new Set(baseModels);
9182
9190
  var TRAINING_MODES = new Set(trainingModes);
9191
+ var MAX_MIN_GPU_MEMORY_GB = 192;
9183
9192
  function normalizePositiveInteger(value, label, fallback, max) {
9184
9193
  const parsed = Number(value ?? String(fallback));
9185
9194
  if (!Number.isInteger(parsed) || parsed <= 0) {
@@ -9266,6 +9275,9 @@ function buildComputeSpec(options) {
9266
9275
  compute.acceleratorClass = accelerator;
9267
9276
  }
9268
9277
  if (minMemory !== void 0) {
9278
+ if (minMemory > MAX_MIN_GPU_MEMORY_GB) {
9279
+ throw new Error(`Minimum GPU memory must be <= ${MAX_MIN_GPU_MEMORY_GB} GB.`);
9280
+ }
9269
9281
  compute.minGpuMemoryGb = minMemory;
9270
9282
  }
9271
9283
  if (precision) {
@@ -9279,7 +9291,7 @@ function buildComputeSpec(options) {
9279
9291
 
9280
9292
  // src/index.ts
9281
9293
  var DEFAULT_TRAINFABRIC_API_URL2 = "https://api.trainfabric.com";
9282
- var CLI_VERSION = "0.1.40";
9294
+ var CLI_VERSION = "0.1.42";
9283
9295
  var CONFIG_DIR = import_node_path3.default.join(import_node_os2.default.homedir(), ".trainfabric");
9284
9296
  var CONFIG_PATH = import_node_path3.default.join(CONFIG_DIR, "config.json");
9285
9297
  var FALLBACK_SECRET_PATH = import_node_path3.default.join(CONFIG_DIR, "session.enc");
@@ -10200,7 +10212,7 @@ program2.command("api-keys:create").requiredOption("--name <name>").option("--ow
10200
10212
  const session = await createClient(config).auth.me();
10201
10213
  const apiKey = await createClient(config).apiKeys.create({
10202
10214
  name: normalizeHumanName(options.name, "API key name"),
10203
- ownerType: options.ownerType,
10215
+ ownerType: normalizeApiKeyOwnerType(options.ownerType),
10204
10216
  ownerId: options.ownerId ?? session.user.id,
10205
10217
  scopes: parseApiKeyScopes(String(options.scopes))
10206
10218
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "trainfabric",
3
- "version": "0.1.40",
3
+ "version": "0.1.42",
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",