badgr-cli 1.0.19 → 1.0.20

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "badgr-cli",
3
- "version": "1.0.19",
3
+ "version": "1.0.20",
4
4
  "description": "Badgr, run or serve GPU workloads from one command",
5
5
  "type": "module",
6
6
  "bin": {
@@ -18,6 +18,7 @@ export function parseRunArgs(args) {
18
18
  if (args[i] === '--image') { flags.image = args[++i]; i++; continue; }
19
19
  if (args[i] === '--count') { flags.count = parseInt(args[++i], 10); i++; continue; }
20
20
  if (args[i] === '--region') { flags.region = args[++i]; i++; continue; }
21
+ if (args[i] === '--tier') { flags.tier = args[++i]; i++; continue; }
21
22
  if (args[i] === '--max-price') { flags.maxPrice = parseFloat(args[++i]); i++; continue; }
22
23
  if (args[i] === '--name') { flags.name = args[++i]; i++; continue; }
23
24
  if (args[i] === '--detach') { flags.detach = true; i++; continue; }
@@ -384,6 +385,7 @@ export async function runCommand(config, args, chalk) {
384
385
  ...(effectiveRegion ? { region: effectiveRegion } : {}),
385
386
  max_price_per_hour: flags.maxPrice,
386
387
  name: flags.name,
388
+ ...(flags.tier ? { tier: flags.tier } : {}),
387
389
  };
388
390
  }
389
391
 
@@ -436,7 +438,7 @@ export async function runCommand(config, args, chalk) {
436
438
  const d2 = err2.errorData;
437
439
  if (d2?.code === 'PROVISIONING_FAILED' || d2?.code === 'PROVIDER_ADAPTER_ERROR') {
438
440
  if (d2?.low_cost_provider_failed) {
439
- console.error(chalk.red(`\n ✗ Low-cost provider failed. Primary provider also unavailable.\n`));
441
+ console.error(chalk.red(`\n ✗ Tier 2 unavailable. Tier 1 also unavailable. Try again shortly.\n`));
440
442
  } else {
441
443
  console.error(chalk.red(`\n ✗ Badgr found ${chosen.gpu} capacity but could not start the machine. Please try again.\n`));
442
444
  }
@@ -453,7 +455,7 @@ export async function runCommand(config, args, chalk) {
453
455
  }
454
456
  } else if (d?.code === 'PROVISIONING_FAILED' || d?.code === 'PROVIDER_ADAPTER_ERROR') {
455
457
  if (d?.low_cost_provider_failed) {
456
- console.error(chalk.red(`\n ✗ Low-cost provider failed. Primary provider also unavailable.\n`));
458
+ console.error(chalk.red(`\n ✗ Tier 2 unavailable. Tier 1 also unavailable. Try again shortly.\n`));
457
459
  } else {
458
460
  console.error(chalk.red(`\n ✗ Badgr found ${gpu} capacity but could not start the machine. Please try again.\n`));
459
461
  }
@@ -471,8 +473,8 @@ export async function runCommand(config, args, chalk) {
471
473
  }
472
474
  }
473
475
 
474
- if (dep.provider_fallback_note === 'low_cost_provider_failed') {
475
- console.log(chalk.yellow(' ℹ Low-cost provider failed. Using primary provider instead.\n'));
476
+ if (dep.provider_fallback_note === 'tier2_failed_using_tier1') {
477
+ console.log(chalk.yellow(' ℹ Tier 2 unavailable. Running on Tier 1 instead.\n'));
476
478
  }
477
479
 
478
480
  const rcptId = dep.receipt_id || generateReceiptId();
@@ -488,6 +490,7 @@ export async function runCommand(config, args, chalk) {
488
490
  console.log();
489
491
  console.log(chalk.bold(` Job ID: ${chalk.cyan(dep.deployment_id)}`));
490
492
  console.log(` ${chalk.bold('GPU:')} ${dep.gpu_type} × ${dep.gpu_count}`);
493
+ if (dep.tier) console.log(` ${chalk.bold('Tier:')} ${dep.tier}`);
491
494
  if (dep.cost_per_hour > 0) console.log(` ${chalk.bold('Rate:')} $${dep.cost_per_hour.toFixed(2)}/hr`);
492
495
  console.log(` ${chalk.bold('Receipt:')} ${chalk.dim(rcptId)}`);
493
496
 
@@ -17,6 +17,7 @@ export function parseServeArgs(args) {
17
17
  if (args[i] === '--gpu') { flags.gpu = args[++i]; i++; continue; }
18
18
  if (args[i] === '--count') { flags.count = parseInt(args[++i], 10); i++; continue; }
19
19
  if (args[i] === '--region') { flags.region = args[++i]; i++; continue; }
20
+ if (args[i] === '--tier') { flags.tier = args[++i]; i++; continue; }
20
21
  if (args[i] === '--max-price') { flags.maxPrice = parseFloat(args[++i]); i++; continue; }
21
22
  if (args[i] === '--name') { flags.name = args[++i]; i++; continue; }
22
23
  if (args[i] === '--no-wait') { flags.noWait = true; i++; continue; }
@@ -79,6 +80,7 @@ export async function serveCommand(config, args, chalk) {
79
80
  ...(regionOverride || effectiveRegion ? { region: regionOverride || effectiveRegion } : {}),
80
81
  max_price_per_hour: flags.maxPrice,
81
82
  name: flags.name,
83
+ ...(flags.tier ? { tier: flags.tier } : {}),
82
84
  };
83
85
  }
84
86
 
@@ -125,7 +127,7 @@ export async function serveCommand(config, args, chalk) {
125
127
  const d2 = err2.errorData;
126
128
  if (d2?.code === 'PROVISIONING_FAILED' || d2?.code === 'PROVIDER_ADAPTER_ERROR') {
127
129
  if (d2?.low_cost_provider_failed) {
128
- console.error(chalk.red(`\n ✗ Low-cost provider failed. Primary provider also unavailable.\n`));
130
+ console.error(chalk.red(`\n ✗ Tier 2 unavailable. Tier 1 also unavailable. Try again shortly.\n`));
129
131
  } else {
130
132
  console.error(chalk.red(`\n ✗ Badgr found ${chosen.gpu} capacity but could not start the endpoint. Please try again.\n`));
131
133
  }
@@ -137,7 +139,7 @@ export async function serveCommand(config, args, chalk) {
137
139
  }
138
140
  } else if (d?.code === 'PROVISIONING_FAILED' || d?.code === 'PROVIDER_ADAPTER_ERROR') {
139
141
  if (d?.low_cost_provider_failed) {
140
- console.error(chalk.red(`\n ✗ Low-cost provider failed. Primary provider also unavailable.\n`));
142
+ console.error(chalk.red(`\n ✗ Tier 2 unavailable. Tier 1 also unavailable. Try again shortly.\n`));
141
143
  } else {
142
144
  console.error(chalk.red(`\n ✗ Badgr found capacity but could not start the endpoint. Please try again.\n`));
143
145
  }
@@ -161,8 +163,8 @@ export async function serveCommand(config, args, chalk) {
161
163
  }
162
164
  }
163
165
 
164
- if (dep.provider_fallback_note === 'low_cost_provider_failed') {
165
- console.log(chalk.yellow(' ℹ Low-cost provider failed. Using primary provider instead.\n'));
166
+ if (dep.provider_fallback_note === 'tier2_failed_using_tier1') {
167
+ console.log(chalk.yellow(' ℹ Tier 2 unavailable. Running on Tier 1 instead.\n'));
166
168
  }
167
169
 
168
170
  addDeployment({
@@ -215,6 +217,7 @@ export async function serveCommand(config, args, chalk) {
215
217
  console.log(` ${chalk.bold('Base URL:')} ${chalk.cyan(endpointUrl)}`);
216
218
  console.log(` ${chalk.bold('Model:')} ${dep.model || model}`);
217
219
  console.log(` ${chalk.bold('GPU:')} ${dep.gpu_type} × ${dep.gpu_count}`);
220
+ if (dep.tier) console.log(` ${chalk.bold('Tier:')} ${dep.tier}`);
218
221
  if (dep.cost_per_hour > 0) console.log(` ${chalk.bold('Rate:')} $${dep.cost_per_hour.toFixed(2)}/hr`);
219
222
  console.log(` ${chalk.bold('Logs:')} ${chalk.dim(`badgr logs ${dep.deployment_id}`)}`);
220
223
  console.log(` ${chalk.bold('Stop billing:')} ${chalk.dim(`badgr down ${dep.deployment_id}`)}`);