@pydantic/genai-prices 0.0.41 → 0.0.42
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 +522 -209
- package/dist/index.cjs +2 -2
- package/dist/index.js +348 -35
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import de from "yargs";
|
|
3
3
|
import { format as he } from "util";
|
|
4
|
-
import { resolve as
|
|
4
|
+
import { resolve as ae, normalize as Ie } from "path";
|
|
5
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";
|
|
@@ -14,53 +14,53 @@ function Se() {
|
|
|
14
14
|
function Ge() {
|
|
15
15
|
return !!process.versions.electron;
|
|
16
16
|
}
|
|
17
|
-
function Ce(
|
|
18
|
-
return
|
|
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(
|
|
26
|
-
if (
|
|
27
|
-
return
|
|
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 =
|
|
31
|
-
for (let k = u ? u[0].length : 0; k <
|
|
32
|
-
let _ =
|
|
30
|
+
const u = i.match(/^-+/);
|
|
31
|
+
for (let k = u ? u[0].length : 0; k < i.length; k++) {
|
|
32
|
+
let _ = i.charAt(k);
|
|
33
33
|
s && (s = !1, _ = _.toUpperCase()), k !== 0 && (_ === "-" || _ === "_") ? s = !0 : _ !== "-" && _ !== "_" && (m += _);
|
|
34
34
|
}
|
|
35
35
|
return m;
|
|
36
36
|
}
|
|
37
37
|
}
|
|
38
|
-
function Oe(
|
|
39
|
-
const m =
|
|
38
|
+
function Oe(i, n) {
|
|
39
|
+
const m = i.toLowerCase();
|
|
40
40
|
n = n || "-";
|
|
41
41
|
let s = "";
|
|
42
|
-
for (let u = 0; u <
|
|
43
|
-
const k = m.charAt(u), _ =
|
|
42
|
+
for (let u = 0; u < i.length; u++) {
|
|
43
|
+
const k = m.charAt(u), _ = i.charAt(u);
|
|
44
44
|
k !== _ && u > 0 ? s += `${n}${m.charAt(u)}` : s += _;
|
|
45
45
|
}
|
|
46
46
|
return s;
|
|
47
47
|
}
|
|
48
|
-
function Re(
|
|
49
|
-
return
|
|
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(
|
|
57
|
-
if (Array.isArray(
|
|
58
|
-
return
|
|
59
|
-
|
|
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
61
|
const k = [];
|
|
62
|
-
for (let _ = 0; _ <
|
|
63
|
-
if (m = s, s =
|
|
62
|
+
for (let _ = 0; _ < i.length; _++) {
|
|
63
|
+
if (m = s, s = i.charAt(_), s === " " && !u) {
|
|
64
64
|
m !== " " && n++;
|
|
65
65
|
continue;
|
|
66
66
|
}
|
|
@@ -74,8 +74,8 @@ function Ee(a) {
|
|
|
74
74
|
* SPDX-License-Identifier: ISC
|
|
75
75
|
*/
|
|
76
76
|
var I;
|
|
77
|
-
(function(
|
|
78
|
-
|
|
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
|
|
@@ -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
|
|
141
|
+
const a = typeof e == "object" ? e.key : e, c = 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
|
-
c && (r[c][
|
|
148
|
+
c && (r[c][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,
|
|
160
|
-
typeof
|
|
161
|
-
}), typeof s.coerce == "object" && Object.entries(s.coerce).forEach(([e,
|
|
162
|
-
typeof
|
|
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,
|
|
166
|
-
(typeof
|
|
165
|
+
}) : typeof s.config == "object" && Object.entries(s.config).forEach(([e, a]) => {
|
|
166
|
+
(typeof a == "boolean" || typeof a == "function") && (r.configs[e] = a);
|
|
167
167
|
})), qe(s.key, _, s.default, r.arrays), Object.keys(f).forEach(function(e) {
|
|
168
|
-
(r.aliases[e] || []).forEach(function(
|
|
169
|
-
f[
|
|
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
|
|
177
|
+
const a = u[e], c = a.replace(/^-{3,}/, "---");
|
|
178
178
|
let o, t, p, l, d, v;
|
|
179
|
-
if (
|
|
180
|
-
K(
|
|
179
|
+
if (a !== "--" && /^-/.test(a) && H(a))
|
|
180
|
+
K(a);
|
|
181
181
|
else if (c.match(/^---+(=|$)/)) {
|
|
182
|
-
K(
|
|
182
|
+
K(a);
|
|
183
183
|
continue;
|
|
184
|
-
} else if (
|
|
185
|
-
l =
|
|
186
|
-
else if (
|
|
187
|
-
l =
|
|
188
|
-
else if (
|
|
189
|
-
l =
|
|
190
|
-
else if (
|
|
191
|
-
l =
|
|
192
|
-
else if (
|
|
193
|
-
d = u[e + 1], l =
|
|
194
|
-
else if (
|
|
195
|
-
p =
|
|
184
|
+
} else if (a.match(/^--.+=/) || !h["short-option-groups"] && a.match(/^-.+=/))
|
|
185
|
+
l = a.match(/^--?([^=]+)=([\s\S]*)$/), l !== null && Array.isArray(l) && l.length >= 3 && (g(l[1], r.arrays) ? e = V(e, l[1], u, l[2]) : g(l[1], r.nargs) !== !1 ? e = D(e, l[1], u, l[2]) : q(l[1], l[2], !0));
|
|
186
|
+
else if (a.match(U) && h["boolean-negation"])
|
|
187
|
+
l = a.match(U), l !== null && Array.isArray(l) && l.length >= 2 && (t = l[1], q(t, g(t, r.arrays) ? [!1] : !1));
|
|
188
|
+
else if (a.match(/^--.+/) || !h["short-option-groups"] && a.match(/^-[^-]+/))
|
|
189
|
+
l = a.match(/^--?(.+)/), l !== null && Array.isArray(l) && l.length >= 2 && (t = l[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
|
+
l = a.match(/^-([^=]+)=([\s\S]*)$/), l !== null && Array.isArray(l) && l.length >= 3 && q(l[1], l[2]);
|
|
192
|
+
else if (a.match(/^-.\..+/) && !a.match(L))
|
|
193
|
+
d = u[e + 1], l = a.match(/^-(.\..+)/), l !== null && Array.isArray(l) && l.length >= 2 && (t = l[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 =
|
|
198
|
-
v =
|
|
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,17 +212,17 @@ class Ne {
|
|
|
212
212
|
} else
|
|
213
213
|
q(p[x], R(p[x]));
|
|
214
214
|
}
|
|
215
|
-
t =
|
|
216
|
-
} else if (
|
|
217
|
-
t =
|
|
218
|
-
else if (
|
|
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(
|
|
225
|
+
K(a);
|
|
226
226
|
}
|
|
227
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);
|
|
@@ -231,54 +231,54 @@ class Ne {
|
|
|
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
233
|
}), h["strip-aliased"] && [].concat(...Object.keys(_).map((e) => _[e])).forEach((e) => {
|
|
234
|
-
h["camel-case-expansion"] && e.includes("-") && delete w[e.split(".").map((
|
|
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
|
|
238
|
-
(typeof
|
|
237
|
+
const a = $("_", e);
|
|
238
|
+
(typeof a == "string" || typeof a == "number") && w._.push(a);
|
|
239
239
|
}
|
|
240
|
-
function D(e,
|
|
241
|
-
let t, p = g(
|
|
240
|
+
function D(e, a, c, 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",
|
|
243
|
+
return T(o) || (B = Error(C("Argument unexpected for: %s", a))), q(a, R(a)), e;
|
|
244
244
|
let l = T(o) ? 0 : 1;
|
|
245
245
|
if (h["nargs-eats-options"])
|
|
246
|
-
c.length - (e + 1) + l < p && (B = Error(C("Not enough arguments following: %s",
|
|
246
|
+
c.length - (e + 1) + l < p && (B = Error(C("Not enough arguments following: %s", a))), l = p;
|
|
247
247
|
else {
|
|
248
248
|
for (t = e + 1; t < c.length && (!c[t].match(/^-[^0-9]/) || c[t].match(L) || H(c[t])); t++)
|
|
249
249
|
l++;
|
|
250
|
-
l < p && (B = Error(C("Not enough arguments following: %s",
|
|
250
|
+
l < p && (B = Error(C("Not enough arguments following: %s", a)));
|
|
251
251
|
}
|
|
252
252
|
let d = Math.min(l, p);
|
|
253
|
-
for (!T(o) && d > 0 && (q(
|
|
254
|
-
q(
|
|
253
|
+
for (!T(o) && d > 0 && (q(a, o), d--), t = e + 1; t < d + e + 1; t++)
|
|
254
|
+
q(a, c[t]);
|
|
255
255
|
return e + d;
|
|
256
256
|
}
|
|
257
|
-
function V(e,
|
|
257
|
+
function V(e, a, c, o) {
|
|
258
258
|
let t = [], p = o || c[e + 1];
|
|
259
|
-
const l = g(
|
|
260
|
-
if (g(
|
|
259
|
+
const l = 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[
|
|
264
|
-
const d = f[
|
|
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(
|
|
268
|
+
T(o) || t.push(Y(a, o, !0));
|
|
269
269
|
for (let d = e + 1; d < c.length && !(!h["greedy-arrays"] && t.length > 0 || l && typeof l == "number" && t.length >= l || (p = c[d], /^-/.test(p) && !L.test(p) && !H(p))); d++)
|
|
270
|
-
e = d, t.push(Y(
|
|
270
|
+
e = d, t.push(Y(a, p, k));
|
|
271
271
|
}
|
|
272
|
-
return typeof l == "number" && (l && t.length < l || isNaN(l) && t.length === 0) && (B = Error(C("Not enough arguments following: %s",
|
|
272
|
+
return typeof l == "number" && (l && t.length < l || isNaN(l) && t.length === 0) && (B = Error(C("Not enough arguments following: %s", a))), q(a, t), e;
|
|
273
273
|
}
|
|
274
|
-
function q(e,
|
|
274
|
+
function q(e, a, c = k) {
|
|
275
275
|
if (/-/.test(e) && h["camel-case-expansion"]) {
|
|
276
276
|
const p = e.split(".").map(function(l) {
|
|
277
277
|
return W(l);
|
|
278
278
|
}).join(".");
|
|
279
279
|
se(e, p);
|
|
280
280
|
}
|
|
281
|
-
const o = Y(e,
|
|
281
|
+
const o = Y(e, a, c), t = e.split(".");
|
|
282
282
|
N(w, t, o), r.aliases[e] && r.aliases[e].forEach(function(p) {
|
|
283
283
|
const l = p.split(".");
|
|
284
284
|
N(w, l, o);
|
|
@@ -290,31 +290,31 @@ class Ne {
|
|
|
290
290
|
Object.defineProperty(ne, l, {
|
|
291
291
|
enumerable: !0,
|
|
292
292
|
get() {
|
|
293
|
-
return
|
|
293
|
+
return a;
|
|
294
294
|
},
|
|
295
295
|
set(d) {
|
|
296
|
-
|
|
296
|
+
a = typeof d == "string" ? A.normalize(d) : d;
|
|
297
297
|
}
|
|
298
298
|
});
|
|
299
299
|
});
|
|
300
300
|
}
|
|
301
|
-
function se(e,
|
|
302
|
-
r.aliases[e] && r.aliases[e].length || (r.aliases[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,
|
|
305
|
-
c && (
|
|
306
|
-
let o = Array.isArray(
|
|
304
|
+
function Y(e, a, c) {
|
|
305
|
+
c && (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,
|
|
309
|
-
return g(e, r.counts) && (T(o) || typeof o == "boolean") && (o = Z()), g(e, r.normalize) && g(e, r.arrays) && (Array.isArray(
|
|
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,
|
|
312
|
-
return !h["parse-positional-numbers"] && e === "_" || !g(e, r.strings) && !g(e, r.bools) && !Array.isArray(
|
|
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
314
|
function ke(e) {
|
|
315
|
-
const
|
|
316
|
-
me(
|
|
317
|
-
const o = e[c] ||
|
|
315
|
+
const a = /* @__PURE__ */ Object.create(null);
|
|
316
|
+
me(a, r.aliases, f), Object.keys(r.configs).forEach(function(c) {
|
|
317
|
+
const o = e[c] || a[c];
|
|
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,
|
|
340
|
+
function J(e, a) {
|
|
341
341
|
Object.keys(e).forEach(function(c) {
|
|
342
|
-
const o = e[c], t =
|
|
342
|
+
const o = e[c], t = a ? a + "." + c : c;
|
|
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,
|
|
351
|
+
function re(e, a) {
|
|
352
352
|
if (typeof P > "u")
|
|
353
353
|
return;
|
|
354
354
|
const c = typeof P == "string" ? P : "", o = A.env();
|
|
@@ -357,17 +357,17 @@ class Ne {
|
|
|
357
357
|
const p = t.split("__").map(function(l, d) {
|
|
358
358
|
return d === 0 && (l = l.substring(c.length)), W(l);
|
|
359
359
|
});
|
|
360
|
-
(
|
|
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
|
|
365
|
+
let a;
|
|
366
366
|
const c = /* @__PURE__ */ new Set();
|
|
367
367
|
Object.keys(e).forEach(function(o) {
|
|
368
|
-
if (!c.has(o) && (
|
|
368
|
+
if (!c.has(o) && (a = g(o, r.coercions), typeof a == "function"))
|
|
369
369
|
try {
|
|
370
|
-
const t = $(o,
|
|
370
|
+
const t = $(o, a(e[o]));
|
|
371
371
|
[].concat(r.aliases[o] || [], o).forEach((p) => {
|
|
372
372
|
c.add(p), e[p] = t;
|
|
373
373
|
});
|
|
@@ -377,37 +377,37 @@ class Ne {
|
|
|
377
377
|
});
|
|
378
378
|
}
|
|
379
379
|
function be(e) {
|
|
380
|
-
return r.keys.forEach((
|
|
381
|
-
~
|
|
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,
|
|
384
|
+
function me(e, a, c, o = !1) {
|
|
385
385
|
Object.keys(c).forEach(function(t) {
|
|
386
|
-
E(e, t.split(".")) || (N(e, t.split("."), c[t]), o && (oe[t] = !0), (
|
|
386
|
+
E(e, t.split(".")) || (N(e, t.split("."), c[t]), o && (oe[t] = !0), (a[t] || []).forEach(function(p) {
|
|
387
387
|
E(e, p.split(".")) || N(e, p.split("."), c[t]);
|
|
388
388
|
}));
|
|
389
389
|
});
|
|
390
390
|
}
|
|
391
|
-
function E(e,
|
|
391
|
+
function E(e, a) {
|
|
392
392
|
let c = e;
|
|
393
|
-
h["dot-notation"] || (
|
|
393
|
+
h["dot-notation"] || (a = [a.join(".")]), a.slice(0, -1).forEach(function(t) {
|
|
394
394
|
c = c[t] || {};
|
|
395
395
|
});
|
|
396
|
-
const o =
|
|
396
|
+
const o = a[a.length - 1];
|
|
397
397
|
return typeof c != "object" ? !1 : o in c;
|
|
398
398
|
}
|
|
399
|
-
function N(e,
|
|
399
|
+
function N(e, a, c) {
|
|
400
400
|
let o = e;
|
|
401
|
-
h["dot-notation"] || (
|
|
401
|
+
h["dot-notation"] || (a = [a.join(".")]), a.slice(0, -1).forEach(function(v) {
|
|
402
402
|
v = ce(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 = ce(
|
|
404
|
+
const t = ce(a[a.length - 1]), p = g(a.join("."), r.arrays), l = Array.isArray(c);
|
|
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)), c === Z() ? o[t] = Z(o[t]) : Array.isArray(o[t]) ? d && p && l ? o[t] = h["flatten-duplicate-arrays"] ? o[t].concat(c) : (Array.isArray(o[t][0]) ? o[t] : [o[t]]).concat([c]) : !d && !!p == !!l ? o[t] = c : o[t] = o[t].concat([c]) : o[t] === void 0 && p ? o[t] = l ? c : [c] : d && !(o[t] === void 0 || g(t, r.counts) || g(t, r.bools)) ? o[t] = [o[t], c] : o[t] = c;
|
|
407
407
|
}
|
|
408
408
|
function qe(...e) {
|
|
409
|
-
e.forEach(function(
|
|
410
|
-
Object.keys(
|
|
409
|
+
e.forEach(function(a) {
|
|
410
|
+
Object.keys(a || {}).forEach(function(c) {
|
|
411
411
|
r.aliases[c] || (r.aliases[c] = [].concat(_[c] || []), r.aliases[c].concat(c).forEach(function(o) {
|
|
412
412
|
if (/-/.test(o) && h["camel-case-expansion"]) {
|
|
413
413
|
const t = W(o);
|
|
@@ -426,18 +426,18 @@ class Ne {
|
|
|
426
426
|
});
|
|
427
427
|
});
|
|
428
428
|
}
|
|
429
|
-
function g(e,
|
|
430
|
-
const c = [].concat(r.aliases[e] || [], e), o = Object.keys(
|
|
431
|
-
return t ?
|
|
429
|
+
function g(e, a) {
|
|
430
|
+
const c = [].concat(r.aliases[e] || [], e), o = Object.keys(a), t = c.find((p) => o.includes(p));
|
|
431
|
+
return t ? a[t] : !1;
|
|
432
432
|
}
|
|
433
433
|
function ue(e) {
|
|
434
|
-
const
|
|
435
|
-
return [].concat(
|
|
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, ...
|
|
440
|
-
return [].concat(...
|
|
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
|
|
448
|
+
let a = !0, c;
|
|
449
449
|
const o = e.slice(1).split("");
|
|
450
450
|
for (let t = 0; t < o.length; t++) {
|
|
451
451
|
if (c = e.slice(t + 2), !ue(o[t])) {
|
|
452
|
-
|
|
452
|
+
a = !1;
|
|
453
453
|
break;
|
|
454
454
|
}
|
|
455
455
|
if (o[t + 1] && o[t + 1] === "=" || c === "-" || /[A-Za-z]/.test(o[t]) && /^-?\d+(\.\d*)?(e-?\d+)?$/.test(c) || o[t + 1] && o[t + 1].match(/\W/))
|
|
456
456
|
break;
|
|
457
457
|
}
|
|
458
|
-
return
|
|
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
|
|
479
|
-
return g(e, r.strings) ?
|
|
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,11 +494,11 @@ class Ne {
|
|
|
494
494
|
};
|
|
495
495
|
}
|
|
496
496
|
}
|
|
497
|
-
function ze(
|
|
497
|
+
function ze(i) {
|
|
498
498
|
const n = [], m = /* @__PURE__ */ Object.create(null);
|
|
499
499
|
let s = !0;
|
|
500
|
-
for (Object.keys(
|
|
501
|
-
n.push([].concat(
|
|
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++)
|
|
@@ -518,14 +518,14 @@ function ze(a) {
|
|
|
518
518
|
k !== void 0 && typeof k == "string" && (m[k] = u);
|
|
519
519
|
}), m;
|
|
520
520
|
}
|
|
521
|
-
function Z(
|
|
522
|
-
return
|
|
521
|
+
function Z(i) {
|
|
522
|
+
return i !== void 0 ? i + 1 : 1;
|
|
523
523
|
}
|
|
524
|
-
function ce(
|
|
525
|
-
return
|
|
524
|
+
function ce(i) {
|
|
525
|
+
return i === "__proto__" ? "___proto___" : i;
|
|
526
526
|
}
|
|
527
|
-
function je(
|
|
528
|
-
return typeof
|
|
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,14 +545,14 @@ new Ne({
|
|
|
545
545
|
env: () => Qe,
|
|
546
546
|
format: he,
|
|
547
547
|
normalize: Ie,
|
|
548
|
-
resolve:
|
|
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: (
|
|
551
|
+
require: (i) => {
|
|
552
552
|
if (typeof require < "u")
|
|
553
|
-
return require(
|
|
554
|
-
if (
|
|
555
|
-
return JSON.parse(_e(
|
|
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
|
});
|
|
@@ -562,10 +562,10 @@ const Fe = {
|
|
|
562
562
|
writeFile: Le
|
|
563
563
|
},
|
|
564
564
|
format: he,
|
|
565
|
-
resolve:
|
|
566
|
-
exists: (
|
|
565
|
+
resolve: ae,
|
|
566
|
+
exists: (i) => {
|
|
567
567
|
try {
|
|
568
|
-
return Pe(
|
|
568
|
+
return Pe(i).isFile();
|
|
569
569
|
} catch {
|
|
570
570
|
return !1;
|
|
571
571
|
}
|
|
@@ -658,9 +658,9 @@ class De {
|
|
|
658
658
|
return M.exists(n);
|
|
659
659
|
}
|
|
660
660
|
}
|
|
661
|
-
function Ve(
|
|
661
|
+
function Ve(i, n) {
|
|
662
662
|
M = n;
|
|
663
|
-
const m = new De(
|
|
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 = (
|
|
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:
|
|
682
|
+
directory: ae(z, "../../../locales"),
|
|
683
683
|
updateFiles: !1
|
|
684
684
|
});
|
|
685
|
-
const
|
|
685
|
+
const ie = [
|
|
686
686
|
{
|
|
687
687
|
id: "anthropic",
|
|
688
688
|
name: "Anthropic",
|
|
@@ -1143,29 +1143,52 @@ const ae = [
|
|
|
1143
1143
|
required: !0
|
|
1144
1144
|
}
|
|
1145
1145
|
]
|
|
1146
|
+
},
|
|
1147
|
+
{
|
|
1148
|
+
api_flavor: "anthropic",
|
|
1149
|
+
root: "usage",
|
|
1150
|
+
model_path: "model",
|
|
1151
|
+
mappings: [
|
|
1152
|
+
{
|
|
1153
|
+
path: "input_tokens",
|
|
1154
|
+
dest: "input_tokens",
|
|
1155
|
+
required: !0
|
|
1156
|
+
},
|
|
1157
|
+
{
|
|
1158
|
+
path: "cache_creation_input_tokens",
|
|
1159
|
+
dest: "input_tokens",
|
|
1160
|
+
required: !1
|
|
1161
|
+
},
|
|
1162
|
+
{
|
|
1163
|
+
path: "cache_read_input_tokens",
|
|
1164
|
+
dest: "input_tokens",
|
|
1165
|
+
required: !1
|
|
1166
|
+
},
|
|
1167
|
+
{
|
|
1168
|
+
path: "cache_creation_input_tokens",
|
|
1169
|
+
dest: "cache_write_tokens",
|
|
1170
|
+
required: !1
|
|
1171
|
+
},
|
|
1172
|
+
{
|
|
1173
|
+
path: "cache_read_input_tokens",
|
|
1174
|
+
dest: "cache_read_tokens",
|
|
1175
|
+
required: !1
|
|
1176
|
+
},
|
|
1177
|
+
{
|
|
1178
|
+
path: "output_tokens",
|
|
1179
|
+
dest: "output_tokens",
|
|
1180
|
+
required: !0
|
|
1181
|
+
}
|
|
1182
|
+
]
|
|
1146
1183
|
}
|
|
1147
1184
|
],
|
|
1148
1185
|
models: [
|
|
1149
1186
|
{
|
|
1150
|
-
id: "
|
|
1151
|
-
|
|
1152
|
-
contains: "llama3-8b-instruct-v1"
|
|
1153
|
-
},
|
|
1154
|
-
prices: {
|
|
1155
|
-
input_mtok: 0.3,
|
|
1156
|
-
output_mtok: 0.6
|
|
1157
|
-
}
|
|
1158
|
-
},
|
|
1159
|
-
{
|
|
1160
|
-
id: "nova-lite-v1",
|
|
1161
|
-
name: "Nova Lite 1.0",
|
|
1187
|
+
id: "amazon.nova-lite-v1:0",
|
|
1188
|
+
name: "Nova Lite",
|
|
1162
1189
|
description: "Amazon Nova Lite 1.0 is a very low-cost multimodal model from Amazon that focused on fast processing of image, video, and text inputs to generate text output. Amazon Nova Lite can handle real-time customer interactions, document analysis, and visual question-answering tasks with high accuracy.",
|
|
1163
1190
|
match: {
|
|
1164
|
-
|
|
1165
|
-
{
|
|
1166
|
-
contains: "nova-lite-v1"
|
|
1167
|
-
}
|
|
1168
|
-
]
|
|
1191
|
+
contains: "nova-lite"
|
|
1169
1192
|
},
|
|
1170
1193
|
prices: {
|
|
1171
1194
|
input_mtok: 0.06,
|
|
@@ -1174,15 +1197,11 @@ const ae = [
|
|
|
1174
1197
|
}
|
|
1175
1198
|
},
|
|
1176
1199
|
{
|
|
1177
|
-
id: "nova-micro-v1",
|
|
1178
|
-
name: "Nova Micro
|
|
1200
|
+
id: "amazon.nova-micro-v1:0",
|
|
1201
|
+
name: "Nova Micro",
|
|
1179
1202
|
description: "Amazon Nova Micro 1.0 is a text-only model that delivers the lowest latency responses in the Amazon Nova family of models at a very low cost. With a context length of 128K tokens and optimized for speed and cost, Amazon Nova Micro excels at tasks such as text summarization, translation, content classification, interactive chat, and brainstorming. It has simple mathematical reasoning and coding abilities.",
|
|
1180
1203
|
match: {
|
|
1181
|
-
|
|
1182
|
-
{
|
|
1183
|
-
contains: "nova-micro-v1"
|
|
1184
|
-
}
|
|
1185
|
-
]
|
|
1204
|
+
contains: "nova-micro"
|
|
1186
1205
|
},
|
|
1187
1206
|
prices: {
|
|
1188
1207
|
input_mtok: 0.035,
|
|
@@ -1191,21 +1210,315 @@ const ae = [
|
|
|
1191
1210
|
}
|
|
1192
1211
|
},
|
|
1193
1212
|
{
|
|
1194
|
-
id: "nova-
|
|
1195
|
-
name: "Nova
|
|
1213
|
+
id: "amazon.nova-premier-v1:0",
|
|
1214
|
+
name: "Nova Premier",
|
|
1215
|
+
match: {
|
|
1216
|
+
contains: "nova-premier"
|
|
1217
|
+
},
|
|
1218
|
+
prices: {
|
|
1219
|
+
input_mtok: 2.5,
|
|
1220
|
+
cache_read_mtok: 0.625,
|
|
1221
|
+
output_mtok: 12.5
|
|
1222
|
+
}
|
|
1223
|
+
},
|
|
1224
|
+
{
|
|
1225
|
+
id: "amazon.nova-pro-v1:0",
|
|
1226
|
+
name: "Nova Pro",
|
|
1196
1227
|
description: "Amazon Nova Pro 1.0 is a capable multimodal model from Amazon focused on providing a combination of accuracy, speed, and cost for a wide range of tasks. As of December 2024, it achieves state-of-the-art performance on key benchmarks including visual question answering (TextVQA) and video understanding (VATEX).",
|
|
1197
1228
|
match: {
|
|
1198
|
-
|
|
1199
|
-
{
|
|
1200
|
-
contains: "nova-pro-v1"
|
|
1201
|
-
}
|
|
1202
|
-
]
|
|
1229
|
+
contains: "nova-pro"
|
|
1203
1230
|
},
|
|
1204
1231
|
prices: {
|
|
1205
1232
|
input_mtok: 0.8,
|
|
1206
1233
|
cache_read_mtok: 0.2,
|
|
1207
1234
|
output_mtok: 3.2
|
|
1208
1235
|
}
|
|
1236
|
+
},
|
|
1237
|
+
{
|
|
1238
|
+
id: "amazon.nova-sonic-v1:0",
|
|
1239
|
+
name: "Nova Sonic",
|
|
1240
|
+
match: {
|
|
1241
|
+
contains: "nova-sonic"
|
|
1242
|
+
},
|
|
1243
|
+
prices: {
|
|
1244
|
+
input_mtok: 0.06,
|
|
1245
|
+
output_mtok: 0.24,
|
|
1246
|
+
input_audio_mtok: 3.4,
|
|
1247
|
+
output_audio_mtok: 13.6
|
|
1248
|
+
}
|
|
1249
|
+
},
|
|
1250
|
+
{
|
|
1251
|
+
id: "amazon.titan-embed-text-v1",
|
|
1252
|
+
name: "Titan Embeddings G1 - Text",
|
|
1253
|
+
match: {
|
|
1254
|
+
contains: "titan-embed-text"
|
|
1255
|
+
},
|
|
1256
|
+
prices: {
|
|
1257
|
+
input_mtok: 0.1
|
|
1258
|
+
}
|
|
1259
|
+
},
|
|
1260
|
+
{
|
|
1261
|
+
id: "amazon.titan-text-express-v1",
|
|
1262
|
+
name: "Titan Text G1 - Express",
|
|
1263
|
+
match: {
|
|
1264
|
+
contains: "titan-text-express"
|
|
1265
|
+
},
|
|
1266
|
+
prices: {
|
|
1267
|
+
input_mtok: 0.2,
|
|
1268
|
+
output_mtok: 0.6
|
|
1269
|
+
}
|
|
1270
|
+
},
|
|
1271
|
+
{
|
|
1272
|
+
id: "amazon.titan-text-lite-v1",
|
|
1273
|
+
name: "Titan Text G1 - Lite",
|
|
1274
|
+
match: {
|
|
1275
|
+
contains: "titan-text-lite"
|
|
1276
|
+
},
|
|
1277
|
+
prices: {
|
|
1278
|
+
input_mtok: 0.15,
|
|
1279
|
+
output_mtok: 0.2
|
|
1280
|
+
}
|
|
1281
|
+
},
|
|
1282
|
+
{
|
|
1283
|
+
id: "anthropic.claude-3-haiku-20240307-v1:0",
|
|
1284
|
+
name: "Claude 3 Haiku",
|
|
1285
|
+
match: {
|
|
1286
|
+
contains: "claude-3-haiku-20240307"
|
|
1287
|
+
},
|
|
1288
|
+
prices: {
|
|
1289
|
+
input_mtok: 0.25
|
|
1290
|
+
}
|
|
1291
|
+
},
|
|
1292
|
+
{
|
|
1293
|
+
id: "deepseek.r1-v1:0",
|
|
1294
|
+
name: "DeepSeek-R1",
|
|
1295
|
+
match: {
|
|
1296
|
+
contains: "r1"
|
|
1297
|
+
},
|
|
1298
|
+
prices: {
|
|
1299
|
+
input_mtok: 1.35,
|
|
1300
|
+
output_mtok: 5.4
|
|
1301
|
+
}
|
|
1302
|
+
},
|
|
1303
|
+
{
|
|
1304
|
+
id: "meta.llama3-1-70b-instruct-v1:0",
|
|
1305
|
+
name: "Llama 3.1 70B Instruct",
|
|
1306
|
+
match: {
|
|
1307
|
+
contains: "llama3-1-70b-instruct"
|
|
1308
|
+
},
|
|
1309
|
+
prices: {
|
|
1310
|
+
input_mtok: 0.72,
|
|
1311
|
+
output_mtok: 0.72
|
|
1312
|
+
}
|
|
1313
|
+
},
|
|
1314
|
+
{
|
|
1315
|
+
id: "meta.llama3-1-8b-instruct-v1:0",
|
|
1316
|
+
name: "Llama 3.1 8B Instruct",
|
|
1317
|
+
match: {
|
|
1318
|
+
contains: "llama3-1-8b-instruct"
|
|
1319
|
+
},
|
|
1320
|
+
prices: {
|
|
1321
|
+
input_mtok: 0.22,
|
|
1322
|
+
output_mtok: 0.22
|
|
1323
|
+
}
|
|
1324
|
+
},
|
|
1325
|
+
{
|
|
1326
|
+
id: "meta.llama3-2-11b-instruct-v1:0",
|
|
1327
|
+
name: "Llama 3.2 11B Instruct",
|
|
1328
|
+
match: {
|
|
1329
|
+
contains: "llama3-2-11b-instruct"
|
|
1330
|
+
},
|
|
1331
|
+
prices: {
|
|
1332
|
+
input_mtok: 0.16,
|
|
1333
|
+
output_mtok: 0.16
|
|
1334
|
+
}
|
|
1335
|
+
},
|
|
1336
|
+
{
|
|
1337
|
+
id: "meta.llama3-2-1b-instruct-v1:0",
|
|
1338
|
+
name: "Llama 3.2 1B Instruct",
|
|
1339
|
+
match: {
|
|
1340
|
+
contains: "llama3-2-1b-instruct"
|
|
1341
|
+
},
|
|
1342
|
+
prices: {
|
|
1343
|
+
input_mtok: 0.1,
|
|
1344
|
+
output_mtok: 0.1
|
|
1345
|
+
}
|
|
1346
|
+
},
|
|
1347
|
+
{
|
|
1348
|
+
id: "meta.llama3-2-3b-instruct-v1:0",
|
|
1349
|
+
name: "Llama 3.2 3B Instruct",
|
|
1350
|
+
match: {
|
|
1351
|
+
contains: "llama3-2-3b-instruct"
|
|
1352
|
+
},
|
|
1353
|
+
prices: {
|
|
1354
|
+
input_mtok: 0.15,
|
|
1355
|
+
output_mtok: 0.15
|
|
1356
|
+
}
|
|
1357
|
+
},
|
|
1358
|
+
{
|
|
1359
|
+
id: "meta.llama3-2-90b-instruct-v1:0",
|
|
1360
|
+
name: "Llama 3.2 90B Instruct",
|
|
1361
|
+
match: {
|
|
1362
|
+
contains: "llama3-2-90b-instruct"
|
|
1363
|
+
},
|
|
1364
|
+
prices: {
|
|
1365
|
+
input_mtok: 0.72,
|
|
1366
|
+
output_mtok: 0.72
|
|
1367
|
+
}
|
|
1368
|
+
},
|
|
1369
|
+
{
|
|
1370
|
+
id: "meta.llama3-3-70b-instruct-v1:0",
|
|
1371
|
+
name: "Llama 3.3 70B Instruct",
|
|
1372
|
+
match: {
|
|
1373
|
+
contains: "llama3-3-70b-instruct"
|
|
1374
|
+
},
|
|
1375
|
+
prices: {
|
|
1376
|
+
input_mtok: 0.72,
|
|
1377
|
+
output_mtok: 0.72
|
|
1378
|
+
}
|
|
1379
|
+
},
|
|
1380
|
+
{
|
|
1381
|
+
id: "meta.llama3-70b-instruct-v1:0",
|
|
1382
|
+
name: "Llama 3 70B Instruct",
|
|
1383
|
+
match: {
|
|
1384
|
+
contains: "llama3-70b-instruct"
|
|
1385
|
+
},
|
|
1386
|
+
prices: {
|
|
1387
|
+
input_mtok: 2.65,
|
|
1388
|
+
output_mtok: 3.5
|
|
1389
|
+
}
|
|
1390
|
+
},
|
|
1391
|
+
{
|
|
1392
|
+
id: "meta.llama3-8b-instruct-v1:0",
|
|
1393
|
+
name: "Llama 3 8B Instruct",
|
|
1394
|
+
match: {
|
|
1395
|
+
contains: "llama3-8b-instruct"
|
|
1396
|
+
},
|
|
1397
|
+
prices: {
|
|
1398
|
+
input_mtok: 0.3,
|
|
1399
|
+
output_mtok: 0.6
|
|
1400
|
+
}
|
|
1401
|
+
},
|
|
1402
|
+
{
|
|
1403
|
+
id: "meta.llama4-maverick-17b-instruct-v1:0",
|
|
1404
|
+
name: "Llama 4 Maverick 17B Instruct",
|
|
1405
|
+
match: {
|
|
1406
|
+
contains: "llama4-maverick-17b-instruct"
|
|
1407
|
+
},
|
|
1408
|
+
prices: {
|
|
1409
|
+
input_mtok: 0.24,
|
|
1410
|
+
output_mtok: 0.97
|
|
1411
|
+
}
|
|
1412
|
+
},
|
|
1413
|
+
{
|
|
1414
|
+
id: "meta.llama4-scout-17b-instruct-v1:0",
|
|
1415
|
+
name: "Llama 4 Scout 17B Instruct",
|
|
1416
|
+
match: {
|
|
1417
|
+
contains: "llama4-scout-17b-instruct"
|
|
1418
|
+
},
|
|
1419
|
+
prices: {
|
|
1420
|
+
input_mtok: 0.17,
|
|
1421
|
+
output_mtok: 0.66
|
|
1422
|
+
}
|
|
1423
|
+
},
|
|
1424
|
+
{
|
|
1425
|
+
id: "mistral.mistral-7b-instruct-v0:2",
|
|
1426
|
+
name: "Mistral 7B Instruct",
|
|
1427
|
+
match: {
|
|
1428
|
+
contains: "mistral-7b-instruct"
|
|
1429
|
+
},
|
|
1430
|
+
prices: {
|
|
1431
|
+
input_mtok: 0.15,
|
|
1432
|
+
output_mtok: 0.2
|
|
1433
|
+
}
|
|
1434
|
+
},
|
|
1435
|
+
{
|
|
1436
|
+
id: "mistral.mistral-large-2402-v1:0",
|
|
1437
|
+
name: "Mistral Large (24.02)",
|
|
1438
|
+
match: {
|
|
1439
|
+
contains: "mistral-large-2402"
|
|
1440
|
+
},
|
|
1441
|
+
prices: {
|
|
1442
|
+
input_mtok: 4,
|
|
1443
|
+
output_mtok: 12
|
|
1444
|
+
}
|
|
1445
|
+
},
|
|
1446
|
+
{
|
|
1447
|
+
id: "mistral.mistral-small-2402-v1:0",
|
|
1448
|
+
name: "Mistral Small (24.02)",
|
|
1449
|
+
match: {
|
|
1450
|
+
contains: "mistral-small-2402"
|
|
1451
|
+
},
|
|
1452
|
+
prices: {
|
|
1453
|
+
input_mtok: 1,
|
|
1454
|
+
output_mtok: 3
|
|
1455
|
+
}
|
|
1456
|
+
},
|
|
1457
|
+
{
|
|
1458
|
+
id: "mistral.mixtral-8x7b-instruct-v0:1",
|
|
1459
|
+
name: "Mixtral 8x7B Instruct",
|
|
1460
|
+
match: {
|
|
1461
|
+
contains: "mixtral-8x7b-instruct"
|
|
1462
|
+
},
|
|
1463
|
+
prices: {
|
|
1464
|
+
input_mtok: 0.45,
|
|
1465
|
+
output_mtok: 0.7
|
|
1466
|
+
}
|
|
1467
|
+
},
|
|
1468
|
+
{
|
|
1469
|
+
id: "mistral.pixtral-large-2502-v1:0",
|
|
1470
|
+
name: "Pixtral Large (25.02)",
|
|
1471
|
+
match: {
|
|
1472
|
+
contains: "pixtral-large-2502"
|
|
1473
|
+
},
|
|
1474
|
+
prices: {
|
|
1475
|
+
input_mtok: 2,
|
|
1476
|
+
output_mtok: 6
|
|
1477
|
+
}
|
|
1478
|
+
},
|
|
1479
|
+
{
|
|
1480
|
+
id: "openai.gpt-oss-120b-1:0",
|
|
1481
|
+
name: "gpt-oss-120b",
|
|
1482
|
+
match: {
|
|
1483
|
+
contains: "gpt-oss-120b"
|
|
1484
|
+
},
|
|
1485
|
+
prices: {
|
|
1486
|
+
input_mtok: 0.15,
|
|
1487
|
+
output_mtok: 0.6
|
|
1488
|
+
}
|
|
1489
|
+
},
|
|
1490
|
+
{
|
|
1491
|
+
id: "openai.gpt-oss-20b-1:0",
|
|
1492
|
+
name: "gpt-oss-20b",
|
|
1493
|
+
match: {
|
|
1494
|
+
contains: "gpt-oss-20b"
|
|
1495
|
+
},
|
|
1496
|
+
prices: {
|
|
1497
|
+
input_mtok: 0.07,
|
|
1498
|
+
output_mtok: 0.3
|
|
1499
|
+
}
|
|
1500
|
+
},
|
|
1501
|
+
{
|
|
1502
|
+
id: "qwen.qwen3-32b-v1:0",
|
|
1503
|
+
name: "Qwen3 32B (dense)",
|
|
1504
|
+
match: {
|
|
1505
|
+
contains: "qwen3-32b"
|
|
1506
|
+
},
|
|
1507
|
+
prices: {
|
|
1508
|
+
input_mtok: 0.15,
|
|
1509
|
+
output_mtok: 0.6
|
|
1510
|
+
}
|
|
1511
|
+
},
|
|
1512
|
+
{
|
|
1513
|
+
id: "qwen.qwen3-coder-30b-a3b-v1:0",
|
|
1514
|
+
name: "Qwen3-Coder-30B-A3B-Instruct",
|
|
1515
|
+
match: {
|
|
1516
|
+
contains: "qwen3-coder-30b-a3b"
|
|
1517
|
+
},
|
|
1518
|
+
prices: {
|
|
1519
|
+
input_mtok: 0.15,
|
|
1520
|
+
output_mtok: 0.6
|
|
1521
|
+
}
|
|
1209
1522
|
}
|
|
1210
1523
|
]
|
|
1211
1524
|
},
|
|
@@ -12606,37 +12919,37 @@ Compared to other leading proprietary and open-weights models Command A delivers
|
|
|
12606
12919
|
]
|
|
12607
12920
|
}
|
|
12608
12921
|
];
|
|
12609
|
-
function We(
|
|
12922
|
+
function We(i, n) {
|
|
12610
12923
|
if (n <= 0) return 0;
|
|
12611
12924
|
let m = 0;
|
|
12612
|
-
const s = [...
|
|
12613
|
-
m += k *
|
|
12925
|
+
const s = [...i.tiers].sort((_, h) => _.start - h.start), u = s[0]?.start ?? n, k = Math.min(n, u);
|
|
12926
|
+
m += k * i.base / 1e6;
|
|
12614
12927
|
for (let _ = 0; _ < s.length; _++) {
|
|
12615
12928
|
const h = s[_], f = s[_ + 1]?.start ?? 1 / 0, y = Math.max(0, Math.min(n, f) - h.start);
|
|
12616
12929
|
y > 0 && (m += y * h.price / 1e6);
|
|
12617
12930
|
}
|
|
12618
12931
|
return m;
|
|
12619
12932
|
}
|
|
12620
|
-
function O(
|
|
12621
|
-
return
|
|
12933
|
+
function O(i, n, m) {
|
|
12934
|
+
return i === void 0 || n === void 0 ? 0 : typeof i == "number" ? i * n / 1e6 : We(i, n);
|
|
12622
12935
|
}
|
|
12623
|
-
function Ue(
|
|
12936
|
+
function Ue(i, n) {
|
|
12624
12937
|
let m = 0, s = 0;
|
|
12625
|
-
const u =
|
|
12626
|
-
let f =
|
|
12938
|
+
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;
|
|
12939
|
+
let f = i.input_audio_tokens ?? 0;
|
|
12627
12940
|
if (f -= _, f < 0)
|
|
12628
12941
|
throw new Error("cache_audio_read_tokens cannot be greater than input_audio_tokens");
|
|
12629
|
-
let y =
|
|
12942
|
+
let y = i.input_tokens ?? 0;
|
|
12630
12943
|
if (y -= u, y -= k, y -= f, y < 0)
|
|
12631
12944
|
throw new Error("Uncached text input tokens cannot be negative");
|
|
12632
12945
|
let P = u;
|
|
12633
12946
|
if (P -= _, P < 0)
|
|
12634
12947
|
throw new Error("cache_audio_read_tokens cannot be greater than cache_read_tokens");
|
|
12635
12948
|
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, _);
|
|
12636
|
-
let S =
|
|
12949
|
+
let S = i.output_tokens ?? 0;
|
|
12637
12950
|
if (S -= h, S < 0)
|
|
12638
12951
|
throw new Error("output_audio_tokens cannot be greater than output_tokens");
|
|
12639
|
-
s += O(n.output_mtok, S), s += O(n.output_audio_mtok,
|
|
12952
|
+
s += O(n.output_mtok, S), s += O(n.output_audio_mtok, i.output_audio_tokens);
|
|
12640
12953
|
let G = m + s;
|
|
12641
12954
|
return n.requests_kcount !== void 0 && (G += n.requests_kcount / 1e3), {
|
|
12642
12955
|
input_price: m,
|
|
@@ -12644,11 +12957,11 @@ function Ue(a, n) {
|
|
|
12644
12957
|
total_price: G
|
|
12645
12958
|
};
|
|
12646
12959
|
}
|
|
12647
|
-
function Ke(
|
|
12648
|
-
if (!Array.isArray(
|
|
12649
|
-
return
|
|
12650
|
-
for (let m =
|
|
12651
|
-
const s =
|
|
12960
|
+
function Ke(i, n) {
|
|
12961
|
+
if (!Array.isArray(i.prices))
|
|
12962
|
+
return i.prices;
|
|
12963
|
+
for (let m = i.prices.length - 1; m >= 0; m--) {
|
|
12964
|
+
const s = i.prices[m], u = s.constraint;
|
|
12652
12965
|
if (u === void 0)
|
|
12653
12966
|
return s.prices;
|
|
12654
12967
|
if (u.type === "start_date") {
|
|
@@ -12663,34 +12976,34 @@ function Ke(a, n) {
|
|
|
12663
12976
|
return s.prices;
|
|
12664
12977
|
}
|
|
12665
12978
|
}
|
|
12666
|
-
return
|
|
12979
|
+
return i.prices[0].prices;
|
|
12667
12980
|
}
|
|
12668
|
-
function j(
|
|
12669
|
-
return "or" in
|
|
12981
|
+
function j(i, n) {
|
|
12982
|
+
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;
|
|
12670
12983
|
}
|
|
12671
|
-
function Ye(
|
|
12672
|
-
const m = n.toLowerCase().trim(), s =
|
|
12673
|
-
return s ||
|
|
12984
|
+
function Ye(i, n) {
|
|
12985
|
+
const m = n.toLowerCase().trim(), s = i.find((u) => u.id === m);
|
|
12986
|
+
return s || i.find((u) => u.provider_match && j(u.provider_match, m));
|
|
12674
12987
|
}
|
|
12675
|
-
function Je(
|
|
12988
|
+
function Je(i, { modelId: n, providerApiUrl: m, providerId: s }) {
|
|
12676
12989
|
if (s)
|
|
12677
|
-
return Ye(
|
|
12990
|
+
return Ye(i, s);
|
|
12678
12991
|
if (m)
|
|
12679
|
-
return
|
|
12992
|
+
return i.find((u) => new RegExp(u.api_pattern).test(m));
|
|
12680
12993
|
if (n)
|
|
12681
|
-
return
|
|
12994
|
+
return i.find((u) => u.model_match && j(u.model_match, n));
|
|
12682
12995
|
}
|
|
12683
|
-
function Ze(
|
|
12684
|
-
return
|
|
12996
|
+
function Ze(i, n) {
|
|
12997
|
+
return i.find((m) => j(m.match, n));
|
|
12685
12998
|
}
|
|
12686
|
-
let Xe =
|
|
12687
|
-
Promise.resolve(
|
|
12688
|
-
function et(
|
|
12999
|
+
let Xe = ie;
|
|
13000
|
+
Promise.resolve(ie);
|
|
13001
|
+
function et(i, n, m) {
|
|
12689
13002
|
const s = n.toLowerCase().trim(), u = m?.provider ?? Je(Xe, { modelId: s, providerApiUrl: m?.providerApiUrl, providerId: m?.providerId });
|
|
12690
13003
|
if (!u) return null;
|
|
12691
13004
|
const k = Ze(u.models, s);
|
|
12692
13005
|
if (!k) return null;
|
|
12693
|
-
const _ = m?.timestamp ?? /* @__PURE__ */ new Date(), h = Ke(k, _), f = Ue(
|
|
13006
|
+
const _ = m?.timestamp ?? /* @__PURE__ */ new Date(), h = Ke(k, _), f = Ue(i, h);
|
|
12694
13007
|
return {
|
|
12695
13008
|
auto_update_timestamp: void 0,
|
|
12696
13009
|
model: k,
|
|
@@ -12702,15 +13015,15 @@ function et(a, n, m) {
|
|
|
12702
13015
|
const b = de(Ce(process.argv)).scriptName("genai-prices").command(
|
|
12703
13016
|
"list [provider]",
|
|
12704
13017
|
"List providers and models",
|
|
12705
|
-
(
|
|
13018
|
+
(i) => i.positional("provider", { describe: "Provider ID to filter", type: "string" })
|
|
12706
13019
|
).command(
|
|
12707
13020
|
"calc <model...>",
|
|
12708
13021
|
"Calculate price",
|
|
12709
|
-
(
|
|
13022
|
+
(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" })
|
|
12710
13023
|
).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();
|
|
12711
13024
|
function tt() {
|
|
12712
13025
|
if (b._[0] === "list") {
|
|
12713
|
-
const m =
|
|
13026
|
+
const m = ie;
|
|
12714
13027
|
if (b.provider) {
|
|
12715
13028
|
const s = m.find((u) => u.id === b.provider);
|
|
12716
13029
|
s || (console.error(`Provider ${b.provider} not found.`), process.exit(1)), console.log(`${s.name}: (${s.models.length} models)`);
|