trainfabric 0.1.1 → 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 +9 -9
- package/dist/index.cjs +6 -3
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -11,13 +11,13 @@ npm install -g trainfabric
|
|
|
11
11
|
## Authenticate
|
|
12
12
|
|
|
13
13
|
```bash
|
|
14
|
-
|
|
14
|
+
trainfabric login
|
|
15
15
|
```
|
|
16
16
|
|
|
17
17
|
For service-account flows:
|
|
18
18
|
|
|
19
19
|
```bash
|
|
20
|
-
|
|
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
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
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
|
-
|
|
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,7 +8890,7 @@ function buildComputeSpec(options) {
|
|
|
8887
8890
|
|
|
8888
8891
|
// src/index.ts
|
|
8889
8892
|
var DEFAULT_TRAINFABRIC_API_URL2 = "https://api.trainfabric.com";
|
|
8890
|
-
var CLI_VERSION = "0.1.
|
|
8893
|
+
var CLI_VERSION = "0.1.2";
|
|
8891
8894
|
var CONFIG_DIR = import_node_path3.default.join(import_node_os2.default.homedir(), ".trainfabric");
|
|
8892
8895
|
var CONFIG_PATH = import_node_path3.default.join(CONFIG_DIR, "config.json");
|
|
8893
8896
|
var FALLBACK_SECRET_PATH = import_node_path3.default.join(CONFIG_DIR, "session.enc");
|
|
@@ -9206,7 +9209,7 @@ async function login(config) {
|
|
|
9206
9209
|
console.log(`Logged in as ${session.user.email} for organization ${config.orgId}.`);
|
|
9207
9210
|
}
|
|
9208
9211
|
var program2 = new Command();
|
|
9209
|
-
program2.name("
|
|
9212
|
+
program2.name("trainfabric").description("Trainfabric CLI for launching and monitoring GPU training jobs").version(CLI_VERSION);
|
|
9210
9213
|
program2.command("login").description("Authenticate in the browser and store CLI credentials").action(async () => {
|
|
9211
9214
|
await login(loadConfig());
|
|
9212
9215
|
});
|
|
@@ -9295,7 +9298,7 @@ program2.command("datasets:upload").argument("<file>").option("--project <projec
|
|
|
9295
9298
|
});
|
|
9296
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) => {
|
|
9297
9300
|
if (!options.yes) {
|
|
9298
|
-
throw new Error("Refusing to launch without explicit cost acceptance. Run `
|
|
9301
|
+
throw new Error("Refusing to launch without explicit cost acceptance. Run `trainfabric runs:quote --summary ...` first, then rerun `runs:create` with --yes.");
|
|
9299
9302
|
}
|
|
9300
9303
|
const client = createClient(loadConfig());
|
|
9301
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.
|
|
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,7 +8,7 @@
|
|
|
8
8
|
"dist/index.cjs"
|
|
9
9
|
],
|
|
10
10
|
"bin": {
|
|
11
|
-
"
|
|
11
|
+
"trainfabric": "dist/index.cjs"
|
|
12
12
|
},
|
|
13
13
|
"scripts": {
|
|
14
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",
|