@pydantic/genai-prices 0.0.37 → 0.0.39

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/dist/cli.js CHANGED
@@ -1,8 +1,8 @@
1
1
  #!/usr/bin/env node
2
2
  import de from "yargs";
3
3
  import { format as he } from "util";
4
- import { resolve as ie, normalize as Ie } from "path";
5
- import { readFileSync as ke, writeFile as Le, statSync as Pe } from "fs";
4
+ import { resolve as ae, normalize as Ie } from "path";
5
+ import { readFileSync as _e, writeFile as Le, statSync as Pe } from "fs";
6
6
  import "assert";
7
7
  import { fileURLToPath as Te } from "url";
8
8
  function Ae() {
@@ -14,59 +14,59 @@ function Se() {
14
14
  function Ge() {
15
15
  return !!process.versions.electron;
16
16
  }
17
- function Ce(a) {
18
- return a.slice(Ae() + 1);
17
+ function Ce(i) {
18
+ return i.slice(Ae() + 1);
19
19
  }
20
20
  /**
21
21
  * @license
22
22
  * Copyright (c) 2016, Contributors
23
23
  * SPDX-License-Identifier: ISC
24
24
  */
25
- function W(a) {
26
- if (a !== a.toLowerCase() && a !== a.toUpperCase() || (a = a.toLowerCase()), a.indexOf("-") === -1 && a.indexOf("_") === -1)
27
- return a;
25
+ function W(i) {
26
+ if (i !== i.toLowerCase() && i !== i.toUpperCase() || (i = i.toLowerCase()), i.indexOf("-") === -1 && i.indexOf("_") === -1)
27
+ return i;
28
28
  {
29
29
  let m = "", s = !1;
30
- const u = a.match(/^-+/);
31
- for (let _ = u ? u[0].length : 0; _ < a.length; _++) {
32
- let k = a.charAt(_);
33
- s && (s = !1, k = k.toUpperCase()), _ !== 0 && (k === "-" || k === "_") ? s = !0 : k !== "-" && k !== "_" && (m += k);
30
+ const u = i.match(/^-+/);
31
+ for (let k = u ? u[0].length : 0; k < i.length; k++) {
32
+ let _ = i.charAt(k);
33
+ s && (s = !1, _ = _.toUpperCase()), k !== 0 && (_ === "-" || _ === "_") ? s = !0 : _ !== "-" && _ !== "_" && (m += _);
34
34
  }
35
35
  return m;
36
36
  }
37
37
  }
38
- function Oe(a, n) {
39
- const m = a.toLowerCase();
38
+ function Oe(i, n) {
39
+ const m = i.toLowerCase();
40
40
  n = n || "-";
41
41
  let s = "";
42
- for (let u = 0; u < a.length; u++) {
43
- const _ = m.charAt(u), k = a.charAt(u);
44
- _ !== k && u > 0 ? s += `${n}${m.charAt(u)}` : s += k;
42
+ for (let u = 0; u < i.length; u++) {
43
+ const k = m.charAt(u), _ = i.charAt(u);
44
+ k !== _ && u > 0 ? s += `${n}${m.charAt(u)}` : s += _;
45
45
  }
46
46
  return s;
47
47
  }
48
- function Re(a) {
49
- return a == null ? !1 : typeof a == "number" || /^0x[0-9a-f]+$/i.test(a) ? !0 : /^0[^.]/.test(a) ? !1 : /^[-]?(?:\d+(?:\.\d*)?|\.\d+)(e[-+]?\d+)?$/.test(a);
48
+ function Re(i) {
49
+ return i == null ? !1 : typeof i == "number" || /^0x[0-9a-f]+$/i.test(i) ? !0 : /^0[^.]/.test(i) ? !1 : /^[-]?(?:\d+(?:\.\d*)?|\.\d+)(e[-+]?\d+)?$/.test(i);
50
50
  }
51
51
  /**
52
52
  * @license
53
53
  * Copyright (c) 2016, Contributors
54
54
  * SPDX-License-Identifier: ISC
55
55
  */
56
- function Ee(a) {
57
- if (Array.isArray(a))
58
- return a.map((k) => typeof k != "string" ? k + "" : k);
59
- a = a.trim();
56
+ function Ee(i) {
57
+ if (Array.isArray(i))
58
+ return i.map((_) => typeof _ != "string" ? _ + "" : _);
59
+ i = i.trim();
60
60
  let n = 0, m = null, s = null, u = null;
61
- const _ = [];
62
- for (let k = 0; k < a.length; k++) {
63
- if (m = s, s = a.charAt(k), s === " " && !u) {
61
+ const k = [];
62
+ for (let _ = 0; _ < i.length; _++) {
63
+ if (m = s, s = i.charAt(_), s === " " && !u) {
64
64
  m !== " " && n++;
65
65
  continue;
66
66
  }
67
- s === u ? u = null : (s === "'" || s === '"') && !u && (u = s), _[n] || (_[n] = ""), _[n] += s;
67
+ s === u ? u = null : (s === "'" || s === '"') && !u && (u = s), k[n] || (k[n] = ""), k[n] += s;
68
68
  }
69
- return _;
69
+ return k;
70
70
  }
71
71
  /**
72
72
  * @license
@@ -74,8 +74,8 @@ function Ee(a) {
74
74
  * SPDX-License-Identifier: ISC
75
75
  */
76
76
  var I;
77
- (function(a) {
78
- a.BOOLEAN = "boolean", a.STRING = "string", a.NUMBER = "number", a.ARRAY = "array";
77
+ (function(i) {
78
+ i.BOOLEAN = "boolean", i.STRING = "string", i.NUMBER = "number", i.ARRAY = "array";
79
79
  })(I || (I = {}));
80
80
  /**
81
81
  * @license
@@ -105,7 +105,7 @@ class Ne {
105
105
  number: void 0,
106
106
  __: void 0,
107
107
  key: void 0
108
- }, m), u = Ee(n), _ = typeof n == "string", k = ze(Object.assign(/* @__PURE__ */ Object.create(null), s.alias)), h = Object.assign({
108
+ }, m), u = Ee(n), k = typeof n == "string", _ = ze(Object.assign(/* @__PURE__ */ Object.create(null), s.alias)), h = Object.assign({
109
109
  "boolean-negation": !0,
110
110
  "camel-case-expansion": !0,
111
111
  "combine-arrays": !1,
@@ -138,14 +138,14 @@ class Ne {
138
138
  keys: []
139
139
  }, L = /^-([0-9]+(\.[0-9]+)?|\.[0-9]+)$/, U = new RegExp("^--" + h["negation-prefix"] + "(.+)");
140
140
  [].concat(s.array || []).filter(Boolean).forEach(function(e) {
141
- const i = typeof e == "object" ? e.key : e, l = Object.keys(e).map(function(o) {
141
+ const a = typeof e == "object" ? e.key : e, l = Object.keys(e).map(function(o) {
142
142
  return {
143
143
  boolean: "bools",
144
144
  string: "strings",
145
145
  number: "numbers"
146
146
  }[o];
147
147
  }).filter(Boolean).pop();
148
- l && (r[l][i] = !0), r.arrays[i] = !0, r.keys.push(i);
148
+ l && (r[l][a] = !0), r.arrays[a] = !0, r.keys.push(a);
149
149
  }), [].concat(s.boolean || []).filter(Boolean).forEach(function(e) {
150
150
  r.bools[e] = !0, r.keys.push(e);
151
151
  }), [].concat(s.string || []).filter(Boolean).forEach(function(e) {
@@ -156,17 +156,17 @@ class Ne {
156
156
  r.counts[e] = !0, r.keys.push(e);
157
157
  }), [].concat(s.normalize || []).filter(Boolean).forEach(function(e) {
158
158
  r.normalize[e] = !0, r.keys.push(e);
159
- }), typeof s.narg == "object" && Object.entries(s.narg).forEach(([e, i]) => {
160
- typeof i == "number" && (r.nargs[e] = i, r.keys.push(e));
161
- }), typeof s.coerce == "object" && Object.entries(s.coerce).forEach(([e, i]) => {
162
- typeof i == "function" && (r.coercions[e] = i, r.keys.push(e));
159
+ }), typeof s.narg == "object" && Object.entries(s.narg).forEach(([e, a]) => {
160
+ typeof a == "number" && (r.nargs[e] = a, r.keys.push(e));
161
+ }), typeof s.coerce == "object" && Object.entries(s.coerce).forEach(([e, a]) => {
162
+ typeof a == "function" && (r.coercions[e] = a, r.keys.push(e));
163
163
  }), typeof s.config < "u" && (Array.isArray(s.config) || typeof s.config == "string" ? [].concat(s.config).filter(Boolean).forEach(function(e) {
164
164
  r.configs[e] = !0;
165
- }) : typeof s.config == "object" && Object.entries(s.config).forEach(([e, i]) => {
166
- (typeof i == "boolean" || typeof i == "function") && (r.configs[e] = i);
167
- })), qe(s.key, k, s.default, r.arrays), Object.keys(f).forEach(function(e) {
168
- (r.aliases[e] || []).forEach(function(i) {
169
- f[i] = f[e];
165
+ }) : typeof s.config == "object" && Object.entries(s.config).forEach(([e, a]) => {
166
+ (typeof a == "boolean" || typeof a == "function") && (r.configs[e] = a);
167
+ })), qe(s.key, _, s.default, r.arrays), Object.keys(f).forEach(function(e) {
168
+ (r.aliases[e] || []).forEach(function(a) {
169
+ f[a] = f[e];
170
170
  });
171
171
  });
172
172
  let B = null;
@@ -174,28 +174,28 @@ class Ne {
174
174
  let F = [];
175
175
  const w = Object.assign(/* @__PURE__ */ Object.create(null), { _: [] }), ne = {};
176
176
  for (let e = 0; e < u.length; e++) {
177
- const i = u[e], l = i.replace(/^-{3,}/, "---");
177
+ const a = u[e], l = a.replace(/^-{3,}/, "---");
178
178
  let o, t, p, c, d, v;
179
- if (i !== "--" && /^-/.test(i) && H(i))
180
- K(i);
179
+ if (a !== "--" && /^-/.test(a) && H(a))
180
+ K(a);
181
181
  else if (l.match(/^---+(=|$)/)) {
182
- K(i);
182
+ K(a);
183
183
  continue;
184
- } else if (i.match(/^--.+=/) || !h["short-option-groups"] && i.match(/^-.+=/))
185
- c = i.match(/^--?([^=]+)=([\s\S]*)$/), c !== null && Array.isArray(c) && c.length >= 3 && (g(c[1], r.arrays) ? e = V(e, c[1], u, c[2]) : g(c[1], r.nargs) !== !1 ? e = D(e, c[1], u, c[2]) : q(c[1], c[2], !0));
186
- else if (i.match(U) && h["boolean-negation"])
187
- c = i.match(U), c !== null && Array.isArray(c) && c.length >= 2 && (t = c[1], q(t, g(t, r.arrays) ? [!1] : !1));
188
- else if (i.match(/^--.+/) || !h["short-option-groups"] && i.match(/^-[^-]+/))
189
- c = i.match(/^--?(.+)/), c !== null && Array.isArray(c) && c.length >= 2 && (t = c[1], g(t, r.arrays) ? e = V(e, t, u) : g(t, r.nargs) !== !1 ? e = D(e, t, u) : (d = u[e + 1], d !== void 0 && (!d.match(/^-/) || d.match(L)) && !g(t, r.bools) && !g(t, r.counts) || /^(true|false)$/.test(d) ? (q(t, d), e++) : q(t, R(t))));
190
- else if (i.match(/^-.\..+=/))
191
- c = i.match(/^-([^=]+)=([\s\S]*)$/), c !== null && Array.isArray(c) && c.length >= 3 && q(c[1], c[2]);
192
- else if (i.match(/^-.\..+/) && !i.match(L))
193
- d = u[e + 1], c = i.match(/^-(.\..+)/), c !== null && Array.isArray(c) && c.length >= 2 && (t = c[1], d !== void 0 && !d.match(/^-/) && !g(t, r.bools) && !g(t, r.counts) ? (q(t, d), e++) : q(t, R(t)));
194
- else if (i.match(/^-[^-]+/) && !i.match(L)) {
195
- p = i.slice(1, -1).split(""), o = !1;
184
+ } else if (a.match(/^--.+=/) || !h["short-option-groups"] && a.match(/^-.+=/))
185
+ c = a.match(/^--?([^=]+)=([\s\S]*)$/), c !== null && Array.isArray(c) && c.length >= 3 && (g(c[1], r.arrays) ? e = V(e, c[1], u, c[2]) : g(c[1], r.nargs) !== !1 ? e = D(e, c[1], u, c[2]) : q(c[1], c[2], !0));
186
+ else if (a.match(U) && h["boolean-negation"])
187
+ c = a.match(U), c !== null && Array.isArray(c) && c.length >= 2 && (t = c[1], q(t, g(t, r.arrays) ? [!1] : !1));
188
+ else if (a.match(/^--.+/) || !h["short-option-groups"] && a.match(/^-[^-]+/))
189
+ c = a.match(/^--?(.+)/), c !== null && Array.isArray(c) && c.length >= 2 && (t = c[1], g(t, r.arrays) ? e = V(e, t, u) : g(t, r.nargs) !== !1 ? e = D(e, t, u) : (d = u[e + 1], d !== void 0 && (!d.match(/^-/) || d.match(L)) && !g(t, r.bools) && !g(t, r.counts) || /^(true|false)$/.test(d) ? (q(t, d), e++) : q(t, R(t))));
190
+ else if (a.match(/^-.\..+=/))
191
+ c = a.match(/^-([^=]+)=([\s\S]*)$/), c !== null && Array.isArray(c) && c.length >= 3 && q(c[1], c[2]);
192
+ else if (a.match(/^-.\..+/) && !a.match(L))
193
+ d = u[e + 1], c = a.match(/^-(.\..+)/), c !== null && Array.isArray(c) && c.length >= 2 && (t = c[1], d !== void 0 && !d.match(/^-/) && !g(t, r.bools) && !g(t, r.counts) ? (q(t, d), e++) : q(t, R(t)));
194
+ else if (a.match(/^-[^-]+/) && !a.match(L)) {
195
+ p = a.slice(1, -1).split(""), o = !1;
196
196
  for (let x = 0; x < p.length; x++) {
197
- if (d = i.slice(x + 2), p[x + 1] && p[x + 1] === "=") {
198
- v = i.slice(x + 3), t = p[x], g(t, r.arrays) ? e = V(e, t, u, v) : g(t, r.nargs) !== !1 ? e = D(e, t, u, v) : q(t, v), o = !0;
197
+ if (d = a.slice(x + 2), p[x + 1] && p[x + 1] === "=") {
198
+ v = a.slice(x + 3), t = p[x], g(t, r.arrays) ? e = V(e, t, u, v) : g(t, r.nargs) !== !1 ? e = D(e, t, u, v) : q(t, v), o = !0;
199
199
  break;
200
200
  }
201
201
  if (d === "-") {
@@ -212,73 +212,73 @@ class Ne {
212
212
  } else
213
213
  q(p[x], R(p[x]));
214
214
  }
215
- t = i.slice(-1)[0], !o && t !== "-" && (g(t, r.arrays) ? e = V(e, t, u) : g(t, r.nargs) !== !1 ? e = D(e, t, u) : (d = u[e + 1], d !== void 0 && (!/^(-|--)[^-]/.test(d) || d.match(L)) && !g(t, r.bools) && !g(t, r.counts) || /^(true|false)$/.test(d) ? (q(t, d), e++) : q(t, R(t))));
216
- } else if (i.match(/^-[0-9]$/) && i.match(L) && g(i.slice(1), r.bools))
217
- t = i.slice(1), q(t, R(t));
218
- else if (i === "--") {
215
+ t = a.slice(-1)[0], !o && t !== "-" && (g(t, r.arrays) ? e = V(e, t, u) : g(t, r.nargs) !== !1 ? e = D(e, t, u) : (d = u[e + 1], d !== void 0 && (!/^(-|--)[^-]/.test(d) || d.match(L)) && !g(t, r.bools) && !g(t, r.counts) || /^(true|false)$/.test(d) ? (q(t, d), e++) : q(t, R(t))));
216
+ } else if (a.match(/^-[0-9]$/) && a.match(L) && g(a.slice(1), r.bools))
217
+ t = a.slice(1), q(t, R(t));
218
+ else if (a === "--") {
219
219
  F = u.slice(e + 1);
220
220
  break;
221
221
  } else if (h["halt-at-non-option"]) {
222
222
  F = u.slice(e);
223
223
  break;
224
224
  } else
225
- K(i);
225
+ K(a);
226
226
  }
227
- re(w, !0), re(w, !1), _e(w), ge(), me(w, r.aliases, f, !0), fe(w), h["set-placeholder-key"] && be(w), Object.keys(r.counts).forEach(function(e) {
227
+ re(w, !0), re(w, !1), ke(w), ge(), me(w, r.aliases, f, !0), fe(w), h["set-placeholder-key"] && be(w), Object.keys(r.counts).forEach(function(e) {
228
228
  E(w, e.split(".")) || q(e, 0);
229
229
  }), S && F.length && (w[G] = []), F.forEach(function(e) {
230
230
  w[G].push(e);
231
231
  }), h["camel-case-expansion"] && h["strip-dashed"] && Object.keys(w).filter((e) => e !== "--" && e.includes("-")).forEach((e) => {
232
232
  delete w[e];
233
- }), h["strip-aliased"] && [].concat(...Object.keys(k).map((e) => k[e])).forEach((e) => {
234
- h["camel-case-expansion"] && e.includes("-") && delete w[e.split(".").map((i) => W(i)).join(".")], delete w[e];
233
+ }), h["strip-aliased"] && [].concat(...Object.keys(_).map((e) => _[e])).forEach((e) => {
234
+ h["camel-case-expansion"] && e.includes("-") && delete w[e.split(".").map((a) => W(a)).join(".")], delete w[e];
235
235
  });
236
236
  function K(e) {
237
- const i = $("_", e);
238
- (typeof i == "string" || typeof i == "number") && w._.push(i);
237
+ const a = $("_", e);
238
+ (typeof a == "string" || typeof a == "number") && w._.push(a);
239
239
  }
240
- function D(e, i, l, o) {
241
- let t, p = g(i, r.nargs);
240
+ function D(e, a, l, o) {
241
+ let t, p = g(a, r.nargs);
242
242
  if (p = typeof p != "number" || isNaN(p) ? 1 : p, p === 0)
243
- return T(o) || (B = Error(C("Argument unexpected for: %s", i))), q(i, R(i)), e;
243
+ return T(o) || (B = Error(C("Argument unexpected for: %s", a))), q(a, R(a)), e;
244
244
  let c = T(o) ? 0 : 1;
245
245
  if (h["nargs-eats-options"])
246
- l.length - (e + 1) + c < p && (B = Error(C("Not enough arguments following: %s", i))), c = p;
246
+ l.length - (e + 1) + c < p && (B = Error(C("Not enough arguments following: %s", a))), c = p;
247
247
  else {
248
248
  for (t = e + 1; t < l.length && (!l[t].match(/^-[^0-9]/) || l[t].match(L) || H(l[t])); t++)
249
249
  c++;
250
- c < p && (B = Error(C("Not enough arguments following: %s", i)));
250
+ c < p && (B = Error(C("Not enough arguments following: %s", a)));
251
251
  }
252
252
  let d = Math.min(c, p);
253
- for (!T(o) && d > 0 && (q(i, o), d--), t = e + 1; t < d + e + 1; t++)
254
- q(i, l[t]);
253
+ for (!T(o) && d > 0 && (q(a, o), d--), t = e + 1; t < d + e + 1; t++)
254
+ q(a, l[t]);
255
255
  return e + d;
256
256
  }
257
- function V(e, i, l, o) {
257
+ function V(e, a, l, o) {
258
258
  let t = [], p = o || l[e + 1];
259
- const c = g(i, r.nargs);
260
- if (g(i, r.bools) && !/^(true|false)$/.test(p))
259
+ const c = g(a, r.nargs);
260
+ if (g(a, r.bools) && !/^(true|false)$/.test(p))
261
261
  t.push(!0);
262
262
  else if (T(p) || T(o) && /^-/.test(p) && !L.test(p) && !H(p)) {
263
- if (f[i] !== void 0) {
264
- const d = f[i];
263
+ if (f[a] !== void 0) {
264
+ const d = f[a];
265
265
  t = Array.isArray(d) ? d : [d];
266
266
  }
267
267
  } else {
268
- T(o) || t.push(Y(i, o, !0));
268
+ T(o) || t.push(Y(a, o, !0));
269
269
  for (let d = e + 1; d < l.length && !(!h["greedy-arrays"] && t.length > 0 || c && typeof c == "number" && t.length >= c || (p = l[d], /^-/.test(p) && !L.test(p) && !H(p))); d++)
270
- e = d, t.push(Y(i, p, _));
270
+ e = d, t.push(Y(a, p, k));
271
271
  }
272
- return typeof c == "number" && (c && t.length < c || isNaN(c) && t.length === 0) && (B = Error(C("Not enough arguments following: %s", i))), q(i, t), e;
272
+ return typeof c == "number" && (c && t.length < c || isNaN(c) && t.length === 0) && (B = Error(C("Not enough arguments following: %s", a))), q(a, t), e;
273
273
  }
274
- function q(e, i, l = _) {
274
+ function q(e, a, l = k) {
275
275
  if (/-/.test(e) && h["camel-case-expansion"]) {
276
276
  const p = e.split(".").map(function(c) {
277
277
  return W(c);
278
278
  }).join(".");
279
279
  se(e, p);
280
280
  }
281
- const o = Y(e, i, l), t = e.split(".");
281
+ const o = Y(e, a, l), t = e.split(".");
282
282
  N(w, t, o), r.aliases[e] && r.aliases[e].forEach(function(p) {
283
283
  const c = p.split(".");
284
284
  N(w, c, o);
@@ -290,31 +290,31 @@ class Ne {
290
290
  Object.defineProperty(ne, c, {
291
291
  enumerable: !0,
292
292
  get() {
293
- return i;
293
+ return a;
294
294
  },
295
295
  set(d) {
296
- i = typeof d == "string" ? A.normalize(d) : d;
296
+ a = typeof d == "string" ? A.normalize(d) : d;
297
297
  }
298
298
  });
299
299
  });
300
300
  }
301
- function se(e, i) {
302
- r.aliases[e] && r.aliases[e].length || (r.aliases[e] = [i], Q[i] = !0), r.aliases[i] && r.aliases[i].length || se(i, e);
301
+ function se(e, a) {
302
+ r.aliases[e] && r.aliases[e].length || (r.aliases[e] = [a], Q[a] = !0), r.aliases[a] && r.aliases[a].length || se(a, e);
303
303
  }
304
- function Y(e, i, l) {
305
- l && (i = je(i)), (g(e, r.bools) || g(e, r.counts)) && typeof i == "string" && (i = i === "true");
306
- let o = Array.isArray(i) ? i.map(function(t) {
304
+ function Y(e, a, l) {
305
+ l && (a = je(a)), (g(e, r.bools) || g(e, r.counts)) && typeof a == "string" && (a = a === "true");
306
+ let o = Array.isArray(a) ? a.map(function(t) {
307
307
  return $(e, t);
308
- }) : $(e, i);
309
- return g(e, r.counts) && (T(o) || typeof o == "boolean") && (o = Z()), g(e, r.normalize) && g(e, r.arrays) && (Array.isArray(i) ? o = i.map((t) => A.normalize(t)) : o = A.normalize(i)), o;
308
+ }) : $(e, a);
309
+ return g(e, r.counts) && (T(o) || typeof o == "boolean") && (o = Z()), g(e, r.normalize) && g(e, r.arrays) && (Array.isArray(a) ? o = a.map((t) => A.normalize(t)) : o = A.normalize(a)), o;
310
310
  }
311
- function $(e, i) {
312
- return !h["parse-positional-numbers"] && e === "_" || !g(e, r.strings) && !g(e, r.bools) && !Array.isArray(i) && (Re(i) && h["parse-numbers"] && Number.isSafeInteger(Math.floor(parseFloat(`${i}`))) || !T(i) && g(e, r.numbers)) && (i = Number(i)), i;
311
+ function $(e, a) {
312
+ return !h["parse-positional-numbers"] && e === "_" || !g(e, r.strings) && !g(e, r.bools) && !Array.isArray(a) && (Re(a) && h["parse-numbers"] && Number.isSafeInteger(Math.floor(parseFloat(`${a}`))) || !T(a) && g(e, r.numbers)) && (a = Number(a)), a;
313
313
  }
314
- function _e(e) {
315
- const i = /* @__PURE__ */ Object.create(null);
316
- me(i, r.aliases, f), Object.keys(r.configs).forEach(function(l) {
317
- const o = e[l] || i[l];
314
+ function ke(e) {
315
+ const a = /* @__PURE__ */ Object.create(null);
316
+ me(a, r.aliases, f), Object.keys(r.configs).forEach(function(l) {
317
+ const o = e[l] || a[l];
318
318
  if (o)
319
319
  try {
320
320
  let t = null;
@@ -337,9 +337,9 @@ class Ne {
337
337
  }
338
338
  });
339
339
  }
340
- function J(e, i) {
340
+ function J(e, a) {
341
341
  Object.keys(e).forEach(function(l) {
342
- const o = e[l], t = i ? i + "." + l : l;
342
+ const o = e[l], t = a ? a + "." + l : l;
343
343
  typeof o == "object" && o !== null && !Array.isArray(o) && h["dot-notation"] ? J(o, t) : (!E(w, t.split(".")) || g(t, r.arrays) && h["combine-arrays"]) && q(t, o);
344
344
  });
345
345
  }
@@ -348,7 +348,7 @@ class Ne {
348
348
  J(e);
349
349
  });
350
350
  }
351
- function re(e, i) {
351
+ function re(e, a) {
352
352
  if (typeof P > "u")
353
353
  return;
354
354
  const l = typeof P == "string" ? P : "", o = A.env();
@@ -357,17 +357,17 @@ class Ne {
357
357
  const p = t.split("__").map(function(c, d) {
358
358
  return d === 0 && (c = c.substring(l.length)), W(c);
359
359
  });
360
- (i && r.configs[p.join(".")] || !i) && !E(e, p) && q(p.join("."), o[t]);
360
+ (a && r.configs[p.join(".")] || !a) && !E(e, p) && q(p.join("."), o[t]);
361
361
  }
362
362
  });
363
363
  }
364
364
  function fe(e) {
365
- let i;
365
+ let a;
366
366
  const l = /* @__PURE__ */ new Set();
367
367
  Object.keys(e).forEach(function(o) {
368
- if (!l.has(o) && (i = g(o, r.coercions), typeof i == "function"))
368
+ if (!l.has(o) && (a = g(o, r.coercions), typeof a == "function"))
369
369
  try {
370
- const t = $(o, i(e[o]));
370
+ const t = $(o, a(e[o]));
371
371
  [].concat(r.aliases[o] || [], o).forEach((p) => {
372
372
  l.add(p), e[p] = t;
373
373
  });
@@ -377,38 +377,38 @@ class Ne {
377
377
  });
378
378
  }
379
379
  function be(e) {
380
- return r.keys.forEach((i) => {
381
- ~i.indexOf(".") || typeof e[i] > "u" && (e[i] = void 0);
380
+ return r.keys.forEach((a) => {
381
+ ~a.indexOf(".") || typeof e[a] > "u" && (e[a] = void 0);
382
382
  }), e;
383
383
  }
384
- function me(e, i, l, o = !1) {
384
+ function me(e, a, l, o = !1) {
385
385
  Object.keys(l).forEach(function(t) {
386
- E(e, t.split(".")) || (N(e, t.split("."), l[t]), o && (oe[t] = !0), (i[t] || []).forEach(function(p) {
386
+ E(e, t.split(".")) || (N(e, t.split("."), l[t]), o && (oe[t] = !0), (a[t] || []).forEach(function(p) {
387
387
  E(e, p.split(".")) || N(e, p.split("."), l[t]);
388
388
  }));
389
389
  });
390
390
  }
391
- function E(e, i) {
391
+ function E(e, a) {
392
392
  let l = e;
393
- h["dot-notation"] || (i = [i.join(".")]), i.slice(0, -1).forEach(function(t) {
393
+ h["dot-notation"] || (a = [a.join(".")]), a.slice(0, -1).forEach(function(t) {
394
394
  l = l[t] || {};
395
395
  });
396
- const o = i[i.length - 1];
396
+ const o = a[a.length - 1];
397
397
  return typeof l != "object" ? !1 : o in l;
398
398
  }
399
- function N(e, i, l) {
399
+ function N(e, a, l) {
400
400
  let o = e;
401
- h["dot-notation"] || (i = [i.join(".")]), i.slice(0, -1).forEach(function(v) {
401
+ h["dot-notation"] || (a = [a.join(".")]), a.slice(0, -1).forEach(function(v) {
402
402
  v = le(v), typeof o == "object" && o[v] === void 0 && (o[v] = {}), typeof o[v] != "object" || Array.isArray(o[v]) ? (Array.isArray(o[v]) ? o[v].push({}) : o[v] = [o[v], {}], o = o[v][o[v].length - 1]) : o = o[v];
403
403
  });
404
- const t = le(i[i.length - 1]), p = g(i.join("."), r.arrays), c = Array.isArray(l);
404
+ const t = le(a[a.length - 1]), p = g(a.join("."), r.arrays), c = Array.isArray(l);
405
405
  let d = h["duplicate-arguments-array"];
406
406
  !d && g(t, r.nargs) && (d = !0, (!T(o[t]) && r.nargs[t] === 1 || Array.isArray(o[t]) && o[t].length === r.nargs[t]) && (o[t] = void 0)), l === Z() ? o[t] = Z(o[t]) : Array.isArray(o[t]) ? d && p && c ? o[t] = h["flatten-duplicate-arrays"] ? o[t].concat(l) : (Array.isArray(o[t][0]) ? o[t] : [o[t]]).concat([l]) : !d && !!p == !!c ? o[t] = l : o[t] = o[t].concat([l]) : o[t] === void 0 && p ? o[t] = c ? l : [l] : d && !(o[t] === void 0 || g(t, r.counts) || g(t, r.bools)) ? o[t] = [o[t], l] : o[t] = l;
407
407
  }
408
408
  function qe(...e) {
409
- e.forEach(function(i) {
410
- Object.keys(i || {}).forEach(function(l) {
411
- r.aliases[l] || (r.aliases[l] = [].concat(k[l] || []), r.aliases[l].concat(l).forEach(function(o) {
409
+ e.forEach(function(a) {
410
+ Object.keys(a || {}).forEach(function(l) {
411
+ r.aliases[l] || (r.aliases[l] = [].concat(_[l] || []), r.aliases[l].concat(l).forEach(function(o) {
412
412
  if (/-/.test(o) && h["camel-case-expansion"]) {
413
413
  const t = W(o);
414
414
  t !== l && r.aliases[l].indexOf(t) === -1 && (r.aliases[l].push(t), Q[t] = !0);
@@ -426,18 +426,18 @@ class Ne {
426
426
  });
427
427
  });
428
428
  }
429
- function g(e, i) {
430
- const l = [].concat(r.aliases[e] || [], e), o = Object.keys(i), t = l.find((p) => o.includes(p));
431
- return t ? i[t] : !1;
429
+ function g(e, a) {
430
+ const l = [].concat(r.aliases[e] || [], e), o = Object.keys(a), t = l.find((p) => o.includes(p));
431
+ return t ? a[t] : !1;
432
432
  }
433
433
  function ue(e) {
434
- const i = Object.keys(r);
435
- return [].concat(i.map((o) => r[o])).some(function(o) {
434
+ const a = Object.keys(r);
435
+ return [].concat(a.map((o) => r[o])).some(function(o) {
436
436
  return Array.isArray(o) ? o.includes(e) : o[e];
437
437
  });
438
438
  }
439
- function we(e, ...i) {
440
- return [].concat(...i).some(function(o) {
439
+ function we(e, ...a) {
440
+ return [].concat(...a).some(function(o) {
441
441
  const t = e.match(o);
442
442
  return t && ue(t[1]);
443
443
  });
@@ -445,17 +445,17 @@ class Ne {
445
445
  function ve(e) {
446
446
  if (e.match(L) || !e.match(/^-[^-]+/))
447
447
  return !1;
448
- let i = !0, l;
448
+ let a = !0, l;
449
449
  const o = e.slice(1).split("");
450
450
  for (let t = 0; t < o.length; t++) {
451
451
  if (l = e.slice(t + 2), !ue(o[t])) {
452
- i = !1;
452
+ a = !1;
453
453
  break;
454
454
  }
455
455
  if (o[t + 1] && o[t + 1] === "=" || l === "-" || /[A-Za-z]/.test(o[t]) && /^-?\d+(\.\d*)?(e-?\d+)?$/.test(l) || o[t + 1] && o[t + 1].match(/\W/))
456
456
  break;
457
457
  }
458
- return i;
458
+ return a;
459
459
  }
460
460
  function H(e) {
461
461
  return h["unknown-options-as-args"] && xe(e);
@@ -475,8 +475,8 @@ class Ne {
475
475
  }[e];
476
476
  }
477
477
  function Be(e) {
478
- let i = I.BOOLEAN;
479
- return g(e, r.strings) ? i = I.STRING : g(e, r.numbers) ? i = I.NUMBER : g(e, r.bools) ? i = I.BOOLEAN : g(e, r.arrays) && (i = I.ARRAY), i;
478
+ let a = I.BOOLEAN;
479
+ return g(e, r.strings) ? a = I.STRING : g(e, r.numbers) ? a = I.NUMBER : g(e, r.bools) ? a = I.BOOLEAN : g(e, r.arrays) && (a = I.ARRAY), a;
480
480
  }
481
481
  function T(e) {
482
482
  return e === void 0;
@@ -494,38 +494,38 @@ class Ne {
494
494
  };
495
495
  }
496
496
  }
497
- function ze(a) {
497
+ function ze(i) {
498
498
  const n = [], m = /* @__PURE__ */ Object.create(null);
499
499
  let s = !0;
500
- for (Object.keys(a).forEach(function(u) {
501
- n.push([].concat(a[u], u));
500
+ for (Object.keys(i).forEach(function(u) {
501
+ n.push([].concat(i[u], u));
502
502
  }); s; ) {
503
503
  s = !1;
504
504
  for (let u = 0; u < n.length; u++)
505
- for (let _ = u + 1; _ < n.length; _++)
505
+ for (let k = u + 1; k < n.length; k++)
506
506
  if (n[u].filter(function(h) {
507
- return n[_].indexOf(h) !== -1;
507
+ return n[k].indexOf(h) !== -1;
508
508
  }).length) {
509
- n[u] = n[u].concat(n[_]), n.splice(_, 1), s = !0;
509
+ n[u] = n[u].concat(n[k]), n.splice(k, 1), s = !0;
510
510
  break;
511
511
  }
512
512
  }
513
513
  return n.forEach(function(u) {
514
- u = u.filter(function(k, h, f) {
515
- return f.indexOf(k) === h;
514
+ u = u.filter(function(_, h, f) {
515
+ return f.indexOf(_) === h;
516
516
  });
517
- const _ = u.pop();
518
- _ !== void 0 && typeof _ == "string" && (m[_] = u);
517
+ const k = u.pop();
518
+ k !== void 0 && typeof k == "string" && (m[k] = u);
519
519
  }), m;
520
520
  }
521
- function Z(a) {
522
- return a !== void 0 ? a + 1 : 1;
521
+ function Z(i) {
522
+ return i !== void 0 ? i + 1 : 1;
523
523
  }
524
- function le(a) {
525
- return a === "__proto__" ? "___proto___" : a;
524
+ function le(i) {
525
+ return i === "__proto__" ? "___proto___" : i;
526
526
  }
527
- function je(a) {
528
- return typeof a == "string" && (a[0] === "'" || a[0] === '"') && a[a.length - 1] === a[0] ? a.substring(1, a.length - 1) : a;
527
+ function je(i) {
528
+ return typeof i == "string" && (i[0] === "'" || i[0] === '"') && i[i.length - 1] === i[0] ? i.substring(1, i.length - 1) : i;
529
529
  }
530
530
  /**
531
531
  * @fileoverview Main entrypoint for libraries using yargs-parser in Node.js
@@ -545,27 +545,27 @@ new Ne({
545
545
  env: () => Qe,
546
546
  format: he,
547
547
  normalize: Ie,
548
- resolve: ie,
548
+ resolve: ae,
549
549
  // TODO: figure out a way to combine ESM and CJS coverage, such that
550
550
  // we can exercise all the lines below:
551
- require: (a) => {
551
+ require: (i) => {
552
552
  if (typeof require < "u")
553
- return require(a);
554
- if (a.match(/\.json$/))
555
- return JSON.parse(ke(a, "utf8"));
553
+ return require(i);
554
+ if (i.match(/\.json$/))
555
+ return JSON.parse(_e(i, "utf8"));
556
556
  throw Error("only .json config files are supported in ESM");
557
557
  }
558
558
  });
559
559
  const Fe = {
560
560
  fs: {
561
- readFileSync: ke,
561
+ readFileSync: _e,
562
562
  writeFile: Le
563
563
  },
564
564
  format: he,
565
- resolve: ie,
566
- exists: (a) => {
565
+ resolve: ae,
566
+ exists: (i) => {
567
567
  try {
568
- return Pe(a).isFile();
568
+ return Pe(i).isFile();
569
569
  } catch {
570
570
  return !1;
571
571
  }
@@ -591,20 +591,20 @@ class De {
591
591
  }
592
592
  __n() {
593
593
  const n = Array.prototype.slice.call(arguments), m = n.shift(), s = n.shift(), u = n.shift();
594
- let _ = function() {
594
+ let k = function() {
595
595
  };
596
- typeof n[n.length - 1] == "function" && (_ = n.pop()), this.cache[this.locale] || this._readLocaleFile();
597
- let k = u === 1 ? m : s;
598
- this.cache[this.locale][m] && (k = this.cache[this.locale][m][u === 1 ? "one" : "other"]), !this.cache[this.locale][m] && this.updateFiles ? (this.cache[this.locale][m] = {
596
+ typeof n[n.length - 1] == "function" && (k = n.pop()), this.cache[this.locale] || this._readLocaleFile();
597
+ let _ = u === 1 ? m : s;
598
+ this.cache[this.locale][m] && (_ = this.cache[this.locale][m][u === 1 ? "one" : "other"]), !this.cache[this.locale][m] && this.updateFiles ? (this.cache[this.locale][m] = {
599
599
  one: m,
600
600
  other: s
601
601
  }, this._enqueueWrite({
602
602
  directory: this.directory,
603
603
  locale: this.locale,
604
- cb: _
605
- })) : _();
606
- const h = [k];
607
- return ~k.indexOf("%d") && h.push(u), M.format.apply(M.format, h.concat(n));
604
+ cb: k
605
+ })) : k();
606
+ const h = [_];
607
+ return ~_.indexOf("%d") && h.push(u), M.format.apply(M.format, h.concat(n));
608
608
  }
609
609
  setLocale(n) {
610
610
  this.locale = n;
@@ -619,18 +619,18 @@ class De {
619
619
  }
620
620
  _taggedLiteral(n, ...m) {
621
621
  let s = "";
622
- return n.forEach(function(u, _) {
623
- const k = m[_ + 1];
624
- s += u, typeof k < "u" && (s += "%s");
622
+ return n.forEach(function(u, k) {
623
+ const _ = m[k + 1];
624
+ s += u, typeof _ < "u" && (s += "%s");
625
625
  }), this.__.apply(this, [s].concat([].slice.call(m, 1)));
626
626
  }
627
627
  _enqueueWrite(n) {
628
628
  this.writeQueue.push(n), this.writeQueue.length === 1 && this._processWriteQueue();
629
629
  }
630
630
  _processWriteQueue() {
631
- const n = this, m = this.writeQueue[0], s = m.directory, u = m.locale, _ = m.cb, k = this._resolveLocaleFile(s, u), h = JSON.stringify(this.cache[u], null, 2);
632
- M.fs.writeFile(k, h, "utf-8", function(f) {
633
- n.writeQueue.shift(), n.writeQueue.length > 0 && n._processWriteQueue(), _(f);
631
+ const n = this, m = this.writeQueue[0], s = m.directory, u = m.locale, k = m.cb, _ = this._resolveLocaleFile(s, u), h = JSON.stringify(this.cache[u], null, 2);
632
+ M.fs.writeFile(_, h, "utf-8", function(f) {
633
+ n.writeQueue.shift(), n.writeQueue.length > 0 && n._processWriteQueue(), k(f);
634
634
  });
635
635
  }
636
636
  _readLocaleFile() {
@@ -658,9 +658,9 @@ class De {
658
658
  return M.exists(n);
659
659
  }
660
660
  }
661
- function Ve(a, n) {
661
+ function Ve(i, n) {
662
662
  M = n;
663
- const m = new De(a);
663
+ const m = new De(i);
664
664
  return {
665
665
  __: m.__.bind(m),
666
666
  __n: m.__n.bind(m),
@@ -670,7 +670,7 @@ function Ve(a, n) {
670
670
  locale: m.locale
671
671
  };
672
672
  }
673
- const $e = (a) => Ve(a, Fe);
673
+ const $e = (i) => Ve(i, Fe);
674
674
  let z;
675
675
  try {
676
676
  z = Te(import.meta.url);
@@ -679,10 +679,10 @@ try {
679
679
  }
680
680
  const He = z.substring(0, z.lastIndexOf("node_modules"));
681
681
  He || process.cwd(), process.cwd, process.exit, process.nextTick, typeof process.stdout.columns < "u" && process.stdout.columns, $e({
682
- directory: ie(z, "../../../locales"),
682
+ directory: ae(z, "../../../locales"),
683
683
  updateFiles: !1
684
684
  });
685
- const ae = [
685
+ const ie = [
686
686
  {
687
687
  id: "anthropic",
688
688
  name: "Anthropic",
@@ -1147,13 +1147,13 @@ const ae = [
1147
1147
  ],
1148
1148
  models: [
1149
1149
  {
1150
- id: "meta.llama3-8b-instruct-v1%3A0",
1150
+ id: "meta.llama3-8b-instruct-v1:0",
1151
1151
  match: {
1152
- equals: "meta.llama3-8b-instruct-v1%3A0"
1152
+ contains: "llama3-8b-instruct-v1"
1153
1153
  },
1154
1154
  prices: {
1155
- input_mtok: 220,
1156
- output_mtok: 720
1155
+ input_mtok: 0.3,
1156
+ output_mtok: 0.6
1157
1157
  }
1158
1158
  },
1159
1159
  {
@@ -1163,15 +1163,13 @@ const ae = [
1163
1163
  match: {
1164
1164
  or: [
1165
1165
  {
1166
- equals: "nova-lite-v1"
1167
- },
1168
- {
1169
- equals: "amazon.nova-lite-v1:0"
1166
+ contains: "nova-lite-v1"
1170
1167
  }
1171
1168
  ]
1172
1169
  },
1173
1170
  prices: {
1174
1171
  input_mtok: 0.06,
1172
+ cache_read_mtok: 0.015,
1175
1173
  output_mtok: 0.24
1176
1174
  }
1177
1175
  },
@@ -1182,15 +1180,13 @@ const ae = [
1182
1180
  match: {
1183
1181
  or: [
1184
1182
  {
1185
- equals: "nova-micro-v1"
1186
- },
1187
- {
1188
- equals: "amazon.nova-micro-v1:0"
1183
+ contains: "nova-micro-v1"
1189
1184
  }
1190
1185
  ]
1191
1186
  },
1192
1187
  prices: {
1193
1188
  input_mtok: 0.035,
1189
+ cache_read_mtok: 875e-5,
1194
1190
  output_mtok: 0.14
1195
1191
  }
1196
1192
  },
@@ -1201,15 +1197,13 @@ const ae = [
1201
1197
  match: {
1202
1198
  or: [
1203
1199
  {
1204
- equals: "nova-pro-v1"
1205
- },
1206
- {
1207
- equals: "amazon.nova-pro-v1:0"
1200
+ contains: "nova-pro-v1"
1208
1201
  }
1209
1202
  ]
1210
1203
  },
1211
1204
  prices: {
1212
1205
  input_mtok: 0.8,
1206
+ cache_read_mtok: 0.2,
1213
1207
  output_mtok: 3.2
1214
1208
  }
1215
1209
  }
@@ -1986,6 +1980,135 @@ const ae = [
1986
1980
  }
1987
1981
  ]
1988
1982
  },
1983
+ {
1984
+ id: "cerebras",
1985
+ name: "Cerebras",
1986
+ pricing_urls: ["https://www.cerebras.ai/pricing#pricing", "https://inference-docs.cerebras.ai/models/openai-oss"],
1987
+ api_pattern: "https://api\\.cerebras\\.ai",
1988
+ model_match: {
1989
+ contains: "cerebras"
1990
+ },
1991
+ provider_match: {
1992
+ contains: "cerebras"
1993
+ },
1994
+ extractors: [
1995
+ {
1996
+ api_flavor: "chat",
1997
+ root: "usage",
1998
+ model_path: "model",
1999
+ mappings: [
2000
+ {
2001
+ path: "prompt_tokens",
2002
+ dest: "input_tokens",
2003
+ required: !0
2004
+ },
2005
+ {
2006
+ path: "completion_tokens",
2007
+ dest: "output_tokens",
2008
+ required: !0
2009
+ }
2010
+ ]
2011
+ }
2012
+ ],
2013
+ models: [
2014
+ {
2015
+ id: "gpt-oss-120b",
2016
+ name: "GPT-OSS 120B",
2017
+ description: "OpenAI's flagship open source model, built on a Mixture-of-Experts (MoE) architecture with 120 billion parameters and 128 experts. Delivers frontier reasoning capabilities with record-breaking inference speeds on Cerebras hardware (~3,000 tokens/second).",
2018
+ match: {
2019
+ or: [
2020
+ {
2021
+ equals: "gpt-oss-120b"
2022
+ },
2023
+ {
2024
+ starts_with: "cerebras/gpt-oss-120b"
2025
+ },
2026
+ {
2027
+ starts_with: "cerebras:gpt-oss-120b"
2028
+ }
2029
+ ]
2030
+ },
2031
+ context_window: 131072,
2032
+ price_comments: "Developer tier pricing. Free tier: 65k context, Paid tier: 131k context.",
2033
+ prices: {
2034
+ input_mtok: 0.35,
2035
+ output_mtok: 0.75
2036
+ }
2037
+ },
2038
+ {
2039
+ id: "llama-3.3-70b",
2040
+ name: "Llama 3.3 70B",
2041
+ description: "Meta's enhanced 70B model delivering 405B-level accuracy. Optimized for chat, coding, instruction following, mathematics, and reasoning with high-speed inference on Cerebras hardware (~2,100 tokens/second).",
2042
+ match: {
2043
+ or: [
2044
+ {
2045
+ equals: "llama-3.3-70b"
2046
+ },
2047
+ {
2048
+ starts_with: "cerebras/llama-3.3-70b"
2049
+ },
2050
+ {
2051
+ starts_with: "cerebras:llama-3.3-70b"
2052
+ }
2053
+ ]
2054
+ },
2055
+ context_window: 128e3,
2056
+ price_comments: "Developer tier pricing. Free tier: 65k context, Paid tier: 128k context.",
2057
+ prices: {
2058
+ input_mtok: 0.85,
2059
+ output_mtok: 1.2
2060
+ }
2061
+ },
2062
+ {
2063
+ id: "llama3.1-8b",
2064
+ name: "Llama 3.1 8B",
2065
+ description: "Meta's Llama 3.1 8B model for general-purpose tasks including chat, coding, and instruction following. Optimized for fast inference on Cerebras hardware (~2,200 tokens/second).",
2066
+ match: {
2067
+ or: [
2068
+ {
2069
+ equals: "llama3.1-8b"
2070
+ },
2071
+ {
2072
+ starts_with: "cerebras/llama3.1-8b"
2073
+ },
2074
+ {
2075
+ starts_with: "cerebras:llama3.1-8b"
2076
+ }
2077
+ ]
2078
+ },
2079
+ context_window: 32768,
2080
+ price_comments: "Developer tier pricing. Free tier: 8k context, Paid tier: 32k context.",
2081
+ prices: {
2082
+ input_mtok: 0.1,
2083
+ output_mtok: 0.1
2084
+ }
2085
+ },
2086
+ {
2087
+ id: "qwen-3-32b",
2088
+ name: "Qwen 3 32B",
2089
+ description: "Qwen's 32B parameter model with enhanced reasoning and coding capabilities. Supports both standard and reasoning modes for complex tasks, with fast inference speeds on Cerebras hardware (~2,600 tokens/second).",
2090
+ match: {
2091
+ or: [
2092
+ {
2093
+ equals: "qwen-3-32b"
2094
+ },
2095
+ {
2096
+ starts_with: "cerebras/qwen-3-32b"
2097
+ },
2098
+ {
2099
+ starts_with: "cerebras:qwen-3-32b"
2100
+ }
2101
+ ]
2102
+ },
2103
+ context_window: 131072,
2104
+ price_comments: "Developer tier pricing. Free tier: 65k context, Paid tier: 131k context.",
2105
+ prices: {
2106
+ input_mtok: 0.4,
2107
+ output_mtok: 0.8
2108
+ }
2109
+ }
2110
+ ]
2111
+ },
1989
2112
  {
1990
2113
  id: "cohere",
1991
2114
  name: "Cohere",
@@ -3084,6 +3207,16 @@ Compared to other leading proprietary and open-weights models Command A delivers
3084
3207
  output_mtok: 0.99
3085
3208
  }
3086
3209
  },
3210
+ {
3211
+ id: "gemma-7b-it",
3212
+ match: {
3213
+ equals: "gemma-7b-it"
3214
+ },
3215
+ prices: {
3216
+ input_mtok: 0.07,
3217
+ output_mtok: 0.07
3218
+ }
3219
+ },
3087
3220
  {
3088
3221
  id: "gemma2-9b-it",
3089
3222
  name: "Gemma 2 9B 8k",
@@ -3102,6 +3235,26 @@ Compared to other leading proprietary and open-weights models Command A delivers
3102
3235
  output_mtok: 0.2
3103
3236
  }
3104
3237
  },
3238
+ {
3239
+ id: "llama-3.1-405b-reasoning",
3240
+ match: {
3241
+ equals: "llama-3.1-405b-reasoning"
3242
+ },
3243
+ prices: {
3244
+ input_mtok: 0.59,
3245
+ output_mtok: 0.79
3246
+ }
3247
+ },
3248
+ {
3249
+ id: "llama-3.1-70b-versatile",
3250
+ match: {
3251
+ equals: "llama-3.1-70b-versatile"
3252
+ },
3253
+ prices: {
3254
+ input_mtok: 0.59,
3255
+ output_mtok: 0.79
3256
+ }
3257
+ },
3105
3258
  {
3106
3259
  id: "llama-3.1-8b-instant",
3107
3260
  name: "Llama 3.1 8B Instant 128k",
@@ -3113,6 +3266,76 @@ Compared to other leading proprietary and open-weights models Command A delivers
3113
3266
  output_mtok: 0.08
3114
3267
  }
3115
3268
  },
3269
+ {
3270
+ id: "llama-3.2-11b-text-preview",
3271
+ match: {
3272
+ equals: "llama-3.2-11b-text-preview"
3273
+ },
3274
+ prices: {
3275
+ input_mtok: 0.18,
3276
+ output_mtok: 0.18
3277
+ }
3278
+ },
3279
+ {
3280
+ id: "llama-3.2-11b-vision-preview",
3281
+ match: {
3282
+ equals: "llama-3.2-11b-vision-preview"
3283
+ },
3284
+ prices: {
3285
+ input_mtok: 0.18,
3286
+ output_mtok: 0.18
3287
+ }
3288
+ },
3289
+ {
3290
+ id: "llama-3.2-1b-preview",
3291
+ match: {
3292
+ equals: "llama-3.2-1b-preview"
3293
+ },
3294
+ prices: {
3295
+ input_mtok: 0.04,
3296
+ output_mtok: 0.04
3297
+ }
3298
+ },
3299
+ {
3300
+ id: "llama-3.2-3b-preview",
3301
+ match: {
3302
+ equals: "llama-3.2-3b-preview"
3303
+ },
3304
+ prices: {
3305
+ input_mtok: 0.06,
3306
+ output_mtok: 0.06
3307
+ }
3308
+ },
3309
+ {
3310
+ id: "llama-3.2-90b-text-preview",
3311
+ match: {
3312
+ equals: "llama-3.2-90b-text-preview"
3313
+ },
3314
+ prices: {
3315
+ input_mtok: 0.9,
3316
+ output_mtok: 0.9
3317
+ }
3318
+ },
3319
+ {
3320
+ id: "llama-3.2-90b-vision-preview",
3321
+ match: {
3322
+ equals: "llama-3.2-90b-vision-preview"
3323
+ },
3324
+ prices: {
3325
+ input_mtok: 0.9,
3326
+ output_mtok: 0.9
3327
+ }
3328
+ },
3329
+ {
3330
+ id: "llama-3.3-70b-specdec",
3331
+ match: {
3332
+ equals: "llama-3.3-70b-specdec"
3333
+ },
3334
+ prices: {
3335
+ input_mtok: 0.59,
3336
+ output_mtok: 0.99
3337
+ }
3338
+ },
3116
3339
  {
3117
3340
  id: "llama-3.3-70b-versatile",
3118
3341
  name: "Llama 3.3 70B Versatile 128k",
@@ -3124,6 +3347,16 @@ Compared to other leading proprietary and open-weights models Command A delivers
3124
3347
  output_mtok: 0.79
3125
3348
  }
3126
3349
  },
3350
+ {
3351
+ id: "llama-guard-3-8b",
3352
+ match: {
3353
+ equals: "llama-guard-3-8b"
3354
+ },
3355
+ prices: {
3356
+ input_mtok: 0.2,
3357
+ output_mtok: 0.2
3358
+ }
3359
+ },
3127
3360
  {
3128
3361
  id: "llama2-70b-4096",
3129
3362
  match: {
@@ -3209,15 +3442,43 @@ Compared to other leading proprietary and open-weights models Command A delivers
3209
3442
  output_mtok: 0.2
3210
3443
  }
3211
3444
  },
3445
+ {
3446
+ id: "mistral-saba-24b",
3447
+ match: {
3448
+ equals: "mistral-saba-24b"
3449
+ },
3450
+ prices: {
3451
+ input_mtok: 0.79,
3452
+ output_mtok: 0.79
3453
+ }
3454
+ },
3455
+ {
3456
+ id: "mixtral-8x7b-32768",
3457
+ match: {
3458
+ equals: "mixtral-8x7b-32768"
3459
+ },
3460
+ prices: {
3461
+ input_mtok: 0.24,
3462
+ output_mtok: 0.24
3463
+ }
3464
+ },
3212
3465
  {
3213
3466
  id: "moonshotai/kimi-k2-instruct",
3214
3467
  name: "Kimi K2 1T 128k",
3215
3468
  match: {
3216
- equals: "moonshotai/kimi-k2-instruct"
3469
+ or: [
3470
+ {
3471
+ equals: "moonshotai/kimi-k2-instruct"
3472
+ },
3473
+ {
3474
+ equals: "moonshotai/kimi-k2-instruct-0905"
3475
+ }
3476
+ ]
3217
3477
  },
3218
3478
  context_window: 131072,
3219
3479
  prices: {
3220
3480
  input_mtok: 1,
3481
+ cache_read_mtok: 0.5,
3221
3482
  output_mtok: 3
3222
3483
  }
3223
3484
  },
@@ -3227,12 +3488,20 @@ Compared to other leading proprietary and open-weights models Command A delivers
3227
3488
  120 billion parameters and 128 experts.
3228
3489
  `,
3229
3490
  match: {
3230
- equals: "openai/gpt-oss-120b"
3491
+ or: [
3492
+ {
3493
+ equals: "openai/gpt-oss-120b"
3494
+ },
3495
+ {
3496
+ equals: "openai/gpt-oss-safeguard-20b"
3497
+ }
3498
+ ]
3231
3499
  },
3232
3500
  context_window: 131072,
3233
3501
  prices: {
3234
3502
  input_mtok: 0.15,
3235
- output_mtok: 0.75
3503
+ cache_read_mtok: 0.075,
3504
+ output_mtok: 0.6
3236
3505
  }
3237
3506
  },
3238
3507
  {
@@ -3245,8 +3514,9 @@ Compared to other leading proprietary and open-weights models Command A delivers
3245
3514
  },
3246
3515
  context_window: 131072,
3247
3516
  prices: {
3248
- input_mtok: 0.1,
3249
- output_mtok: 0.5
3517
+ input_mtok: 0.075,
3518
+ cache_read_mtok: 0.0375,
3519
+ output_mtok: 0.3
3250
3520
  }
3251
3521
  },
3252
3522
  {
@@ -4060,6 +4330,18 @@ Compared to other leading proprietary and open-weights models Command A delivers
4060
4330
  required: !0
4061
4331
  }
4062
4332
  ]
4333
+ },
4334
+ {
4335
+ api_flavor: "embeddings",
4336
+ root: "usage",
4337
+ model_path: "model",
4338
+ mappings: [
4339
+ {
4340
+ path: "prompt_tokens",
4341
+ dest: "input_tokens",
4342
+ required: !0
4343
+ }
4344
+ ]
4063
4345
  }
4064
4346
  ],
4065
4347
  models: [
@@ -4771,11 +5053,42 @@ Compared to other leading proprietary and open-weights models Command A delivers
4771
5053
  }
4772
5054
  ]
4773
5055
  },
5056
+ context_window: 4e5,
4774
5057
  prices: {
4775
5058
  input_mtok: 15,
4776
5059
  output_mtok: 120
4777
5060
  }
4778
5061
  },
5062
+ {
5063
+ id: "gpt-5.1",
5064
+ name: "GPT-5.1",
5065
+ description: "The best model for coding and agentic tasks across industries",
5066
+ match: {
5067
+ or: [
5068
+ {
5069
+ equals: "gpt-5.1"
5070
+ },
5071
+ {
5072
+ equals: "gpt-5.1-2025-11-13"
5073
+ },
5074
+ {
5075
+ equals: "gpt-5.1-codex"
5076
+ },
5077
+ {
5078
+ equals: "gpt-5.1-mini"
5079
+ },
5080
+ {
5081
+ equals: "gpt-5.1-chat-latest"
5082
+ }
5083
+ ]
5084
+ },
5085
+ context_window: 4e5,
5086
+ prices: {
5087
+ input_mtok: 1.25,
5088
+ cache_read_mtok: 0.125,
5089
+ output_mtok: 10
5090
+ }
5091
+ },
4779
5092
  {
4780
5093
  id: "gpt-realtime",
4781
5094
  match: {
@@ -12218,37 +12531,37 @@ Compared to other leading proprietary and open-weights models Command A delivers
12218
12531
  ]
12219
12532
  }
12220
12533
  ];
12221
- function We(a, n) {
12534
+ function We(i, n) {
12222
12535
  if (n <= 0) return 0;
12223
12536
  let m = 0;
12224
- const s = [...a.tiers].sort((k, h) => k.start - h.start), u = s[0]?.start ?? n, _ = Math.min(n, u);
12225
- m += _ * a.base / 1e6;
12226
- for (let k = 0; k < s.length; k++) {
12227
- const h = s[k], f = s[k + 1]?.start ?? 1 / 0, y = Math.max(0, Math.min(n, f) - h.start);
12537
+ const s = [...i.tiers].sort((_, h) => _.start - h.start), u = s[0]?.start ?? n, k = Math.min(n, u);
12538
+ m += k * i.base / 1e6;
12539
+ for (let _ = 0; _ < s.length; _++) {
12540
+ const h = s[_], f = s[_ + 1]?.start ?? 1 / 0, y = Math.max(0, Math.min(n, f) - h.start);
12228
12541
  y > 0 && (m += y * h.price / 1e6);
12229
12542
  }
12230
12543
  return m;
12231
12544
  }
12232
- function O(a, n, m) {
12233
- return a === void 0 || n === void 0 ? 0 : typeof a == "number" ? a * n / 1e6 : We(a, n);
12545
+ function O(i, n, m) {
12546
+ return i === void 0 || n === void 0 ? 0 : typeof i == "number" ? i * n / 1e6 : We(i, n);
12234
12547
  }
12235
- function Ue(a, n) {
12548
+ function Ue(i, n) {
12236
12549
  let m = 0, s = 0;
12237
- const u = a.cache_read_tokens ?? 0, _ = a.cache_write_tokens ?? 0, k = a.cache_audio_read_tokens ?? 0, h = a.output_audio_tokens ?? 0;
12238
- let f = a.input_audio_tokens ?? 0;
12239
- if (f -= k, f < 0)
12550
+ const u = i.cache_read_tokens ?? 0, k = i.cache_write_tokens ?? 0, _ = i.cache_audio_read_tokens ?? 0, h = i.output_audio_tokens ?? 0;
12551
+ let f = i.input_audio_tokens ?? 0;
12552
+ if (f -= _, f < 0)
12240
12553
  throw new Error("cache_audio_read_tokens cannot be greater than input_audio_tokens");
12241
- let y = a.input_tokens ?? 0;
12242
- if (y -= u, y -= _, y -= f, y < 0)
12554
+ let y = i.input_tokens ?? 0;
12555
+ if (y -= u, y -= k, y -= f, y < 0)
12243
12556
  throw new Error("Uncached text input tokens cannot be negative");
12244
12557
  let P = u;
12245
- if (P -= k, P < 0)
12558
+ if (P -= _, P < 0)
12246
12559
  throw new Error("cache_audio_read_tokens cannot be greater than cache_read_tokens");
12247
- m += O(n.input_mtok, y), m += O(n.cache_read_mtok, P), m += O(n.cache_write_mtok, _), m += O(n.input_audio_mtok, f), m += O(n.cache_audio_read_mtok, k);
12248
- let S = a.output_tokens ?? 0;
12560
+ m += O(n.input_mtok, y), m += O(n.cache_read_mtok, P), m += O(n.cache_write_mtok, k), m += O(n.input_audio_mtok, f), m += O(n.cache_audio_read_mtok, _);
12561
+ let S = i.output_tokens ?? 0;
12249
12562
  if (S -= h, S < 0)
12250
12563
  throw new Error("output_audio_tokens cannot be greater than output_tokens");
12251
- s += O(n.output_mtok, S), s += O(n.output_audio_mtok, a.output_audio_tokens);
12564
+ s += O(n.output_mtok, S), s += O(n.output_audio_mtok, i.output_audio_tokens);
12252
12565
  let G = m + s;
12253
12566
  return n.requests_kcount !== void 0 && (G += n.requests_kcount / 1e3), {
12254
12567
  input_price: m,
@@ -12256,56 +12569,56 @@ function Ue(a, n) {
12256
12569
  total_price: G
12257
12570
  };
12258
12571
  }
12259
- function Ke(a, n) {
12260
- if (!Array.isArray(a.prices))
12261
- return a.prices;
12262
- for (let m = a.prices.length - 1; m >= 0; m--) {
12263
- const s = a.prices[m], u = s.constraint;
12572
+ function Ke(i, n) {
12573
+ if (!Array.isArray(i.prices))
12574
+ return i.prices;
12575
+ for (let m = i.prices.length - 1; m >= 0; m--) {
12576
+ const s = i.prices[m], u = s.constraint;
12264
12577
  if (u === void 0)
12265
12578
  return s.prices;
12266
12579
  if (u.type === "start_date") {
12267
12580
  if (n >= new Date(u.start_date))
12268
12581
  return s.prices;
12269
12582
  } else {
12270
- const _ = n.toISOString().slice(11, 19), k = u.start_time, h = u.end_time;
12271
- if (h < k) {
12272
- if (_ >= k || _ < h)
12583
+ const k = n.toISOString().slice(11, 19), _ = u.start_time, h = u.end_time;
12584
+ if (h < _) {
12585
+ if (k >= _ || k < h)
12273
12586
  return s.prices;
12274
- } else if (_ >= k && _ < h)
12587
+ } else if (k >= _ && k < h)
12275
12588
  return s.prices;
12276
12589
  }
12277
12590
  }
12278
- return a.prices[0].prices;
12591
+ return i.prices[0].prices;
12279
12592
  }
12280
- function j(a, n) {
12281
- return "or" in a ? a.or.some((m) => j(m, n)) : "and" in a ? a.and.every((m) => j(m, n)) : "equals" in a ? n === a.equals : "starts_with" in a ? n.startsWith(a.starts_with) : "ends_with" in a ? n.endsWith(a.ends_with) : "contains" in a ? n.includes(a.contains) : "regex" in a ? new RegExp(a.regex).test(n) : !1;
12593
+ function j(i, n) {
12594
+ return "or" in i ? i.or.some((m) => j(m, n)) : "and" in i ? i.and.every((m) => j(m, n)) : "equals" in i ? n === i.equals : "starts_with" in i ? n.startsWith(i.starts_with) : "ends_with" in i ? n.endsWith(i.ends_with) : "contains" in i ? n.includes(i.contains) : "regex" in i ? new RegExp(i.regex).test(n) : !1;
12282
12595
  }
12283
- function Ye(a, n) {
12284
- const m = n.toLowerCase().trim(), s = a.find((u) => u.id === m);
12285
- return s || a.find((u) => u.provider_match && j(u.provider_match, m));
12596
+ function Ye(i, n) {
12597
+ const m = n.toLowerCase().trim(), s = i.find((u) => u.id === m);
12598
+ return s || i.find((u) => u.provider_match && j(u.provider_match, m));
12286
12599
  }
12287
- function Je(a, { modelId: n, providerApiUrl: m, providerId: s }) {
12600
+ function Je(i, { modelId: n, providerApiUrl: m, providerId: s }) {
12288
12601
  if (s)
12289
- return Ye(a, s);
12602
+ return Ye(i, s);
12290
12603
  if (m)
12291
- return a.find((u) => new RegExp(u.api_pattern).test(m));
12604
+ return i.find((u) => new RegExp(u.api_pattern).test(m));
12292
12605
  if (n)
12293
- return a.find((u) => u.model_match && j(u.model_match, n));
12606
+ return i.find((u) => u.model_match && j(u.model_match, n));
12294
12607
  }
12295
- function Ze(a, n) {
12296
- return a.find((m) => j(m.match, n));
12608
+ function Ze(i, n) {
12609
+ return i.find((m) => j(m.match, n));
12297
12610
  }
12298
- let Xe = ae;
12299
- Promise.resolve(ae);
12300
- function et(a, n, m) {
12611
+ let Xe = ie;
12612
+ Promise.resolve(ie);
12613
+ function et(i, n, m) {
12301
12614
  const s = n.toLowerCase().trim(), u = m?.provider ?? Je(Xe, { modelId: s, providerApiUrl: m?.providerApiUrl, providerId: m?.providerId });
12302
12615
  if (!u) return null;
12303
- const _ = Ze(u.models, s);
12304
- if (!_) return null;
12305
- const k = m?.timestamp ?? /* @__PURE__ */ new Date(), h = Ke(_, k), f = Ue(a, h);
12616
+ const k = Ze(u.models, s);
12617
+ if (!k) return null;
12618
+ const _ = m?.timestamp ?? /* @__PURE__ */ new Date(), h = Ke(k, _), f = Ue(i, h);
12306
12619
  return {
12307
12620
  auto_update_timestamp: void 0,
12308
- model: _,
12621
+ model: k,
12309
12622
  model_price: h,
12310
12623
  provider: u,
12311
12624
  ...f
@@ -12314,15 +12627,15 @@ function et(a, n, m) {
12314
12627
  const b = de(Ce(process.argv)).scriptName("genai-prices").command(
12315
12628
  "list [provider]",
12316
12629
  "List providers and models",
12317
- (a) => a.positional("provider", { describe: "Provider ID to filter", type: "string" })
12630
+ (i) => i.positional("provider", { describe: "Provider ID to filter", type: "string" })
12318
12631
  ).command(
12319
12632
  "calc <model...>",
12320
12633
  "Calculate price",
12321
- (a) => a.positional("model", { array: !0, describe: "Model(s) (optionally provider:model)", type: "string" }).option("input-tokens", { type: "number" }).option("cache-write-tokens", { type: "number" }).option("cache-read-tokens", { type: "number" }).option("output-tokens", { type: "number" }).option("input-audio-tokens", { type: "number" }).option("cache-audio-read-tokens", { type: "number" }).option("output-audio-tokens", { type: "number" }).option("requests", { type: "number" }).option("provider", { type: "string" }).option("auto-update", { default: !1, type: "boolean" }).option("timestamp", { describe: "RFC3339 timestamp", type: "string" })
12634
+ (i) => i.positional("model", { array: !0, describe: "Model(s) (optionally provider:model)", type: "string" }).option("input-tokens", { type: "number" }).option("cache-write-tokens", { type: "number" }).option("cache-read-tokens", { type: "number" }).option("output-tokens", { type: "number" }).option("input-audio-tokens", { type: "number" }).option("cache-audio-read-tokens", { type: "number" }).option("output-audio-tokens", { type: "number" }).option("requests", { type: "number" }).option("provider", { type: "string" }).option("auto-update", { default: !1, type: "boolean" }).option("timestamp", { describe: "RFC3339 timestamp", type: "string" })
12322
12635
  ).option("auto-update", { describe: "Enable auto-update from GitHub", type: "boolean" }).option("input-tokens", { type: "number" }).option("cache-write-tokens", { type: "number" }).option("cache-read-tokens", { type: "number" }).option("output-tokens", { type: "number" }).option("input-audio-tokens", { type: "number" }).option("cache-audio-read-tokens", { type: "number" }).option("output-audio-tokens", { type: "number" }).option("requests", { type: "number" }).option("provider", { type: "string" }).option("timestamp", { describe: "RFC3339 timestamp", type: "string" }).version("0.1.0").help().parseSync();
12323
12636
  function tt() {
12324
12637
  if (b._[0] === "list") {
12325
- const m = ae;
12638
+ const m = ie;
12326
12639
  if (b.provider) {
12327
12640
  const s = m.find((u) => u.id === b.provider);
12328
12641
  s || (console.error(`Provider ${b.provider} not found.`), process.exit(1)), console.log(`${s.name}: (${s.models.length} models)`);
@@ -12349,13 +12662,13 @@ function tt() {
12349
12662
  requests: b.requests !== void 0 ? Number(b.requests) : void 0
12350
12663
  }, s = b.timestamp ? new Date(String(b.timestamp)) : void 0;
12351
12664
  let u = !1;
12352
- for (const _ of n) {
12353
- let k, h = _;
12354
- h.includes(":") && ([k, h] = h.split(":", 2));
12665
+ for (const k of n) {
12666
+ let _, h = k;
12667
+ h.includes(":") && ([_, h] = h.split(":", 2));
12355
12668
  try {
12356
- const f = et(m, h, { providerId: k, timestamp: s });
12669
+ const f = et(m, h, { providerId: _, timestamp: s });
12357
12670
  if (!f) {
12358
- u = !0, console.error(`No price found for model ${_}`);
12671
+ u = !0, console.error(`No price found for model ${k}`);
12359
12672
  continue;
12360
12673
  }
12361
12674
  const y = f.model.context_window, P = [
@@ -12371,7 +12684,7 @@ function tt() {
12371
12684
  G !== void 0 && console.log(`${S.padStart(14)}: ${G}`);
12372
12685
  console.log("");
12373
12686
  } catch (f) {
12374
- u = !0, f instanceof Error && console.error(`Error for model ${_}:`, f.message);
12687
+ u = !0, f instanceof Error && console.error(`Error for model ${k}:`, f.message);
12375
12688
  }
12376
12689
  }
12377
12690
  process.exit(u ? 1 : 0);