trainfabric 0.1.42 → 0.1.44

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 +37 -2
  2. package/package.json +1 -1
package/dist/index.cjs CHANGED
@@ -9291,7 +9291,7 @@ function buildComputeSpec(options) {
9291
9291
 
9292
9292
  // src/index.ts
9293
9293
  var DEFAULT_TRAINFABRIC_API_URL2 = "https://api.trainfabric.com";
9294
- var CLI_VERSION = "0.1.42";
9294
+ var CLI_VERSION = "0.1.44";
9295
9295
  var CONFIG_DIR = import_node_path3.default.join(import_node_os2.default.homedir(), ".trainfabric");
9296
9296
  var CONFIG_PATH = import_node_path3.default.join(CONFIG_DIR, "config.json");
9297
9297
  var FALLBACK_SECRET_PATH = import_node_path3.default.join(CONFIG_DIR, "session.enc");
@@ -9667,6 +9667,40 @@ function requireProjectId(options, config) {
9667
9667
  }
9668
9668
  return projectId;
9669
9669
  }
9670
+ function optionWasProvided(command, optionName) {
9671
+ return command.getOptionValueSource(optionName) === "cli";
9672
+ }
9673
+ function assertQuoteCreateHasNoLaunchOverrides(options, command) {
9674
+ if (!options.quote) {
9675
+ return;
9676
+ }
9677
+ const launchShapingOptions = [
9678
+ ["project", "--project"],
9679
+ ["dataset", "--dataset"],
9680
+ ["model", "--model"],
9681
+ ["eval", "--eval"],
9682
+ ["epochs", "--epochs"],
9683
+ ["lr", "--lr"],
9684
+ ["gpus", "--gpus"],
9685
+ ["nodes", "--nodes"],
9686
+ ["accelerator", "--accelerator"],
9687
+ ["minMemory", "--min-memory"],
9688
+ ["precision", "--precision"],
9689
+ ["interconnect", "--interconnect"],
9690
+ ["mode", "--mode"],
9691
+ ["repo", "--repo"],
9692
+ ["git", "--git"],
9693
+ ["branch", "--branch"]
9694
+ ];
9695
+ const provided = launchShapingOptions.filter(([name]) => optionWasProvided(command, name)).map(([, flag]) => flag);
9696
+ if (provided.length > 0) {
9697
+ throw new Error(
9698
+ `Do not combine --quote with launch-shaping flags (${provided.join(
9699
+ ", "
9700
+ )}). The accepted quote already locks project, dataset, model, compute, mode, source, and hyperparameters. Request a new quote for different launch settings.`
9701
+ );
9702
+ }
9703
+ }
9670
9704
  function buildRunInput(options, config = loadConfig()) {
9671
9705
  const sourceOptions = buildSourceOptions(options);
9672
9706
  const quoteId = options.quote === void 0 ? void 0 : normalizeId(options.quote, "quote", "Pricing quote ID");
@@ -10019,8 +10053,9 @@ program2.command("datasets:upload").argument("<file>").option("--project <projec
10019
10053
  });
10020
10054
  printJson(dataset);
10021
10055
  });
10022
- program2.command("runs:create").option("--project <projectId>").option("--dataset <datasetId>").option("--model <baseModel>").option("--eval <evalDatasetId>").option("--epochs <epochs>", "number of epochs", "3").option("--lr <lr>", "learning rate", "0.0002").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("--quote <pricingQuoteId>", "launch the exact accepted quote id from runs:quote").option("--repo <path>", "local repo path for runtime autodetect").option("--git <url>", "git repo URL for runtime metadata").option("--branch <branch>", "git branch for runtime metadata").option("--yes", "confirm that you reviewed pricing with runs:quote --summary and accept fluctuating realized usage").description("Create a training run").action(async (options) => {
10056
+ program2.command("runs:create").option("--project <projectId>").option("--dataset <datasetId>").option("--model <baseModel>").option("--eval <evalDatasetId>").option("--epochs <epochs>", "number of epochs", "3").option("--lr <lr>", "learning rate", "0.0002").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("--quote <pricingQuoteId>", "launch the exact accepted quote id from runs:quote; use only with --yes").option("--repo <path>", "local repo path for runtime autodetect").option("--git <url>", "git repo URL for runtime metadata").option("--branch <branch>", "git branch for runtime metadata").option("--yes", "confirm that you reviewed pricing with runs:quote --summary and accept fluctuating realized usage").description("Create a training run. When using --quote, do not pass project, dataset, model, compute, mode, source, or hyperparameter flags; launch with `trainfabric runs:create --quote <quoteId> --yes`.").action(async (options, command) => {
10023
10057
  const config = loadConfig();
10058
+ assertQuoteCreateHasNoLaunchOverrides(options, command);
10024
10059
  const runInput = buildRunInput(options, config);
10025
10060
  if (!options.yes) {
10026
10061
  throw new Error("Refusing to launch without explicit cost acceptance. Run `trainfabric runs:quote --summary ...` first, then rerun `runs:create` with --yes.");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "trainfabric",
3
- "version": "0.1.42",
3
+ "version": "0.1.44",
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",