trainfabric 0.1.43 → 0.1.45
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.cjs +37 -5
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -7526,6 +7526,25 @@ var NEVER = INVALID;
|
|
|
7526
7526
|
var experimentProviderIds = ["mlflow"];
|
|
7527
7527
|
var experimentTrackingModes = ["online", "offline"];
|
|
7528
7528
|
var baseModels = ["llama-3-8b", "mistral-7b", "qwen-2.5-7b"];
|
|
7529
|
+
var runStatuses = [
|
|
7530
|
+
"draft",
|
|
7531
|
+
"validating",
|
|
7532
|
+
"queued",
|
|
7533
|
+
"awaiting_capacity",
|
|
7534
|
+
"scheduled",
|
|
7535
|
+
"provisioning",
|
|
7536
|
+
"launching",
|
|
7537
|
+
"starting",
|
|
7538
|
+
"running",
|
|
7539
|
+
"checkpointing",
|
|
7540
|
+
"evaluating",
|
|
7541
|
+
"completed",
|
|
7542
|
+
"failed",
|
|
7543
|
+
"canceled",
|
|
7544
|
+
"resuming",
|
|
7545
|
+
"paused",
|
|
7546
|
+
"terminated"
|
|
7547
|
+
];
|
|
7529
7548
|
var organizationRoles = ["owner", "admin", "member", "billing"];
|
|
7530
7549
|
var apiKeyScopes = [
|
|
7531
7550
|
"org:read",
|
|
@@ -9291,7 +9310,7 @@ function buildComputeSpec(options) {
|
|
|
9291
9310
|
|
|
9292
9311
|
// src/index.ts
|
|
9293
9312
|
var DEFAULT_TRAINFABRIC_API_URL2 = "https://api.trainfabric.com";
|
|
9294
|
-
var CLI_VERSION = "0.1.
|
|
9313
|
+
var CLI_VERSION = "0.1.45";
|
|
9295
9314
|
var CONFIG_DIR = import_node_path3.default.join(import_node_os2.default.homedir(), ".trainfabric");
|
|
9296
9315
|
var CONFIG_PATH = import_node_path3.default.join(CONFIG_DIR, "config.json");
|
|
9297
9316
|
var FALLBACK_SECRET_PATH = import_node_path3.default.join(CONFIG_DIR, "session.enc");
|
|
@@ -9667,6 +9686,16 @@ function requireProjectId(options, config) {
|
|
|
9667
9686
|
}
|
|
9668
9687
|
return projectId;
|
|
9669
9688
|
}
|
|
9689
|
+
function normalizeRunStatusFilter(status) {
|
|
9690
|
+
if (status === void 0) {
|
|
9691
|
+
return void 0;
|
|
9692
|
+
}
|
|
9693
|
+
const normalized = String(status).trim().toLowerCase();
|
|
9694
|
+
if (!runStatuses.includes(normalized)) {
|
|
9695
|
+
throw new Error(`Run status is invalid. Use one of: ${runStatuses.join(", ")}.`);
|
|
9696
|
+
}
|
|
9697
|
+
return normalized;
|
|
9698
|
+
}
|
|
9670
9699
|
function optionWasProvided(command, optionName) {
|
|
9671
9700
|
return command.getOptionValueSource(optionName) === "cli";
|
|
9672
9701
|
}
|
|
@@ -9675,6 +9704,7 @@ function assertQuoteCreateHasNoLaunchOverrides(options, command) {
|
|
|
9675
9704
|
return;
|
|
9676
9705
|
}
|
|
9677
9706
|
const launchShapingOptions = [
|
|
9707
|
+
["project", "--project"],
|
|
9678
9708
|
["dataset", "--dataset"],
|
|
9679
9709
|
["model", "--model"],
|
|
9680
9710
|
["eval", "--eval"],
|
|
@@ -9696,7 +9726,7 @@ function assertQuoteCreateHasNoLaunchOverrides(options, command) {
|
|
|
9696
9726
|
throw new Error(
|
|
9697
9727
|
`Do not combine --quote with launch-shaping flags (${provided.join(
|
|
9698
9728
|
", "
|
|
9699
|
-
)}). The accepted quote already locks dataset, model, compute, mode, source, and hyperparameters. Request a new quote for different launch settings.`
|
|
9729
|
+
)}). The accepted quote already locks project, dataset, model, compute, mode, source, and hyperparameters. Request a new quote for different launch settings.`
|
|
9700
9730
|
);
|
|
9701
9731
|
}
|
|
9702
9732
|
}
|
|
@@ -10052,7 +10082,7 @@ program2.command("datasets:upload").argument("<file>").option("--project <projec
|
|
|
10052
10082
|
});
|
|
10053
10083
|
printJson(dataset);
|
|
10054
10084
|
});
|
|
10055
|
-
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, command) => {
|
|
10085
|
+
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) => {
|
|
10056
10086
|
const config = loadConfig();
|
|
10057
10087
|
assertQuoteCreateHasNoLaunchOverrides(options, command);
|
|
10058
10088
|
const runInput = buildRunInput(options, config);
|
|
@@ -10112,8 +10142,10 @@ program2.command("runs:quote").option("--project <projectId>").requiredOption("-
|
|
|
10112
10142
|
printJson(redactInlineSource(bundle));
|
|
10113
10143
|
}
|
|
10114
10144
|
});
|
|
10115
|
-
program2.command("runs:list").option("--project <projectId>").description("List runs").action(async (options) => {
|
|
10116
|
-
|
|
10145
|
+
program2.command("runs:list").option("--project <projectId>").option("--status <status>", "filter by run status").option("--json", "print raw JSON output; this is the default").description("List runs").action(async (options) => {
|
|
10146
|
+
const status = normalizeRunStatusFilter(options.status);
|
|
10147
|
+
const runs = await createClient(loadConfig()).runs.list(normalizeOptionalId(options.project, "project", "Project ID"));
|
|
10148
|
+
printJson(status ? runs.filter((run) => run.status === status) : runs);
|
|
10117
10149
|
});
|
|
10118
10150
|
program2.command("runs:status").argument("<runId>").description("Fetch full run detail").action(async (runId) => {
|
|
10119
10151
|
const detail = await createClient(loadConfig()).runs.get(normalizeId(runId, "run", "Run ID"));
|