trainfabric 0.1.0 → 0.1.2

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/README.md CHANGED
@@ -11,13 +11,13 @@ npm install -g trainfabric
11
11
  ## Authenticate
12
12
 
13
13
  ```bash
14
- train login
14
+ trainfabric login
15
15
  ```
16
16
 
17
17
  For service-account flows:
18
18
 
19
19
  ```bash
20
- train config:set-api-key <api-key>
20
+ trainfabric config:set-api-key <api-key>
21
21
  ```
22
22
 
23
23
  Secrets are stored in macOS Keychain when available. Other platforms use an encrypted file under `~/.trainfabric` with restricted permissions.
@@ -25,18 +25,18 @@ Secrets are stored in macOS Keychain when available. Other platforms use an encr
25
25
  ## Run A Job
26
26
 
27
27
  ```bash
28
- train projects:list
29
- train datasets:upload ./train.jsonl --project <projectId>
30
- train runs:quote --summary --project <projectId> --dataset <datasetId> --model llama-3-8b
31
- train runs:create --yes --project <projectId> --dataset <datasetId> --model llama-3-8b
32
- train runs:watch <runId>
33
- train runs:cost-breakdown <runId> --summary
28
+ trainfabric projects:list
29
+ trainfabric datasets:upload ./train.jsonl --project <projectId>
30
+ trainfabric runs:quote --summary --project <projectId> --dataset <datasetId> --model llama-3-8b
31
+ trainfabric runs:create --yes --project <projectId> --dataset <datasetId> --model llama-3-8b
32
+ trainfabric runs:watch <runId>
33
+ trainfabric runs:cost-breakdown <runId> --summary
34
34
  ```
35
35
 
36
36
  The CLI defaults to `https://api.trainfabric.com`. Override with:
37
37
 
38
38
  ```bash
39
- train config:set-base-url https://your-api.example.com
39
+ trainfabric config:set-base-url https://your-api.example.com
40
40
  ```
41
41
 
42
42
  Pricing, supplier costs, and profitability are estimates unless invoice-grade supplier reconciliation is explicitly configured.
package/dist/index.cjs CHANGED
@@ -7738,6 +7738,9 @@ var serviceAccountCreateSchema = external_exports.object({
7738
7738
  scopes: external_exports.array(external_exports.enum(apiKeyScopes)).min(1)
7739
7739
  });
7740
7740
  var billingCheckoutSessionCreateSchema = external_exports.object({
7741
+ amountUsd: external_exports.number().positive().max(1e5).optional(),
7742
+ mode: external_exports.enum(["subscription", "credits"]).default("subscription"),
7743
+ planId: external_exports.enum(["hobby", "pro"]).optional(),
7741
7744
  priceId: external_exports.string().min(1).optional()
7742
7745
  });
7743
7746
  var treasuryCounterpartyCreateSchema = external_exports.object({
@@ -8887,6 +8890,7 @@ function buildComputeSpec(options) {
8887
8890
 
8888
8891
  // src/index.ts
8889
8892
  var DEFAULT_TRAINFABRIC_API_URL2 = "https://api.trainfabric.com";
8893
+ var CLI_VERSION = "0.1.2";
8890
8894
  var CONFIG_DIR = import_node_path3.default.join(import_node_os2.default.homedir(), ".trainfabric");
8891
8895
  var CONFIG_PATH = import_node_path3.default.join(CONFIG_DIR, "config.json");
8892
8896
  var FALLBACK_SECRET_PATH = import_node_path3.default.join(CONFIG_DIR, "session.enc");
@@ -9205,7 +9209,7 @@ async function login(config) {
9205
9209
  console.log(`Logged in as ${session.user.email} for organization ${config.orgId}.`);
9206
9210
  }
9207
9211
  var program2 = new Command();
9208
- program2.name("train").description("Trainfabric CLI for launching and monitoring GPU training jobs");
9212
+ program2.name("trainfabric").description("Trainfabric CLI for launching and monitoring GPU training jobs").version(CLI_VERSION);
9209
9213
  program2.command("login").description("Authenticate in the browser and store CLI credentials").action(async () => {
9210
9214
  await login(loadConfig());
9211
9215
  });
@@ -9294,7 +9298,7 @@ program2.command("datasets:upload").argument("<file>").option("--project <projec
9294
9298
  });
9295
9299
  program2.command("runs:create").requiredOption("--project <projectId>").requiredOption("--dataset <datasetId>").requiredOption("--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", "balanced").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) => {
9296
9300
  if (!options.yes) {
9297
- throw new Error("Refusing to launch without explicit cost acceptance. Run `train runs:quote --summary ...` first, then rerun `runs:create` with --yes.");
9301
+ throw new Error("Refusing to launch without explicit cost acceptance. Run `trainfabric runs:quote --summary ...` first, then rerun `runs:create` with --yes.");
9298
9302
  }
9299
9303
  const client = createClient(loadConfig());
9300
9304
  const run = await client.runs.create(buildRunInput(options));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "trainfabric",
3
- "version": "0.1.0",
3
+ "version": "0.1.2",
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",
@@ -8,10 +8,10 @@
8
8
  "dist/index.cjs"
9
9
  ],
10
10
  "bin": {
11
- "train": "dist/index.cjs"
11
+ "trainfabric": "dist/index.cjs"
12
12
  },
13
13
  "scripts": {
14
- "build": "node -e \"require('fs').rmSync('dist',{recursive:true,force:true})\" && tsc -p tsconfig.json && esbuild src/index.ts --bundle --platform=node --format=cjs --target=node20 --outfile=dist/index.cjs",
14
+ "build": "node -e \"require('fs').rmSync('dist',{recursive:true,force:true})\" && tsc -p tsconfig.json && esbuild src/index.ts --bundle --platform=node --format=cjs --target=node20 --define:process.env.TRAINFABRIC_CLI_VERSION='\"'$(node -p \"require('./package.json').version\")'\"' --outfile=dist/index.cjs",
15
15
  "dev": "tsx src/index.ts",
16
16
  "lint": "tsc -p tsconfig.json --noEmit",
17
17
  "proof:integration": "vitest run tests/local_stack.integration.test.ts",