@tuned-tensor/cli 0.15.0 → 0.16.0
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 +110 -42
- package/dist/{chunk-YGN26POJ.js → chunk-6RLNBTM6.js} +377 -99
- package/dist/chunk-6RLNBTM6.js.map +1 -0
- package/dist/index.js +58 -142
- package/dist/index.js.map +1 -1
- package/dist/local-runtime.js +143 -32
- package/dist/local-runtime.js.map +1 -1
- package/docs/local-runtime/architecture.md +17 -6
- package/docs/local-runtime/aws-gpu.md +131 -0
- package/docs/local-runtime/foundation-long-runs.md +21 -5
- package/docs/local-runtime/serving.md +11 -1
- package/examples/local-runtime/aws-runner.json +13 -0
- package/package.json +9 -6
- package/training/adapter/src/foundation_export.py +81 -0
- package/training/adapter/src/serve.py +12 -5
- package/training/adapter/src/train.py +4 -0
- package/training/foundation/pyproject.toml +4 -0
- package/training/foundation/src/model.py +2 -0
- package/training/foundation/uv.lock +225 -0
- package/dist/chunk-YGN26POJ.js.map +0 -1
package/dist/index.js
CHANGED
|
@@ -23,12 +23,13 @@ import {
|
|
|
23
23
|
parseLocalRunInput,
|
|
24
24
|
parseLocalRunnerConfig,
|
|
25
25
|
readHardwareSnapshot,
|
|
26
|
+
runGpuProcess,
|
|
26
27
|
runLocalPipeline,
|
|
27
28
|
runLoggedProcess,
|
|
28
29
|
runReportSchema,
|
|
29
30
|
warningsFromSnapshot,
|
|
30
31
|
withFoundationPythonEnvironment
|
|
31
|
-
} from "./chunk-
|
|
32
|
+
} from "./chunk-6RLNBTM6.js";
|
|
32
33
|
|
|
33
34
|
// src/cli.ts
|
|
34
35
|
import { spawn as spawn4 } from "child_process";
|
|
@@ -1971,7 +1972,7 @@ function createTunedTensorTools(api, options = {}) {
|
|
|
1971
1972
|
return {
|
|
1972
1973
|
version: 1,
|
|
1973
1974
|
engine,
|
|
1974
|
-
scope: { execution: "local
|
|
1975
|
+
scope: { execution: "local", gpu_provider: "aws" },
|
|
1975
1976
|
canonical: canonicalFoundationPipeline2(),
|
|
1976
1977
|
optional_rl: {
|
|
1977
1978
|
enabled_when: "foundation.rl_steps > 0",
|
|
@@ -1991,17 +1992,13 @@ function createTunedTensorTools(api, options = {}) {
|
|
|
1991
1992
|
return {
|
|
1992
1993
|
version: 1,
|
|
1993
1994
|
engine,
|
|
1994
|
-
scope: { execution: "
|
|
1995
|
-
canonical: canonicalPipeline("
|
|
1995
|
+
scope: { execution: "local", gpu_provider: "aws", access_token_required: false },
|
|
1996
|
+
canonical: canonicalPipeline("local"),
|
|
1996
1997
|
commands: {
|
|
1997
|
-
|
|
1998
|
-
|
|
1999
|
-
estimate: "tt cloud runs estimate <spec-id>",
|
|
2000
|
-
run: "tt cloud runs start <spec-id>",
|
|
2001
|
-
watch: "tt cloud runs watch <run-id>",
|
|
2002
|
-
report: "tt cloud runs report <run-id>"
|
|
1998
|
+
run: "tt pipeline run --file tunedtensor.pipeline.json --spec tunedtensor.json --config local-runner.json",
|
|
1999
|
+
doctor: "tt doctor --config local-runner.json"
|
|
2003
2000
|
},
|
|
2004
|
-
note: "
|
|
2001
|
+
note: "Configure gpu in local-runner.json with provider aws, instanceId, SSH user and optional AWS profile/region/identityFile. The instance must already be running and reachable. GPU processes use it automatically; orchestration, scoring and artifacts stay local. Hosted training is retired."
|
|
2005
2002
|
};
|
|
2006
2003
|
}
|
|
2007
2004
|
return {
|
|
@@ -2184,7 +2181,7 @@ Mutation tools only prepare proposals. Never claim a proposed mutation happened.
|
|
|
2184
2181
|
Do not request or reveal Tuned Tensor or model-provider credentials. You have no shell, upload, delete, top-up, API-key, watch, or serving tools.`;
|
|
2185
2182
|
async function systemPrompt(cloudEnabled) {
|
|
2186
2183
|
const host = formatAgentHostBlock(await readHardwareSnapshot());
|
|
2187
|
-
const account = cloudEnabled ? "Account tools inspect cloud specs, runs, models, balance, transactions, and managed agent usage. Cloud spec mutations only prepare proposals for /approve;
|
|
2184
|
+
const account = cloudEnabled ? "Account tools inspect cloud specs, runs, models, balance, transactions, and managed agent usage. Cloud spec mutations only prepare proposals for /approve; training uses `tt pipeline run` with optional user-owned AWS GPU configuration. Hosted training submission is retired. Never confuse cloud resources with local resources." : "No TT access token is configured, so account and cloud tools are unavailable. The user can run `tt auth login` or /login tunedtensor to enable them.";
|
|
2188
2185
|
return `${SYSTEM_PROMPT}
|
|
2189
2186
|
${account}
|
|
2190
2187
|
You have no general filesystem tools. Workspace-scoped capabilities can prepare one new validated spec folder or a sealed local pipeline dry-run; both still require /approve.
|
|
@@ -2762,8 +2759,8 @@ var COMMAND_CATALOG = [
|
|
|
2762
2759
|
{ path: "cloud label cancel", description: "Cancel a labeling job and release unused credits", group: "Cloud", modes: LOCAL },
|
|
2763
2760
|
{ path: "cloud runs list", description: "List runs", group: "Cloud", modes: LOCAL },
|
|
2764
2761
|
{ path: "cloud runs get", description: "Show run details and eval results", group: "Cloud", modes: LOCAL },
|
|
2765
|
-
{ path: "cloud runs estimate", description: "
|
|
2766
|
-
{ path: "cloud runs start", description: "
|
|
2762
|
+
{ path: "cloud runs estimate", description: "Retired: use the local pipeline with your own AWS GPU", group: "Cloud", modes: LOCAL },
|
|
2763
|
+
{ path: "cloud runs start", description: "Retired: use the local pipeline with your own AWS GPU", group: "Cloud", modes: LOCAL },
|
|
2767
2764
|
{ path: "cloud runs cancel", description: "Cancel a running run", group: "Cloud", modes: LOCAL },
|
|
2768
2765
|
{ path: "cloud runs watch", description: "Watch a run until it completes", group: "Cloud", modes: LOCAL },
|
|
2769
2766
|
{ path: "cloud runs diagnose", description: "Show live run diagnostics", group: "Cloud", modes: LOCAL },
|
|
@@ -3164,7 +3161,11 @@ async function loginAgentProvider(runtime, provider, apiKey, options = {}) {
|
|
|
3164
3161
|
throw new Error("API key cannot be empty.");
|
|
3165
3162
|
}
|
|
3166
3163
|
if (choice.id === MANAGED_AGENT_PROVIDER) {
|
|
3167
|
-
updateConfig({
|
|
3164
|
+
updateConfig({
|
|
3165
|
+
api_key: validateAccessToken(key),
|
|
3166
|
+
base_url: getBaseUrl(options),
|
|
3167
|
+
agent: { ...MANAGED_AGENT_SELECTION }
|
|
3168
|
+
});
|
|
3168
3169
|
} else {
|
|
3169
3170
|
persistProviderApiKey(choice.id, key);
|
|
3170
3171
|
}
|
|
@@ -3877,7 +3878,7 @@ var TunedTensorShellSession = class _TunedTensorShellSession {
|
|
|
3877
3878
|
});
|
|
3878
3879
|
await this.refreshContext();
|
|
3879
3880
|
this.io.write(
|
|
3880
|
-
result2.provider === MANAGED_AGENT_PROVIDER ? `${successMark()} TT access token saved for managed inference and cloud operations.
|
|
3881
|
+
result2.provider === MANAGED_AGENT_PROVIDER ? `${successMark()} TT access token saved for managed inference and cloud operations. Agent model saved: tunedtensor/managed.
|
|
3881
3882
|
` : `${successMark()} Saved ${result2.provider} credentials. Chat and /model can use this provider now.
|
|
3882
3883
|
`
|
|
3883
3884
|
);
|
|
@@ -5166,7 +5167,7 @@ function renderHardware(value) {
|
|
|
5166
5167
|
);
|
|
5167
5168
|
if (foundation) {
|
|
5168
5169
|
printDetail([
|
|
5169
|
-
["Foundation serve", text(record3(foundation.serve)?.reason) ?? "
|
|
5170
|
+
["Foundation serve", text(record3(foundation.serve)?.reason) ?? "unknown"]
|
|
5170
5171
|
]);
|
|
5171
5172
|
}
|
|
5172
5173
|
const notes = Array.isArray(capabilities?.notes) ? capabilities.notes.filter((note) => typeof note === "string") : [];
|
|
@@ -6017,7 +6018,27 @@ function assertFoundationPlanSupported(spec, plan) {
|
|
|
6017
6018
|
}
|
|
6018
6019
|
async function defaultFoundationSpawn(args2) {
|
|
6019
6020
|
const launched = buildFoundationPythonCommand(args2.entrypoint, ["--config", args2.configPath]);
|
|
6020
|
-
const
|
|
6021
|
+
const execute = args2.gpu && args2.entrypoint !== "train_tokenizer.py" ? async (processArgs) => {
|
|
6022
|
+
const document = await readRequiredJsonObject(args2.configPath, "Foundation GPU config");
|
|
6023
|
+
const files = [{ path: args2.configPath, direction: "input" }];
|
|
6024
|
+
const pathKeys = ["tokenizer_dir", "model_dir", "corpus_path", "validation_path", "output_dir", "work_dir", "checkpoint_backup_dir"];
|
|
6025
|
+
for (const key of pathKeys) {
|
|
6026
|
+
if (typeof document[key] !== "string") continue;
|
|
6027
|
+
files.push({
|
|
6028
|
+
path: document[key],
|
|
6029
|
+
direction: ["output_dir", "work_dir", "checkpoint_backup_dir"].includes(key) ? "both" : "input",
|
|
6030
|
+
directory: key.endsWith("_dir") || (await lstat4(document[key])).isDirectory()
|
|
6031
|
+
});
|
|
6032
|
+
}
|
|
6033
|
+
return runGpuProcess({
|
|
6034
|
+
...processArgs,
|
|
6035
|
+
gpu: args2.gpu,
|
|
6036
|
+
runtime: "foundation",
|
|
6037
|
+
files,
|
|
6038
|
+
document: { path: args2.configPath, value: document, pathKeys }
|
|
6039
|
+
});
|
|
6040
|
+
} : runLoggedProcess;
|
|
6041
|
+
const result2 = await execute({
|
|
6021
6042
|
command: launched.command,
|
|
6022
6043
|
commandArgs: launched.commandArgs,
|
|
6023
6044
|
env: withFoundationPythonEnvironment(process.env),
|
|
@@ -6038,6 +6059,9 @@ async function runFoundationPipeline(args2) {
|
|
|
6038
6059
|
const outputDir = resolve5(
|
|
6039
6060
|
args2.outputDir ?? join8(dirname5(resolve5(args2.specPath)), DEFAULT_FOUNDATION_RUNS_DIR, randomUUID6())
|
|
6040
6061
|
);
|
|
6062
|
+
if (args2.gpu && args2.spec.foundation.checkpoint_backup_dir && localPathsOverlap(outputDir, args2.spec.foundation.checkpoint_backup_dir)) {
|
|
6063
|
+
throw new Error("AWS checkpoint_backup_dir must be separate from the foundation run directory; overlapping backups can overwrite returned checkpoints.");
|
|
6064
|
+
}
|
|
6041
6065
|
let outputExists = false;
|
|
6042
6066
|
try {
|
|
6043
6067
|
const outputInfo = await lstat4(outputDir);
|
|
@@ -6199,7 +6223,7 @@ async function runFoundationPipeline(args2) {
|
|
|
6199
6223
|
if (!completedStep) {
|
|
6200
6224
|
await writePrivateTextAtomic(configPath2, `${JSON.stringify(config, null, 2)}
|
|
6201
6225
|
`);
|
|
6202
|
-
await spawnStep({ entrypoint, configPath: configPath2, logPath, stepId: step.id });
|
|
6226
|
+
await spawnStep({ entrypoint, configPath: configPath2, logPath, stepId: step.id, ...args2.gpu ? { gpu: args2.gpu } : {} });
|
|
6203
6227
|
upstreamExecuted = true;
|
|
6204
6228
|
}
|
|
6205
6229
|
await makePrivateTree(stepDir);
|
|
@@ -6435,24 +6459,27 @@ function registerPipelineCommands(parent) {
|
|
|
6435
6459
|
if (options.output && options.resume) {
|
|
6436
6460
|
throw new Error("--output and --resume are mutually exclusive.");
|
|
6437
6461
|
}
|
|
6462
|
+
const config = await loadLocalRunnerConfig(localConfigPath(options.config, options.spec));
|
|
6438
6463
|
const document = await resolvePipelineDocument(options);
|
|
6439
6464
|
const plan = createExecutionPlan(document, { only: parseList(options.only), skip: parseList(options.skip) });
|
|
6440
|
-
const hostWarnings = await hostWarningsForPipeline(document, options.spec);
|
|
6441
|
-
if (options.dryRun) {
|
|
6465
|
+
const hostWarnings = config.gpu ? [] : await hostWarningsForPipeline(document, options.spec);
|
|
6466
|
+
if (options.dryRun || config.dryRun) {
|
|
6442
6467
|
if (isJsonMode()) {
|
|
6443
6468
|
return printJson({
|
|
6444
6469
|
dry_run: true,
|
|
6445
6470
|
...plan,
|
|
6471
|
+
...config.gpu ? { gpu: { provider: config.gpu.provider, instanceId: config.gpu.instanceId, region: config.gpu.region, profile: config.gpu.profile } } : {},
|
|
6446
6472
|
...hostWarnings.length ? { host_warnings: hostWarnings } : {}
|
|
6447
6473
|
});
|
|
6448
6474
|
}
|
|
6449
6475
|
console.log("Dry run only \u2014 no execution, artifact transfer, or credit reservation will occur.");
|
|
6476
|
+
if (config.gpu) console.log(`GPU processes: AWS instance ${config.gpu.instanceId}. Orchestration stays local.`);
|
|
6450
6477
|
return outputPlan(plan, hostWarnings);
|
|
6451
6478
|
}
|
|
6452
6479
|
for (const warning of hostWarnings) printWarning(warning);
|
|
6453
6480
|
const remote = plan.steps.find((step) => step.target !== "local");
|
|
6454
6481
|
if (remote) {
|
|
6455
|
-
throw new Error(`Step "${remote.id}" targets cloud execution. Pipeline execution requires local targets;
|
|
6482
|
+
throw new Error(`Step "${remote.id}" targets cloud execution. Pipeline execution requires local targets; set targets to local and configure gpu in local-runner.json to use your AWS instance.`);
|
|
6456
6483
|
}
|
|
6457
6484
|
const input = await loadLocalRunInput(resolve6(options.spec));
|
|
6458
6485
|
if (isParsedFoundationPipeline(document) || input.kind === "foundation-spec") {
|
|
@@ -6465,7 +6492,8 @@ function registerPipelineCommands(parent) {
|
|
|
6465
6492
|
plan,
|
|
6466
6493
|
specPath: resolve6(options.spec),
|
|
6467
6494
|
...options.output || options.resume ? { outputDir: resolve6(options.resume ?? options.output) } : {},
|
|
6468
|
-
resume: Boolean(options.resume)
|
|
6495
|
+
resume: Boolean(options.resume),
|
|
6496
|
+
gpu: config.gpu
|
|
6469
6497
|
});
|
|
6470
6498
|
if (isJsonMode()) return printJson(result3);
|
|
6471
6499
|
printSuccess(`Foundation pipeline completed. Report: ${result3.report_path}`);
|
|
@@ -6475,7 +6503,6 @@ function registerPipelineCommands(parent) {
|
|
|
6475
6503
|
throw new Error("--output and --resume are only valid for foundation pipelines.");
|
|
6476
6504
|
}
|
|
6477
6505
|
assertLocalRunInputReady(input.request);
|
|
6478
|
-
const config = await loadLocalRunnerConfig(localConfigPath(options.config, options.spec));
|
|
6479
6506
|
const localPipeline = {
|
|
6480
6507
|
version: 1,
|
|
6481
6508
|
...plan.name ? { name: plan.name } : {},
|
|
@@ -7852,7 +7879,7 @@ function registerLabelCommands(parent) {
|
|
|
7852
7879
|
`Dataset created: ${data3.name} (${shortId(data3.id)}) \u2014 ${data3.row_count} rows.`
|
|
7853
7880
|
);
|
|
7854
7881
|
console.log(
|
|
7855
|
-
|
|
7882
|
+
"Export the dataset for use with tt pipeline run and optional AWS GPU configuration."
|
|
7856
7883
|
);
|
|
7857
7884
|
});
|
|
7858
7885
|
label.command("cancel").description("Cancel a labeling job and release unused credits").argument("<id>", "Labeling job ID (full UUID or 4+ char prefix)").action(async (id) => {
|
|
@@ -7870,15 +7897,6 @@ function registerLabelCommands(parent) {
|
|
|
7870
7897
|
|
|
7871
7898
|
// src/commands/runs.ts
|
|
7872
7899
|
import ora from "ora";
|
|
7873
|
-
var LONG_EXAMPLE_POLICIES = ["error", "truncate", "skip"];
|
|
7874
|
-
function parseLongExamplesPolicy(value) {
|
|
7875
|
-
if (LONG_EXAMPLE_POLICIES.includes(value)) {
|
|
7876
|
-
return value;
|
|
7877
|
-
}
|
|
7878
|
-
throw new Error(
|
|
7879
|
-
`--long-examples must be one of: ${LONG_EXAMPLE_POLICIES.join(", ")}`
|
|
7880
|
-
);
|
|
7881
|
-
}
|
|
7882
7900
|
function formatProgress(run) {
|
|
7883
7901
|
if (run.progress_pct == null && !run.stage_label) return void 0;
|
|
7884
7902
|
const label = run.stage_label ?? run.current_stage ?? "Progress";
|
|
@@ -7911,43 +7929,6 @@ function formatMinutes(minutes) {
|
|
|
7911
7929
|
if (minutes < 60) return `${Math.max(1, Math.round(minutes))}m`;
|
|
7912
7930
|
return `${(minutes / 60).toFixed(1)}h`;
|
|
7913
7931
|
}
|
|
7914
|
-
function formatCents3(cents) {
|
|
7915
|
-
const dollars = cents / 100;
|
|
7916
|
-
if (Math.abs(dollars) >= 100) return `$${dollars.toFixed(0)}`;
|
|
7917
|
-
return `$${dollars.toFixed(2)}`;
|
|
7918
|
-
}
|
|
7919
|
-
function formatEstimateRange(estimate) {
|
|
7920
|
-
const duration = estimate.duration;
|
|
7921
|
-
return `${formatMinutes(duration.estimated_minutes)} (${formatMinutes(duration.range_minutes.low)}-${formatMinutes(duration.range_minutes.high)})`;
|
|
7922
|
-
}
|
|
7923
|
-
function printRunEstimate(estimate) {
|
|
7924
|
-
const billing = estimate.billing;
|
|
7925
|
-
printDetail([
|
|
7926
|
-
["Estimated Time", formatEstimateRange(estimate)],
|
|
7927
|
-
["Confidence", estimate.duration.confidence],
|
|
7928
|
-
["History Samples", String(estimate.duration.sample_count)],
|
|
7929
|
-
["Basis", estimate.duration.basis.replaceAll("_", " ")],
|
|
7930
|
-
["Estimated Cost", formatCents3(estimate.estimated_cost_cents)],
|
|
7931
|
-
["Training Tokens", `${(estimate.estimated_training_tokens / 1e3).toFixed(1)}k`],
|
|
7932
|
-
["Epochs", String(estimate.estimated_epochs)],
|
|
7933
|
-
["Plan", billing?.plan],
|
|
7934
|
-
[
|
|
7935
|
-
"Billing Source",
|
|
7936
|
-
billing?.billing_source === "free_quota" ? "Free monthly quota" : billing?.billing_source === "credits" ? "Credits" : void 0
|
|
7937
|
-
],
|
|
7938
|
-
[
|
|
7939
|
-
"Free Runs",
|
|
7940
|
-
billing ? `${billing.free_runs_remaining}/${billing.free_runs_monthly_limit} remaining` : void 0
|
|
7941
|
-
],
|
|
7942
|
-
[
|
|
7943
|
-
"Free Eligible",
|
|
7944
|
-
billing ? billing.free_run_eligible ? "yes" : `no (${billing.free_run_ineligibility.join(", ") || "not eligible"})` : void 0
|
|
7945
|
-
]
|
|
7946
|
-
]);
|
|
7947
|
-
console.log(
|
|
7948
|
-
"\nDuration is a rough historical range. Final cost uses provider-reported training tokens."
|
|
7949
|
-
);
|
|
7950
|
-
}
|
|
7951
7932
|
function formatEpochProgress(diagnostics) {
|
|
7952
7933
|
const curve = diagnostics.training.curve;
|
|
7953
7934
|
if (curve.latest_epoch == null) return void 0;
|
|
@@ -8178,46 +8159,6 @@ function printRunReport(report, options) {
|
|
|
8178
8159
|
printReportExamples(label, split, options.mode, options.limit);
|
|
8179
8160
|
}
|
|
8180
8161
|
}
|
|
8181
|
-
function addRunConfigurationOptions(command) {
|
|
8182
|
-
return command.option("--no-augment", "Disable data augmentation").option("--no-llm-judge", "Disable LLM judging").option("--epochs <n>", "Number of training epochs").option("--lr <rate>", "Learning rate").option("--batch-size <n>", "Batch size").option("--dataset <id>", "Dataset ID to use instead of inline spec examples (full UUID or 4+ char prefix)").option("--parent-model <id>", "Fine-tuned model ID to continue training from (full UUID or 4+ char prefix)").option("--train-ratio <ratio>", "Dataset training split ratio (default: 0.8 when any split ratio is set)").option("--validation-ratio <ratio>", "Dataset validation split ratio (default: 0.1 when any split ratio is set)").option("--test-ratio <ratio>", "Dataset test split ratio (default: 0.1 when any split ratio is set)").option("--lora-rank <n>", "LoRA rank").option("--lora-alpha <n>", "LoRA alpha").option("--max-eval-examples <n>", "Max examples for the primary eval pass").option("--max-test-eval-examples <n>", "Max examples for the secondary test eval pass").option("--long-examples <policy>", "Long training row policy: error, truncate, or skip").option("--max-seq-length <tokens>", "Maximum training sequence length in tokens").option("--max-output-tokens <tokens>", "Desired evaluation output budget in tokens").option("--eval-reserved-output-tokens <tokens>", "Minimum evaluation output tokens reserved per row");
|
|
8183
|
-
}
|
|
8184
|
-
async function buildRunRequestBody(cmdOpts, opts) {
|
|
8185
|
-
const body = {};
|
|
8186
|
-
if (cmdOpts.augment === false) body.augment = false;
|
|
8187
|
-
if (cmdOpts.dataset) body.dataset_id = await resolveDatasetId(String(cmdOpts.dataset), opts);
|
|
8188
|
-
if (cmdOpts.parentModel) {
|
|
8189
|
-
body.parent_model_id = await resolveModelId(String(cmdOpts.parentModel), opts);
|
|
8190
|
-
}
|
|
8191
|
-
const splitRatioOptions = [
|
|
8192
|
-
cmdOpts.trainRatio,
|
|
8193
|
-
cmdOpts.validationRatio,
|
|
8194
|
-
cmdOpts.testRatio
|
|
8195
|
-
];
|
|
8196
|
-
if (splitRatioOptions.some((value) => value != null)) {
|
|
8197
|
-
body.split_ratios = {
|
|
8198
|
-
train: cmdOpts.trainRatio != null ? Number(cmdOpts.trainRatio) : 0.8,
|
|
8199
|
-
validation: cmdOpts.validationRatio != null ? Number(cmdOpts.validationRatio) : 0.1,
|
|
8200
|
-
test: cmdOpts.testRatio != null ? Number(cmdOpts.testRatio) : 0.1
|
|
8201
|
-
};
|
|
8202
|
-
}
|
|
8203
|
-
const hp = {};
|
|
8204
|
-
if (cmdOpts.epochs) hp.n_epochs = Number(cmdOpts.epochs);
|
|
8205
|
-
if (cmdOpts.lr) hp.learning_rate = Number(cmdOpts.lr);
|
|
8206
|
-
if (cmdOpts.batchSize) hp.batch_size = Number(cmdOpts.batchSize);
|
|
8207
|
-
if (cmdOpts.loraRank) hp.lora_rank = Number(cmdOpts.loraRank);
|
|
8208
|
-
if (cmdOpts.loraAlpha) hp.lora_alpha = Number(cmdOpts.loraAlpha);
|
|
8209
|
-
if (cmdOpts.maxEvalExamples) hp.max_eval_examples = Number(cmdOpts.maxEvalExamples);
|
|
8210
|
-
if (cmdOpts.maxTestEvalExamples) hp.max_test_eval_examples = Number(cmdOpts.maxTestEvalExamples);
|
|
8211
|
-
if (cmdOpts.longExamples) hp.long_examples = parseLongExamplesPolicy(String(cmdOpts.longExamples));
|
|
8212
|
-
if (cmdOpts.maxSeqLength) hp.max_seq_length = Number(cmdOpts.maxSeqLength);
|
|
8213
|
-
if (cmdOpts.maxOutputTokens) hp.max_output_tokens = Number(cmdOpts.maxOutputTokens);
|
|
8214
|
-
if (cmdOpts.evalReservedOutputTokens) {
|
|
8215
|
-
hp.eval_reserved_output_tokens = Number(cmdOpts.evalReservedOutputTokens);
|
|
8216
|
-
}
|
|
8217
|
-
if (cmdOpts.llmJudge === false) body.use_llm_judge = false;
|
|
8218
|
-
if (Object.keys(hp).length) body.hyperparameters = hp;
|
|
8219
|
-
return body;
|
|
8220
|
-
}
|
|
8221
8162
|
function registerRunsCommands(parent) {
|
|
8222
8163
|
const runs = parent.command("runs").description("Manage runs");
|
|
8223
8164
|
runs.command("archive").description("Archive an inactive local run report published to the dashboard").argument("<id>", "Published run ID or prefix").action(async (id) => {
|
|
@@ -8308,36 +8249,11 @@ Eval Results (${data3._evals.length}):`);
|
|
|
8308
8249
|
);
|
|
8309
8250
|
}
|
|
8310
8251
|
});
|
|
8311
|
-
|
|
8312
|
-
runs.command(
|
|
8313
|
-
|
|
8314
|
-
|
|
8315
|
-
|
|
8316
|
-
const fullSpecId = await resolveSpecId(specId, opts);
|
|
8317
|
-
const { data: data3 } = await post(
|
|
8318
|
-
`/behavior-specs/${fullSpecId}/runs/estimate`,
|
|
8319
|
-
body,
|
|
8320
|
-
opts
|
|
8321
|
-
);
|
|
8322
|
-
if (isJsonMode()) return printJson(data3);
|
|
8323
|
-
printRunEstimate(data3);
|
|
8324
|
-
});
|
|
8325
|
-
addRunConfigurationOptions(
|
|
8326
|
-
runs.command("start").description("Start a new run for a behaviour spec").argument("<spec-id>", "Behaviour spec ID (full UUID or 8+ char prefix)")
|
|
8327
|
-
).action(async (specId, cmdOpts) => {
|
|
8328
|
-
const opts = parent.optsWithGlobals();
|
|
8329
|
-
const body = await buildRunRequestBody(cmdOpts, opts);
|
|
8330
|
-
const fullSpecId = await resolveSpecId(specId, opts);
|
|
8331
|
-
const { data: data3 } = await post(
|
|
8332
|
-
`/behavior-specs/${fullSpecId}/runs`,
|
|
8333
|
-
body,
|
|
8334
|
-
opts
|
|
8335
|
-
);
|
|
8336
|
-
if (isJsonMode()) return printJson(data3);
|
|
8337
|
-
printSuccess(
|
|
8338
|
-
`Run #${data3.run_number} started (${shortId(data3.id)}). ${formatProgress(data3) ?? `Status: ${formatStatus(data3.status)}`}`
|
|
8339
|
-
);
|
|
8340
|
-
});
|
|
8252
|
+
for (const name of ["start", "estimate"]) {
|
|
8253
|
+
runs.command(name).description("Retired: use the local pipeline with your own AWS GPU").argument("[spec-id]").action(() => {
|
|
8254
|
+
throw new Error("Hosted training is retired. Configure gpu in local-runner.json and use tt run or tt pipeline run. See docs/local-runtime/aws-gpu.md.");
|
|
8255
|
+
});
|
|
8256
|
+
}
|
|
8341
8257
|
runs.command("cancel").description("Cancel a running run").argument("<id>", "Run ID (full UUID or 8+ char prefix)").action(async (id) => {
|
|
8342
8258
|
const opts = parent.optsWithGlobals();
|
|
8343
8259
|
const fullId = await resolveRunId(id, opts);
|
|
@@ -10825,7 +10741,7 @@ async function runCli(version, runtime = {}) {
|
|
|
10825
10741
|
}
|
|
10826
10742
|
|
|
10827
10743
|
// src/index.ts
|
|
10828
|
-
runCli("0.
|
|
10744
|
+
runCli("0.16.0").catch((err) => {
|
|
10829
10745
|
reportError(err);
|
|
10830
10746
|
process.exit(1);
|
|
10831
10747
|
});
|