badgr-cli 1.0.34 → 1.0.35

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.34",
3
+ "version": "1.0.35",
4
4
  "description": "Badgr, run or serve GPU workloads from one command",
5
5
  "type": "module",
6
6
  "bin": {
package/src/api.js CHANGED
@@ -105,7 +105,7 @@ export function runJob(config, body) {
105
105
  apiKey: config.apiKey,
106
106
  baseUrl: config.baseUrl,
107
107
  body,
108
- timeoutMs: 75_000,
108
+ timeoutMs: 130_000,
109
109
  });
110
110
  }
111
111
 
@@ -115,7 +115,7 @@ export function serveModel(config, body) {
115
115
  apiKey: config.apiKey,
116
116
  baseUrl: config.baseUrl,
117
117
  body,
118
- timeoutMs: 75_000,
118
+ timeoutMs: 130_000,
119
119
  });
120
120
  }
121
121
 
package/src/fallback.js CHANGED
@@ -24,7 +24,7 @@ export class CapacityError extends Error {
24
24
  }
25
25
 
26
26
  /**
27
- * Call an API endpoint with automatic tier-2 expansion on NO_CAPACITY_MATCH.
27
+ * Call an API endpoint with automatic tier-2 expansion when tier-1 fails.
28
28
  * Returns the deployment object on success.
29
29
  * Throws CapacityError (pre-formatted for display) on unrecoverable failure.
30
30
  * Re-throws payment errors (err.isPaymentRequired) for callers to handle.
@@ -44,10 +44,9 @@ export async function callWithFallback(endpoint, callOpts, buildBody, effectiveT
44
44
  const cmd = labels?.cmd ?? 'badgr run';
45
45
  const allowTier2Fallback = opts.allowTier2Fallback !== false; // default true
46
46
 
47
- // 75s: backend provisioning runs up to 55s and returns PROVISIONING_TIMEOUT;
48
- // the extra headroom ensures the CLI always sees the real response.
47
+ // 130s: backend provisioning runs up to BADGR_PROVISION_TIMEOUT_SECONDS (default 120s).
49
48
  async function attempt(body) {
50
- return callApi(endpoint, { method: 'POST', ...callOpts, body, timeoutMs: 75_000 });
49
+ return callApi(endpoint, { method: 'POST', ...callOpts, body, timeoutMs: 130_000 });
51
50
  }
52
51
 
53
52
  // Map server error codes → catalog keys and extract context for templates.
@@ -118,8 +117,8 @@ export async function callWithFallback(endpoint, callOpts, buildBody, effectiveT
118
117
  }
119
118
  }
120
119
 
121
- // Tier-2 expansion: try budget-tier providers when primary has no capacity
122
- if (firstErr.errorData?.code === 'NO_CAPACITY_MATCH' && effectiveTier !== '2' && allowTier2Fallback) {
120
+ // Tier-2 expansion: try budget-tier providers whenever tier-1 fails
121
+ if (effectiveTier !== '2' && allowTier2Fallback) {
123
122
  console.log(chalk.dim('\n Primary capacity unavailable — expanding search...\n'));
124
123
  try {
125
124
  return await attempt(buildBody('2'));
@@ -270,7 +270,7 @@ describe('invalid model ID or no capacity', () => {
270
270
  errorData: { code: 'PROVISIONING_FAILED', debug_error: 'HF_TOKEN missing, repo is private' },
271
271
  httpStatus: 503,
272
272
  });
273
- // tier-1 provisioning fails; tier-2 also fails (or is not tried without NO_CAPACITY_MATCH)
273
+ // tier-1 provisioning fails; tier-2 is also tried and fails
274
274
  api.callApi.mockRejectedValue(provErr);
275
275
 
276
276
  const errLines = [];