@pydantic/genai-prices 0.0.21 → 0.0.22
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 +392 -398
- package/dist/index.cjs +5 -5
- package/dist/index.d.cts +9 -0
- package/dist/index.d.ts +9 -0
- package/dist/index.js +275 -277
- package/package.json +2 -2
package/dist/cli.js
CHANGED
|
@@ -1,66 +1,66 @@
|
|
|
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 ke, writeFile as Le, statSync as Pe } from "fs";
|
|
6
6
|
import "assert";
|
|
7
|
-
import { fileURLToPath as
|
|
7
|
+
import { fileURLToPath as Te } from "url";
|
|
8
8
|
function Ae() {
|
|
9
|
-
return
|
|
10
|
-
}
|
|
11
|
-
function Te() {
|
|
12
|
-
return Se() && !process.defaultApp;
|
|
9
|
+
return Se() ? 0 : 1;
|
|
13
10
|
}
|
|
14
11
|
function Se() {
|
|
12
|
+
return Ge() && !process.defaultApp;
|
|
13
|
+
}
|
|
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 _ = u ? u[0].length : 0; _ <
|
|
32
|
-
let k =
|
|
30
|
+
const u = i.match(/^-+/);
|
|
31
|
+
for (let _ = u ? u[0].length : 0; _ < i.length; _++) {
|
|
32
|
+
let k = i.charAt(_);
|
|
33
33
|
s && (s = !1, k = k.toUpperCase()), _ !== 0 && (k === "-" || k === "_") ? s = !0 : k !== "-" && k !== "_" && (m += k);
|
|
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 _ = m.charAt(u), k =
|
|
42
|
+
for (let u = 0; u < i.length; u++) {
|
|
43
|
+
const _ = m.charAt(u), k = i.charAt(u);
|
|
44
44
|
_ !== k && u > 0 ? s += `${n}${m.charAt(u)}` : s += k;
|
|
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 Ne(
|
|
57
|
-
if (Array.isArray(
|
|
58
|
-
return
|
|
59
|
-
|
|
56
|
+
function Ne(i) {
|
|
57
|
+
if (Array.isArray(i))
|
|
58
|
+
return i.map((k) => typeof k != "string" ? k + "" : k);
|
|
59
|
+
i = i.trim();
|
|
60
60
|
let n = 0, m = null, s = null, u = null;
|
|
61
61
|
const _ = [];
|
|
62
|
-
for (let k = 0; k <
|
|
63
|
-
if (m = s, s =
|
|
62
|
+
for (let k = 0; k < i.length; k++) {
|
|
63
|
+
if (m = s, s = i.charAt(k), s === " " && !u) {
|
|
64
64
|
m !== " " && n++;
|
|
65
65
|
continue;
|
|
66
66
|
}
|
|
@@ -74,8 +74,8 @@ function Ne(a) {
|
|
|
74
74
|
* SPDX-License-Identifier: ISC
|
|
75
75
|
*/
|
|
76
76
|
var M;
|
|
77
|
-
(function(
|
|
78
|
-
|
|
77
|
+
(function(i) {
|
|
78
|
+
i.BOOLEAN = "boolean", i.STRING = "string", i.NUMBER = "number", i.ARRAY = "array";
|
|
79
79
|
})(M || (M = {}));
|
|
80
80
|
/**
|
|
81
81
|
* @license
|
|
@@ -124,7 +124,7 @@ class Ee {
|
|
|
124
124
|
"strip-aliased": !1,
|
|
125
125
|
"strip-dashed": !1,
|
|
126
126
|
"unknown-options-as-args": !1
|
|
127
|
-
}, s.configuration), f = Object.assign(/* @__PURE__ */ Object.create(null), s.default),
|
|
127
|
+
}, s.configuration), f = Object.assign(/* @__PURE__ */ Object.create(null), s.default), T = s.configObjects || [], C = s.envPrefix, j = h["populate--"], O = j ? "--" : "_", Q = /* @__PURE__ */ Object.create(null), oe = /* @__PURE__ */ Object.create(null), A = s.__ || P.format, r = {
|
|
128
128
|
aliases: /* @__PURE__ */ Object.create(null),
|
|
129
129
|
arrays: /* @__PURE__ */ Object.create(null),
|
|
130
130
|
bools: /* @__PURE__ */ Object.create(null),
|
|
@@ -138,14 +138,14 @@ class Ee {
|
|
|
138
138
|
keys: []
|
|
139
139
|
}, I = /^-([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, 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][
|
|
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 Ee {
|
|
|
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, k, 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 y = null;
|
|
@@ -174,28 +174,28 @@ class Ee {
|
|
|
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], l = a.replace(/^-{3,}/, "---");
|
|
178
178
|
let o, t, p, c, d, v;
|
|
179
|
-
if (
|
|
180
|
-
K(
|
|
179
|
+
if (a !== "--" && /^-/.test(a) && H(a))
|
|
180
|
+
K(a);
|
|
181
181
|
else if (l.match(/^---+(=|$)/)) {
|
|
182
|
-
K(
|
|
182
|
+
K(a);
|
|
183
183
|
continue;
|
|
184
|
-
} else if (
|
|
185
|
-
c =
|
|
186
|
-
else if (
|
|
187
|
-
c =
|
|
188
|
-
else if (
|
|
189
|
-
c =
|
|
190
|
-
else if (
|
|
191
|
-
c =
|
|
192
|
-
else if (
|
|
193
|
-
d = u[e + 1], c =
|
|
194
|
-
else if (
|
|
195
|
-
p =
|
|
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(I)) && !g(t, r.bools) && !g(t, r.counts) || /^(true|false)$/.test(d) ? (q(t, d), e++) : q(t, G(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(I))
|
|
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, G(t)));
|
|
194
|
+
else if (a.match(/^-[^-]+/) && !a.match(I)) {
|
|
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 === "-") {
|
|
@@ -210,19 +210,19 @@ class Ee {
|
|
|
210
210
|
q(p[x], d), o = !0;
|
|
211
211
|
break;
|
|
212
212
|
} else
|
|
213
|
-
q(p[x],
|
|
213
|
+
q(p[x], G(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(I)) && !g(t, r.bools) && !g(t, r.counts) || /^(true|false)$/.test(d) ? (q(t, d), e++) : q(t, G(t))));
|
|
216
|
+
} else if (a.match(/^-[0-9]$/) && a.match(I) && g(a.slice(1), r.bools))
|
|
217
|
+
t = a.slice(1), q(t, G(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), _e(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
|
R(w, e.split(".")) || q(e, 0);
|
|
@@ -231,54 +231,54 @@ class Ee {
|
|
|
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(k).map((e) => k[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, 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 L(o) || (y = Error(A("Argument unexpected for: %s",
|
|
243
|
+
return L(o) || (y = Error(A("Argument unexpected for: %s", a))), q(a, G(a)), e;
|
|
244
244
|
let c = L(o) ? 0 : 1;
|
|
245
245
|
if (h["nargs-eats-options"])
|
|
246
|
-
l.length - (e + 1) + c < p && (y = Error(A("Not enough arguments following: %s",
|
|
246
|
+
l.length - (e + 1) + c < p && (y = Error(A("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(I) || H(l[t])); t++)
|
|
249
249
|
c++;
|
|
250
|
-
c < p && (y = Error(A("Not enough arguments following: %s",
|
|
250
|
+
c < p && (y = Error(A("Not enough arguments following: %s", a)));
|
|
251
251
|
}
|
|
252
252
|
let d = Math.min(c, p);
|
|
253
|
-
for (!L(o) && d > 0 && (q(
|
|
254
|
-
q(
|
|
253
|
+
for (!L(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,
|
|
257
|
+
function V(e, a, l, o) {
|
|
258
258
|
let t = [], p = o || l[e + 1];
|
|
259
|
-
const c = g(
|
|
260
|
-
if (g(
|
|
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 (L(p) || L(o) && /^-/.test(p) && !I.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
|
-
L(o) || t.push(Y(
|
|
268
|
+
L(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) && !I.test(p) && !H(p))); d++)
|
|
270
|
-
e = d, t.push(Y(
|
|
270
|
+
e = d, t.push(Y(a, p, _));
|
|
271
271
|
}
|
|
272
|
-
return typeof c == "number" && (c && t.length < c || isNaN(c) && t.length === 0) && (y = Error(A("Not enough arguments following: %s",
|
|
272
|
+
return typeof c == "number" && (c && t.length < c || isNaN(c) && t.length === 0) && (y = Error(A("Not enough arguments following: %s", a))), q(a, t), e;
|
|
273
273
|
}
|
|
274
|
-
function q(e,
|
|
274
|
+
function q(e, a, l = _) {
|
|
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,
|
|
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 Ee {
|
|
|
290
290
|
Object.defineProperty(ne, c, {
|
|
291
291
|
enumerable: !0,
|
|
292
292
|
get() {
|
|
293
|
-
return
|
|
293
|
+
return a;
|
|
294
294
|
},
|
|
295
295
|
set(d) {
|
|
296
|
-
|
|
296
|
+
a = typeof d == "string" ? P.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
|
-
l && (
|
|
306
|
-
let o = Array.isArray(
|
|
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,
|
|
309
|
-
return g(e, r.counts) && (L(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) && (L(o) || typeof o == "boolean") && (o = Z()), g(e, r.normalize) && g(e, r.arrays) && (Array.isArray(a) ? o = a.map((t) => P.normalize(t)) : o = P.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}`))) || !L(a) && g(e, r.numbers)) && (a = Number(a)), a;
|
|
313
313
|
}
|
|
314
314
|
function _e(e) {
|
|
315
|
-
const
|
|
316
|
-
me(
|
|
317
|
-
const o = e[l] ||
|
|
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,18 +337,18 @@ class Ee {
|
|
|
337
337
|
}
|
|
338
338
|
});
|
|
339
339
|
}
|
|
340
|
-
function J(e,
|
|
340
|
+
function J(e, a) {
|
|
341
341
|
Object.keys(e).forEach(function(l) {
|
|
342
|
-
const o = e[l], t =
|
|
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) : (!R(w, t.split(".")) || g(t, r.arrays) && h["combine-arrays"]) && q(t, o);
|
|
344
344
|
});
|
|
345
345
|
}
|
|
346
346
|
function ge() {
|
|
347
|
-
typeof
|
|
347
|
+
typeof T < "u" && T.forEach(function(e) {
|
|
348
348
|
J(e);
|
|
349
349
|
});
|
|
350
350
|
}
|
|
351
|
-
function re(e,
|
|
351
|
+
function re(e, a) {
|
|
352
352
|
if (typeof C > "u")
|
|
353
353
|
return;
|
|
354
354
|
const l = typeof C == "string" ? C : "", o = P.env();
|
|
@@ -357,17 +357,17 @@ class Ee {
|
|
|
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
|
-
(
|
|
360
|
+
(a && r.configs[p.join(".")] || !a) && !R(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 l = /* @__PURE__ */ new Set();
|
|
367
367
|
Object.keys(e).forEach(function(o) {
|
|
368
|
-
if (!l.has(o) && (
|
|
368
|
+
if (!l.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
|
l.add(p), e[p] = t;
|
|
373
373
|
});
|
|
@@ -377,37 +377,37 @@ class Ee {
|
|
|
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, l, o = !1) {
|
|
385
385
|
Object.keys(l).forEach(function(t) {
|
|
386
|
-
R(e, t.split(".")) || (N(e, t.split("."), l[t]), o && (oe[t] = !0), (
|
|
386
|
+
R(e, t.split(".")) || (N(e, t.split("."), l[t]), o && (oe[t] = !0), (a[t] || []).forEach(function(p) {
|
|
387
387
|
R(e, p.split(".")) || N(e, p.split("."), l[t]);
|
|
388
388
|
}));
|
|
389
389
|
});
|
|
390
390
|
}
|
|
391
|
-
function R(e,
|
|
391
|
+
function R(e, a) {
|
|
392
392
|
let l = e;
|
|
393
|
-
h["dot-notation"] || (
|
|
393
|
+
h["dot-notation"] || (a = [a.join(".")]), a.slice(0, -1).forEach(function(t) {
|
|
394
394
|
l = l[t] || {};
|
|
395
395
|
});
|
|
396
|
-
const o =
|
|
396
|
+
const o = a[a.length - 1];
|
|
397
397
|
return typeof l != "object" ? !1 : o in l;
|
|
398
398
|
}
|
|
399
|
-
function N(e,
|
|
399
|
+
function N(e, a, l) {
|
|
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 = 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(
|
|
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, (!L(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(
|
|
410
|
-
Object.keys(
|
|
409
|
+
e.forEach(function(a) {
|
|
410
|
+
Object.keys(a || {}).forEach(function(l) {
|
|
411
411
|
r.aliases[l] || (r.aliases[l] = [].concat(k[l] || []), r.aliases[l].concat(l).forEach(function(o) {
|
|
412
412
|
if (/-/.test(o) && h["camel-case-expansion"]) {
|
|
413
413
|
const t = W(o);
|
|
@@ -426,18 +426,18 @@ class Ee {
|
|
|
426
426
|
});
|
|
427
427
|
});
|
|
428
428
|
}
|
|
429
|
-
function g(e,
|
|
430
|
-
const l = [].concat(r.aliases[e] || [], e), o = Object.keys(
|
|
431
|
-
return t ?
|
|
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
|
|
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 Ee {
|
|
|
445
445
|
function ve(e) {
|
|
446
446
|
if (e.match(I) || !e.match(/^-[^-]+/))
|
|
447
447
|
return !1;
|
|
448
|
-
let
|
|
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
|
-
|
|
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
|
|
458
|
+
return a;
|
|
459
459
|
}
|
|
460
460
|
function H(e) {
|
|
461
461
|
return h["unknown-options-as-args"] && xe(e);
|
|
@@ -463,7 +463,7 @@ class Ee {
|
|
|
463
463
|
function xe(e) {
|
|
464
464
|
return e = e.replace(/^-{3,}/, "--"), e.match(I) || ve(e) ? !1 : !we(e, /^-+([^=]+?)=[\s\S]*$/, U, /^-+([^=]+?)$/, /^-+([^=]+?)-$/, /^-+([^=]+?\d+)$/, /^-+([^=]+?)\W+.*$/);
|
|
465
465
|
}
|
|
466
|
-
function
|
|
466
|
+
function G(e) {
|
|
467
467
|
return !g(e, r.bools) && !g(e, r.counts) && `${e}` in f ? f[e] : ye(Be(e));
|
|
468
468
|
}
|
|
469
469
|
function ye(e) {
|
|
@@ -475,8 +475,8 @@ class Ee {
|
|
|
475
475
|
}[e];
|
|
476
476
|
}
|
|
477
477
|
function Be(e) {
|
|
478
|
-
let
|
|
479
|
-
return g(e, r.strings) ?
|
|
478
|
+
let a = M.BOOLEAN;
|
|
479
|
+
return g(e, r.strings) ? a = M.STRING : g(e, r.numbers) ? a = M.NUMBER : g(e, r.bools) ? a = M.BOOLEAN : g(e, r.arrays) && (a = M.ARRAY), a;
|
|
480
480
|
}
|
|
481
481
|
function L(e) {
|
|
482
482
|
return e === void 0;
|
|
@@ -494,11 +494,11 @@ class Ee {
|
|
|
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
|
_ !== void 0 && typeof _ == "string" && (m[_] = 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 le(
|
|
525
|
-
return
|
|
524
|
+
function le(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 Ee({
|
|
|
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(ke(
|
|
553
|
+
return require(i);
|
|
554
|
+
if (i.match(/\.json$/))
|
|
555
|
+
return JSON.parse(ke(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 B.exists(n);
|
|
659
659
|
}
|
|
660
660
|
}
|
|
661
|
-
function Ve(
|
|
661
|
+
function Ve(i, n) {
|
|
662
662
|
B = 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,19 +670,19 @@ 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 E;
|
|
675
675
|
try {
|
|
676
|
-
E =
|
|
676
|
+
E = Te(import.meta.url);
|
|
677
677
|
} catch {
|
|
678
678
|
E = process.cwd();
|
|
679
679
|
}
|
|
680
680
|
const He = E.substring(0, E.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(E, "../../../locales"),
|
|
683
683
|
updateFiles: !1
|
|
684
684
|
});
|
|
685
|
-
const
|
|
685
|
+
const ie = [
|
|
686
686
|
{
|
|
687
687
|
id: "anthropic",
|
|
688
688
|
name: "Anthropic",
|
|
@@ -691,6 +691,9 @@ const ae = [
|
|
|
691
691
|
model_match: {
|
|
692
692
|
contains: "claude"
|
|
693
693
|
},
|
|
694
|
+
provider_match: {
|
|
695
|
+
contains: "anthropic"
|
|
696
|
+
},
|
|
694
697
|
extractors: [
|
|
695
698
|
{
|
|
696
699
|
api_flavor: "default",
|
|
@@ -797,6 +800,12 @@ const ae = [
|
|
|
797
800
|
},
|
|
798
801
|
{
|
|
799
802
|
starts_with: "claude-3.7-sonnet"
|
|
803
|
+
},
|
|
804
|
+
{
|
|
805
|
+
starts_with: "claude-sonnet-3.7"
|
|
806
|
+
},
|
|
807
|
+
{
|
|
808
|
+
starts_with: "claude-sonnet-3-7"
|
|
800
809
|
}
|
|
801
810
|
]
|
|
802
811
|
},
|
|
@@ -860,10 +869,13 @@ const ae = [
|
|
|
860
869
|
match: {
|
|
861
870
|
or: [
|
|
862
871
|
{
|
|
863
|
-
starts_with: "claude-opus-4"
|
|
872
|
+
starts_with: "claude-opus-4-0"
|
|
873
|
+
},
|
|
874
|
+
{
|
|
875
|
+
starts_with: "claude-4-opus"
|
|
864
876
|
},
|
|
865
877
|
{
|
|
866
|
-
|
|
878
|
+
equals: "claude-opus-4-20250514"
|
|
867
879
|
}
|
|
868
880
|
]
|
|
869
881
|
},
|
|
@@ -880,14 +892,7 @@ const ae = [
|
|
|
880
892
|
name: "Claude Opus 4.1",
|
|
881
893
|
description: "Most intelligent model for complex tasks",
|
|
882
894
|
match: {
|
|
883
|
-
|
|
884
|
-
{
|
|
885
|
-
starts_with: "claude-opus-4"
|
|
886
|
-
},
|
|
887
|
-
{
|
|
888
|
-
starts_with: "claude-4-opus-20250522"
|
|
889
|
-
}
|
|
890
|
-
]
|
|
895
|
+
starts_with: "claude-opus-4-1"
|
|
891
896
|
},
|
|
892
897
|
context_window: 2e5,
|
|
893
898
|
prices: {
|
|
@@ -907,7 +912,7 @@ const ae = [
|
|
|
907
912
|
starts_with: "claude-sonnet-4"
|
|
908
913
|
},
|
|
909
914
|
{
|
|
910
|
-
starts_with: "claude-4-sonnet
|
|
915
|
+
starts_with: "claude-4-sonnet"
|
|
911
916
|
}
|
|
912
917
|
]
|
|
913
918
|
},
|
|
@@ -974,6 +979,9 @@ const ae = [
|
|
|
974
979
|
name: "AWS Bedrock",
|
|
975
980
|
pricing_urls: ["https://aws.amazon.com/bedrock/pricing/"],
|
|
976
981
|
api_pattern: "https://bedrock-runtime\\.[a-z0-9-]+\\.amazonaws\\.com/",
|
|
982
|
+
provider_match: {
|
|
983
|
+
contains: "bedrock"
|
|
984
|
+
},
|
|
977
985
|
models: [
|
|
978
986
|
{
|
|
979
987
|
id: "meta.llama3-8b-instruct-v1%3A0",
|
|
@@ -1802,6 +1810,9 @@ const ae = [
|
|
|
1802
1810
|
model_match: {
|
|
1803
1811
|
starts_with: "command-"
|
|
1804
1812
|
},
|
|
1813
|
+
provider_match: {
|
|
1814
|
+
contains: "cohere"
|
|
1815
|
+
},
|
|
1805
1816
|
extractors: [
|
|
1806
1817
|
{
|
|
1807
1818
|
api_flavor: "default",
|
|
@@ -1840,7 +1851,7 @@ const ae = [
|
|
|
1840
1851
|
description: `Command A is an open-weights 111B parameter model with a 256k context window focused on delivering great performance across agentic, multilingual, and coding use cases.
|
|
1841
1852
|
Compared to other leading proprietary and open-weights models Command A delivers maximum performance with minimum hardware costs, excelling on business-critical agentic and multilingual tasks.`,
|
|
1842
1853
|
match: {
|
|
1843
|
-
|
|
1854
|
+
starts_with: "command-a"
|
|
1844
1855
|
},
|
|
1845
1856
|
prices: {
|
|
1846
1857
|
input_mtok: 2.5,
|
|
@@ -2172,7 +2183,10 @@ Compared to other leading proprietary and open-weights models Command A delivers
|
|
|
2172
2183
|
contains: "google"
|
|
2173
2184
|
},
|
|
2174
2185
|
{
|
|
2175
|
-
|
|
2186
|
+
contains: "vertex"
|
|
2187
|
+
},
|
|
2188
|
+
{
|
|
2189
|
+
contains: "gemini"
|
|
2176
2190
|
}
|
|
2177
2191
|
]
|
|
2178
2192
|
},
|
|
@@ -2440,7 +2454,14 @@ Compared to other leading proprietary and open-weights models Command A delivers
|
|
|
2440
2454
|
name: "Gemini 2.5 Flash",
|
|
2441
2455
|
description: `Gemini 2.5 Flash is Google's state-of-the-art workhorse model, specifically designed for advanced reasoning, coding, mathematics, and scientific tasks. It includes built-in "thinking" capabilities, enabling it to provide responses with greater accuracy and nuanced context handling.`,
|
|
2442
2456
|
match: {
|
|
2443
|
-
|
|
2457
|
+
or: [
|
|
2458
|
+
{
|
|
2459
|
+
equals: "gemini-2.5-flash"
|
|
2460
|
+
},
|
|
2461
|
+
{
|
|
2462
|
+
equals: "gemini-2.5-flash-latest"
|
|
2463
|
+
}
|
|
2464
|
+
]
|
|
2444
2465
|
},
|
|
2445
2466
|
prices: {
|
|
2446
2467
|
input_mtok: 0.3,
|
|
@@ -2678,108 +2699,31 @@ Compared to other leading proprietary and open-weights models Command A delivers
|
|
|
2678
2699
|
}
|
|
2679
2700
|
},
|
|
2680
2701
|
{
|
|
2681
|
-
id: "gemma-
|
|
2682
|
-
name: "Gemma
|
|
2683
|
-
description: "
|
|
2684
|
-
match: {
|
|
2685
|
-
equals: "gemma-2-27b-it"
|
|
2686
|
-
},
|
|
2687
|
-
prices: {
|
|
2688
|
-
input_mtok: 0.8,
|
|
2689
|
-
output_mtok: 0.8
|
|
2690
|
-
}
|
|
2691
|
-
},
|
|
2692
|
-
{
|
|
2693
|
-
id: "gemma-2-9b-it",
|
|
2694
|
-
name: "Gemma 2 9B",
|
|
2695
|
-
description: "Gemma 2 9B by Google is an advanced, open-source language model that sets a new standard for efficiency and performance in its size class.",
|
|
2702
|
+
id: "gemma-3",
|
|
2703
|
+
name: "Gemma 3 (free)",
|
|
2704
|
+
description: "Lightweight, state-of the art, open model built from the same technology that powers our Gemini models.",
|
|
2696
2705
|
match: {
|
|
2697
|
-
|
|
2698
|
-
|
|
2699
|
-
|
|
2700
|
-
|
|
2701
|
-
|
|
2702
|
-
|
|
2703
|
-
|
|
2704
|
-
|
|
2705
|
-
id: "gemma-2-9b-it:free",
|
|
2706
|
-
name: "Gemma 2 9B (free)",
|
|
2707
|
-
description: "Gemma 2 9B by Google is an advanced, open-source language model that sets a new standard for efficiency and performance in its size class.",
|
|
2708
|
-
match: {
|
|
2709
|
-
equals: "gemma-2-9b-it:free"
|
|
2710
|
-
},
|
|
2711
|
-
prices: {}
|
|
2712
|
-
},
|
|
2713
|
-
{
|
|
2714
|
-
id: "gemma-3-12b-it",
|
|
2715
|
-
name: "Gemma 3 12B",
|
|
2716
|
-
description: "Gemma 3 introduces multimodality, supporting vision-language input and text outputs. It handles context windows up to 128k tokens, understands over 140 languages, and offers improved math, reasoning, and chat capabilities, including structured outputs and function calling. Gemma 3 12B is the second largest in the family of Gemma 3 models after Gemma 3 27B",
|
|
2717
|
-
match: {
|
|
2718
|
-
equals: "gemma-3-12b-it"
|
|
2719
|
-
},
|
|
2720
|
-
prices: {
|
|
2721
|
-
input_mtok: 0.05,
|
|
2722
|
-
output_mtok: 0.1
|
|
2723
|
-
}
|
|
2724
|
-
},
|
|
2725
|
-
{
|
|
2726
|
-
id: "gemma-3-12b-it:free",
|
|
2727
|
-
name: "Gemma 3 12B (free)",
|
|
2728
|
-
description: "Gemma 3 introduces multimodality, supporting vision-language input and text outputs. It handles context windows up to 128k tokens, understands over 140 languages, and offers improved math, reasoning, and chat capabilities, including structured outputs and function calling. Gemma 3 12B is the second largest in the family of Gemma 3 models after Gemma 3 27B",
|
|
2729
|
-
match: {
|
|
2730
|
-
equals: "gemma-3-12b-it:free"
|
|
2731
|
-
},
|
|
2732
|
-
prices: {}
|
|
2733
|
-
},
|
|
2734
|
-
{
|
|
2735
|
-
id: "gemma-3-27b-it",
|
|
2736
|
-
name: "Gemma 3 27B",
|
|
2737
|
-
description: "Gemma 3 introduces multimodality, supporting vision-language input and text outputs. It handles context windows up to 128k tokens, understands over 140 languages, and offers improved math, reasoning, and chat capabilities, including structured outputs and function calling. Gemma 3 27B is Google's latest open source model, successor to Gemma 2",
|
|
2738
|
-
match: {
|
|
2739
|
-
equals: "gemma-3-27b-it"
|
|
2740
|
-
},
|
|
2741
|
-
price_comments: "I can't find anything so trusting these prices, not sure the model still exists on Vertex or GCP",
|
|
2742
|
-
prices: {
|
|
2743
|
-
input_mtok: 0.1,
|
|
2744
|
-
output_mtok: 0.2
|
|
2745
|
-
}
|
|
2746
|
-
},
|
|
2747
|
-
{
|
|
2748
|
-
id: "gemma-3-27b-it:free",
|
|
2749
|
-
name: "Gemma 3 27B (free)",
|
|
2750
|
-
description: "Gemma 3 introduces multimodality, supporting vision-language input and text outputs. It handles context windows up to 128k tokens, understands over 140 languages, and offers improved math, reasoning, and chat capabilities, including structured outputs and function calling. Gemma 3 27B is Google's latest open source model, successor to Gemma 2",
|
|
2751
|
-
match: {
|
|
2752
|
-
equals: "gemma-3-27b-it:free"
|
|
2753
|
-
},
|
|
2754
|
-
prices: {}
|
|
2755
|
-
},
|
|
2756
|
-
{
|
|
2757
|
-
id: "gemma-3-4b-it",
|
|
2758
|
-
name: "Gemma 3 4B",
|
|
2759
|
-
description: "Gemma 3 introduces multimodality, supporting vision-language input and text outputs. It handles context windows up to 128k tokens, understands over 140 languages, and offers improved math, reasoning, and chat capabilities, including structured outputs and function calling.",
|
|
2760
|
-
match: {
|
|
2761
|
-
equals: "gemma-3-4b-it"
|
|
2762
|
-
},
|
|
2763
|
-
prices: {
|
|
2764
|
-
input_mtok: 0.02,
|
|
2765
|
-
output_mtok: 0.04
|
|
2766
|
-
}
|
|
2767
|
-
},
|
|
2768
|
-
{
|
|
2769
|
-
id: "gemma-3-4b-it:free",
|
|
2770
|
-
name: "Gemma 3 4B (free)",
|
|
2771
|
-
description: "Gemma 3 introduces multimodality, supporting vision-language input and text outputs. It handles context windows up to 128k tokens, understands over 140 languages, and offers improved math, reasoning, and chat capabilities, including structured outputs and function calling.",
|
|
2772
|
-
match: {
|
|
2773
|
-
equals: "gemma-3-4b-it:free"
|
|
2706
|
+
or: [
|
|
2707
|
+
{
|
|
2708
|
+
starts_with: "gemma-3-"
|
|
2709
|
+
},
|
|
2710
|
+
{
|
|
2711
|
+
equals: "gemma-3"
|
|
2712
|
+
}
|
|
2713
|
+
]
|
|
2774
2714
|
},
|
|
2775
2715
|
prices: {}
|
|
2776
2716
|
},
|
|
2777
2717
|
{
|
|
2778
|
-
id: "gemma-3n
|
|
2779
|
-
name: "Gemma 3n
|
|
2780
|
-
description: "
|
|
2718
|
+
id: "gemma-3n",
|
|
2719
|
+
name: "Gemma 3n (free)",
|
|
2720
|
+
description: "Our open model built for efficient performance on everyday devices like mobile phones, laptops, and tablets.",
|
|
2781
2721
|
match: {
|
|
2782
|
-
|
|
2722
|
+
or: [
|
|
2723
|
+
{
|
|
2724
|
+
starts_with: "gemma-3n"
|
|
2725
|
+
}
|
|
2726
|
+
]
|
|
2783
2727
|
},
|
|
2784
2728
|
prices: {}
|
|
2785
2729
|
}
|
|
@@ -2811,25 +2755,57 @@ Compared to other leading proprietary and open-weights models Command A delivers
|
|
|
2811
2755
|
],
|
|
2812
2756
|
models: [
|
|
2813
2757
|
{
|
|
2814
|
-
id: "
|
|
2758
|
+
id: "deepseek-r1-distill-llama-70b",
|
|
2759
|
+
name: "DeepSeek R1 Distill Llama 70B",
|
|
2815
2760
|
match: {
|
|
2816
|
-
equals: "
|
|
2761
|
+
equals: "deepseek-r1-distill-llama-70b"
|
|
2817
2762
|
},
|
|
2763
|
+
context_window: 131072,
|
|
2818
2764
|
prices: {
|
|
2819
|
-
input_mtok: 0.
|
|
2820
|
-
output_mtok: 0.
|
|
2765
|
+
input_mtok: 0.75,
|
|
2766
|
+
output_mtok: 0.99
|
|
2821
2767
|
}
|
|
2822
2768
|
},
|
|
2823
2769
|
{
|
|
2824
2770
|
id: "gemma2-9b-it",
|
|
2771
|
+
name: "Gemma 2 9B 8k",
|
|
2825
2772
|
match: {
|
|
2826
|
-
|
|
2773
|
+
or: [
|
|
2774
|
+
{
|
|
2775
|
+
equals: "gemma2-9b-it"
|
|
2776
|
+
},
|
|
2777
|
+
{
|
|
2778
|
+
equals: "gemma2-9b"
|
|
2779
|
+
}
|
|
2780
|
+
]
|
|
2827
2781
|
},
|
|
2828
2782
|
prices: {
|
|
2829
2783
|
input_mtok: 0.2,
|
|
2830
2784
|
output_mtok: 0.2
|
|
2831
2785
|
}
|
|
2832
2786
|
},
|
|
2787
|
+
{
|
|
2788
|
+
id: "llama-3.1-8b-instant",
|
|
2789
|
+
name: "Llama 3.1 8B Instant 128k",
|
|
2790
|
+
match: {
|
|
2791
|
+
equals: "llama-3.1-8b-instant"
|
|
2792
|
+
},
|
|
2793
|
+
prices: {
|
|
2794
|
+
input_mtok: 0.05,
|
|
2795
|
+
output_mtok: 0.08
|
|
2796
|
+
}
|
|
2797
|
+
},
|
|
2798
|
+
{
|
|
2799
|
+
id: "llama-3.3-70b-versatile",
|
|
2800
|
+
name: "Llama 3.3 70B Versatile 128k",
|
|
2801
|
+
match: {
|
|
2802
|
+
equals: "llama-3.3-70b-versatile"
|
|
2803
|
+
},
|
|
2804
|
+
prices: {
|
|
2805
|
+
input_mtok: 0.59,
|
|
2806
|
+
output_mtok: 0.79
|
|
2807
|
+
}
|
|
2808
|
+
},
|
|
2833
2809
|
{
|
|
2834
2810
|
id: "llama2-70b-4096",
|
|
2835
2811
|
match: {
|
|
@@ -2881,13 +2857,50 @@ Compared to other leading proprietary and open-weights models Command A delivers
|
|
|
2881
2857
|
}
|
|
2882
2858
|
},
|
|
2883
2859
|
{
|
|
2884
|
-
id: "
|
|
2860
|
+
id: "meta-llama/llama-4-maverick-17b-128e-instruct",
|
|
2861
|
+
name: "Llama 4 Maverick 17B 128E",
|
|
2885
2862
|
match: {
|
|
2886
|
-
equals: "
|
|
2863
|
+
equals: "meta-llama/llama-4-maverick-17b-128e-instruct"
|
|
2887
2864
|
},
|
|
2865
|
+
context_window: 131072,
|
|
2888
2866
|
prices: {
|
|
2889
|
-
input_mtok: 0.
|
|
2890
|
-
output_mtok: 0.
|
|
2867
|
+
input_mtok: 0.2,
|
|
2868
|
+
output_mtok: 0.6
|
|
2869
|
+
}
|
|
2870
|
+
},
|
|
2871
|
+
{
|
|
2872
|
+
id: "meta-llama/llama-4-scout-17b-16e-instruct",
|
|
2873
|
+
name: "Llama 4 Scout (17Bx16E) 128k",
|
|
2874
|
+
match: {
|
|
2875
|
+
equals: "meta-llama/llama-4-scout-17b-16e-instruct"
|
|
2876
|
+
},
|
|
2877
|
+
prices: {
|
|
2878
|
+
input_mtok: 0.11,
|
|
2879
|
+
output_mtok: 0.34
|
|
2880
|
+
}
|
|
2881
|
+
},
|
|
2882
|
+
{
|
|
2883
|
+
id: "meta-llama/llama-guard-4-12b",
|
|
2884
|
+
name: "Llama Guard 4 12B",
|
|
2885
|
+
match: {
|
|
2886
|
+
equals: "meta-llama/llama-guard-4-12b"
|
|
2887
|
+
},
|
|
2888
|
+
context_window: 131072,
|
|
2889
|
+
prices: {
|
|
2890
|
+
input_mtok: 0.2,
|
|
2891
|
+
output_mtok: 0.2
|
|
2892
|
+
}
|
|
2893
|
+
},
|
|
2894
|
+
{
|
|
2895
|
+
id: "moonshotai/kimi-k2-instruct",
|
|
2896
|
+
name: "Kimi K2 1T 128k",
|
|
2897
|
+
match: {
|
|
2898
|
+
equals: "moonshotai/kimi-k2-instruct"
|
|
2899
|
+
},
|
|
2900
|
+
context_window: 131072,
|
|
2901
|
+
prices: {
|
|
2902
|
+
input_mtok: 1,
|
|
2903
|
+
output_mtok: 3
|
|
2891
2904
|
}
|
|
2892
2905
|
},
|
|
2893
2906
|
{
|
|
@@ -2917,6 +2930,17 @@ Compared to other leading proprietary and open-weights models Command A delivers
|
|
|
2917
2930
|
input_mtok: 0.1,
|
|
2918
2931
|
output_mtok: 0.5
|
|
2919
2932
|
}
|
|
2933
|
+
},
|
|
2934
|
+
{
|
|
2935
|
+
id: "qwen/qwen3-32b",
|
|
2936
|
+
name: "Qwen3 32B 131k",
|
|
2937
|
+
match: {
|
|
2938
|
+
equals: "qwen/qwen3-32b"
|
|
2939
|
+
},
|
|
2940
|
+
prices: {
|
|
2941
|
+
input_mtok: 0.29,
|
|
2942
|
+
output_mtok: 0.59
|
|
2943
|
+
}
|
|
2920
2944
|
}
|
|
2921
2945
|
]
|
|
2922
2946
|
},
|
|
@@ -2992,16 +3016,13 @@ Compared to other leading proprietary and open-weights models Command A delivers
|
|
|
2992
3016
|
prices: {}
|
|
2993
3017
|
},
|
|
2994
3018
|
{
|
|
2995
|
-
id: "magistral-medium
|
|
2996
|
-
name: "Magistral Medium
|
|
3019
|
+
id: "magistral-medium",
|
|
3020
|
+
name: "Magistral Medium",
|
|
2997
3021
|
description: "Magistral is Mistral's first reasoning model. It is ideal for general purpose use requiring longer thought processing and better accuracy than with non-reasoning LLMs. From legal research and financial forecasting to software development and creative storytelling — this model solves multi-step challenges where transparency and precision are critical.",
|
|
2998
3022
|
match: {
|
|
2999
3023
|
or: [
|
|
3000
3024
|
{
|
|
3001
|
-
|
|
3002
|
-
},
|
|
3003
|
-
{
|
|
3004
|
-
equals: "magistral-medium-2506:thinking"
|
|
3025
|
+
starts_with: "magistral-medium"
|
|
3005
3026
|
}
|
|
3006
3027
|
]
|
|
3007
3028
|
},
|
|
@@ -3011,11 +3032,11 @@ Compared to other leading proprietary and open-weights models Command A delivers
|
|
|
3011
3032
|
}
|
|
3012
3033
|
},
|
|
3013
3034
|
{
|
|
3014
|
-
id: "magistral-small
|
|
3015
|
-
name: "Magistral Small
|
|
3035
|
+
id: "magistral-small",
|
|
3036
|
+
name: "Magistral Small",
|
|
3016
3037
|
description: "Magistral Small is a 24B parameter instruction-tuned model based on Mistral-Small-3.1 (2503), enhanced through supervised fine-tuning on traces from Magistral Medium and further refined via reinforcement learning. It is optimized for reasoning and supports a wide multilingual range, including over 20 languages.",
|
|
3017
3038
|
match: {
|
|
3018
|
-
|
|
3039
|
+
starts_with: "magistral-small-"
|
|
3019
3040
|
},
|
|
3020
3041
|
prices: {
|
|
3021
3042
|
input_mtok: 0.5,
|
|
@@ -3036,68 +3057,34 @@ Compared to other leading proprietary and open-weights models Command A delivers
|
|
|
3036
3057
|
},
|
|
3037
3058
|
{
|
|
3038
3059
|
id: "ministral-8b",
|
|
3039
|
-
name: "Ministral 8B",
|
|
3060
|
+
name: "Ministral 8B 24.10",
|
|
3040
3061
|
description: "Ministral 8B is an 8B parameter model featuring a unique interleaved sliding-window attention pattern for faster, memory-efficient inference. Designed for edge use cases, it supports up to 128k context length and excels in knowledge and reasoning tasks. It outperforms peers in the sub-10B category, making it perfect for low-latency, privacy-first applications.",
|
|
3041
3062
|
match: {
|
|
3042
|
-
|
|
3063
|
+
starts_with: "ministral-8b"
|
|
3043
3064
|
},
|
|
3044
3065
|
prices: {
|
|
3045
3066
|
input_mtok: 0.1,
|
|
3046
|
-
output_mtok:
|
|
3067
|
+
output_mtok: 1
|
|
3047
3068
|
}
|
|
3048
3069
|
},
|
|
3049
3070
|
{
|
|
3050
|
-
id: "mistral-7b
|
|
3051
|
-
name: "Mistral 7B
|
|
3052
|
-
description: "A high-performing, industry-standard 7.3B parameter model, with optimizations for speed and context length.",
|
|
3071
|
+
id: "mistral-7b",
|
|
3072
|
+
name: "Mistral 7B",
|
|
3053
3073
|
match: {
|
|
3054
3074
|
or: [
|
|
3055
3075
|
{
|
|
3056
|
-
equals: "mistral-7b
|
|
3076
|
+
equals: "mistral-7b"
|
|
3057
3077
|
},
|
|
3058
3078
|
{
|
|
3059
|
-
equals: "mistral-7b
|
|
3079
|
+
equals: "open-mistral-7b"
|
|
3060
3080
|
}
|
|
3061
3081
|
]
|
|
3062
3082
|
},
|
|
3063
3083
|
prices: {
|
|
3064
|
-
input_mtok: 0.
|
|
3065
|
-
output_mtok: 0.
|
|
3066
|
-
}
|
|
3067
|
-
},
|
|
3068
|
-
{
|
|
3069
|
-
id: "mistral-7b-instruct-v0.1",
|
|
3070
|
-
name: "Mistral 7B Instruct v0.1",
|
|
3071
|
-
description: "A 7.3B parameter model that outperforms Llama 2 13B on all benchmarks, with optimizations for speed and context length.",
|
|
3072
|
-
match: {
|
|
3073
|
-
equals: "mistral-7b-instruct-v0.1"
|
|
3074
|
-
},
|
|
3075
|
-
prices: {
|
|
3076
|
-
input_mtok: 0.11,
|
|
3077
|
-
output_mtok: 0.19
|
|
3078
|
-
}
|
|
3079
|
-
},
|
|
3080
|
-
{
|
|
3081
|
-
id: "mistral-7b-instruct-v0.2",
|
|
3082
|
-
name: "Mistral 7B Instruct v0.2",
|
|
3083
|
-
description: "A high-performing, industry-standard 7.3B parameter model, with optimizations for speed and context length.",
|
|
3084
|
-
match: {
|
|
3085
|
-
equals: "mistral-7b-instruct-v0.2"
|
|
3086
|
-
},
|
|
3087
|
-
prices: {
|
|
3088
|
-
input_mtok: 0.2,
|
|
3089
|
-
output_mtok: 0.2
|
|
3084
|
+
input_mtok: 0.25,
|
|
3085
|
+
output_mtok: 0.25
|
|
3090
3086
|
}
|
|
3091
3087
|
},
|
|
3092
|
-
{
|
|
3093
|
-
id: "mistral-7b-instruct:free",
|
|
3094
|
-
name: "Mistral 7B Instruct (free)",
|
|
3095
|
-
description: "A high-performing, industry-standard 7.3B parameter model, with optimizations for speed and context length.",
|
|
3096
|
-
match: {
|
|
3097
|
-
equals: "mistral-7b-instruct:free"
|
|
3098
|
-
},
|
|
3099
|
-
prices: {}
|
|
3100
|
-
},
|
|
3101
3088
|
{
|
|
3102
3089
|
id: "mistral-embed",
|
|
3103
3090
|
match: {
|
|
@@ -3138,14 +3125,7 @@ Compared to other leading proprietary and open-weights models Command A delivers
|
|
|
3138
3125
|
name: "Mistral Medium 3",
|
|
3139
3126
|
description: "Mistral Medium 3 is a high-performance enterprise-grade language model designed to deliver frontier-level capabilities at significantly reduced operational cost. It balances state-of-the-art reasoning and multimodal performance with 8× lower cost compared to traditional large models, making it suitable for scalable deployments across professional and industrial use cases.",
|
|
3140
3127
|
match: {
|
|
3141
|
-
|
|
3142
|
-
{
|
|
3143
|
-
equals: "mistral-medium-3"
|
|
3144
|
-
},
|
|
3145
|
-
{
|
|
3146
|
-
equals: "mistral-medium-latest"
|
|
3147
|
-
}
|
|
3148
|
-
]
|
|
3128
|
+
starts_with: "mistral-medium"
|
|
3149
3129
|
},
|
|
3150
3130
|
prices: {
|
|
3151
3131
|
input_mtok: 0.4,
|
|
@@ -3157,7 +3137,14 @@ Compared to other leading proprietary and open-weights models Command A delivers
|
|
|
3157
3137
|
name: "Mistral NeMo",
|
|
3158
3138
|
description: "A 12B parameter model with a 128k token context length built by Mistral in collaboration with NVIDIA.",
|
|
3159
3139
|
match: {
|
|
3160
|
-
|
|
3140
|
+
or: [
|
|
3141
|
+
{
|
|
3142
|
+
equals: "mistral-nemo"
|
|
3143
|
+
},
|
|
3144
|
+
{
|
|
3145
|
+
equals: "open-mistral-nemo"
|
|
3146
|
+
}
|
|
3147
|
+
]
|
|
3161
3148
|
},
|
|
3162
3149
|
prices: {
|
|
3163
3150
|
input_mtok: 0.15,
|
|
@@ -3197,7 +3184,7 @@ Compared to other leading proprietary and open-weights models Command A delivers
|
|
|
3197
3184
|
name: "Mistral Small",
|
|
3198
3185
|
description: "With 22 billion parameters, Mistral Small v24.09 offers a convenient mid-point between (Mistral NeMo 12B)[/mistralai/mistral-nemo] and (Mistral Large 2)[/mistralai/mistral-large], providing a cost-effective solution that can be deployed across various platforms and environments. It has better reasoning, exhibits more capabilities, can produce and reason about code, and is multiligual, supporting English, French, German, Italian, and Spanish.",
|
|
3199
3186
|
match: {
|
|
3200
|
-
|
|
3187
|
+
starts_with: "mistral-small"
|
|
3201
3188
|
},
|
|
3202
3189
|
prices: {
|
|
3203
3190
|
input_mtok: 0.2,
|
|
@@ -3266,31 +3253,17 @@ Compared to other leading proprietary and open-weights models Command A delivers
|
|
|
3266
3253
|
}
|
|
3267
3254
|
},
|
|
3268
3255
|
{
|
|
3269
|
-
id: "mixtral-8x7b
|
|
3270
|
-
name: "Mixtral 8x7B
|
|
3271
|
-
description: "Mixtral 8x7B Instruct is a pretrained generative Sparse Mixture of Experts, by Mistral AI, for chat and instruction use. Incorporates 8 experts (feed-forward networks) for a total of 47 billion parameters.",
|
|
3272
|
-
match: {
|
|
3273
|
-
equals: "mixtral-8x7b-instruct"
|
|
3274
|
-
},
|
|
3275
|
-
prices: {
|
|
3276
|
-
input_mtok: 0.08,
|
|
3277
|
-
output_mtok: 0.24
|
|
3278
|
-
}
|
|
3279
|
-
},
|
|
3280
|
-
{
|
|
3281
|
-
id: "open-mistral-7b",
|
|
3282
|
-
match: {
|
|
3283
|
-
equals: "open-mistral-7b"
|
|
3284
|
-
},
|
|
3285
|
-
prices: {
|
|
3286
|
-
input_mtok: 0.25,
|
|
3287
|
-
output_mtok: 0.25
|
|
3288
|
-
}
|
|
3289
|
-
},
|
|
3290
|
-
{
|
|
3291
|
-
id: "open-mixtral-8x7b",
|
|
3256
|
+
id: "mixtral-8x7b",
|
|
3257
|
+
name: "Mixtral 8x7B",
|
|
3292
3258
|
match: {
|
|
3293
|
-
|
|
3259
|
+
or: [
|
|
3260
|
+
{
|
|
3261
|
+
starts_with: "mixtral-8x7b"
|
|
3262
|
+
},
|
|
3263
|
+
{
|
|
3264
|
+
equals: "open-mixtral-8x7b"
|
|
3265
|
+
}
|
|
3266
|
+
]
|
|
3294
3267
|
},
|
|
3295
3268
|
prices: {
|
|
3296
3269
|
input_mtok: 0.7,
|
|
@@ -3712,6 +3685,9 @@ Compared to other leading proprietary and open-weights models Command A delivers
|
|
|
3712
3685
|
}
|
|
3713
3686
|
]
|
|
3714
3687
|
},
|
|
3688
|
+
provider_match: {
|
|
3689
|
+
contains: "openai"
|
|
3690
|
+
},
|
|
3715
3691
|
extractors: [
|
|
3716
3692
|
{
|
|
3717
3693
|
api_flavor: "chat",
|
|
@@ -10552,6 +10528,16 @@ Compared to other leading proprietary and open-weights models Command A delivers
|
|
|
10552
10528
|
name: "Together AI",
|
|
10553
10529
|
pricing_urls: ["https://www.together.ai/pricing"],
|
|
10554
10530
|
api_pattern: "https://api\\.together\\.xyz",
|
|
10531
|
+
provider_match: {
|
|
10532
|
+
or: [
|
|
10533
|
+
{
|
|
10534
|
+
equals: "together-ai"
|
|
10535
|
+
},
|
|
10536
|
+
{
|
|
10537
|
+
equals: "together_ai"
|
|
10538
|
+
}
|
|
10539
|
+
]
|
|
10540
|
+
},
|
|
10555
10541
|
models: [
|
|
10556
10542
|
{
|
|
10557
10543
|
id: "Austism/chronos-hermes-13b",
|
|
@@ -11342,6 +11328,9 @@ Compared to other leading proprietary and open-weights models Command A delivers
|
|
|
11342
11328
|
model_match: {
|
|
11343
11329
|
contains: "grok"
|
|
11344
11330
|
},
|
|
11331
|
+
provider_match: {
|
|
11332
|
+
equals: "xai"
|
|
11333
|
+
},
|
|
11345
11334
|
extractors: [
|
|
11346
11335
|
{
|
|
11347
11336
|
api_flavor: "chat",
|
|
@@ -11541,23 +11530,23 @@ Compared to other leading proprietary and open-weights models Command A delivers
|
|
|
11541
11530
|
]
|
|
11542
11531
|
}
|
|
11543
11532
|
];
|
|
11544
|
-
function We(
|
|
11533
|
+
function We(i, n) {
|
|
11545
11534
|
if (n <= 0) return 0;
|
|
11546
11535
|
let m = 0;
|
|
11547
|
-
const s = [...
|
|
11548
|
-
m += _ *
|
|
11536
|
+
const s = [...i.tiers].sort((k, h) => k.start - h.start), u = s[0]?.start ?? n, _ = Math.min(n, u);
|
|
11537
|
+
m += _ * i.base / 1e6;
|
|
11549
11538
|
for (let k = 0; k < s.length; k++) {
|
|
11550
|
-
const h = s[k], f = s[k + 1]?.start ?? 1 / 0,
|
|
11551
|
-
|
|
11539
|
+
const h = s[k], f = s[k + 1]?.start ?? 1 / 0, T = Math.max(0, Math.min(n, f) - h.start);
|
|
11540
|
+
T > 0 && (m += T * h.price / 1e6);
|
|
11552
11541
|
}
|
|
11553
11542
|
return m;
|
|
11554
11543
|
}
|
|
11555
|
-
function
|
|
11556
|
-
return
|
|
11544
|
+
function S(i, n, m) {
|
|
11545
|
+
return i === void 0 || n === void 0 ? 0 : typeof i == "number" ? i * n / 1e6 : We(i, n);
|
|
11557
11546
|
}
|
|
11558
|
-
function Ue(
|
|
11547
|
+
function Ue(i, n) {
|
|
11559
11548
|
let m = 0, s = 0;
|
|
11560
|
-
m +=
|
|
11549
|
+
m += S(n.input_mtok, i.input_tokens), m += S(n.cache_write_mtok, i.cache_write_tokens), m += S(n.cache_read_mtok, i.cache_read_tokens), m += S(n.input_audio_mtok, i.input_audio_tokens), m += S(n.cache_audio_read_mtok, i.cache_audio_read_tokens), s += S(n.output_mtok, i.output_tokens), s += S(n.output_audio_mtok, i.output_audio_tokens), n.requests_kcount !== void 0 && (m += n.requests_kcount / 1e3);
|
|
11561
11550
|
const u = m + s;
|
|
11562
11551
|
return {
|
|
11563
11552
|
input_price: m,
|
|
@@ -11565,11 +11554,11 @@ function Ue(a, n) {
|
|
|
11565
11554
|
total_price: u
|
|
11566
11555
|
};
|
|
11567
11556
|
}
|
|
11568
|
-
function Ke(
|
|
11569
|
-
if (!Array.isArray(
|
|
11570
|
-
return
|
|
11571
|
-
for (let m =
|
|
11572
|
-
const s =
|
|
11557
|
+
function Ke(i, n) {
|
|
11558
|
+
if (!Array.isArray(i.prices))
|
|
11559
|
+
return i.prices;
|
|
11560
|
+
for (let m = i.prices.length - 1; m >= 0; m--) {
|
|
11561
|
+
const s = i.prices[m], u = s.constraint;
|
|
11573
11562
|
if (u === void 0)
|
|
11574
11563
|
return s.prices;
|
|
11575
11564
|
if (u.type === "start_date") {
|
|
@@ -11584,49 +11573,54 @@ function Ke(a, n) {
|
|
|
11584
11573
|
return s.prices;
|
|
11585
11574
|
}
|
|
11586
11575
|
}
|
|
11587
|
-
return
|
|
11576
|
+
return i.prices[0].prices;
|
|
11588
11577
|
}
|
|
11589
|
-
function z(
|
|
11590
|
-
return "or" in
|
|
11578
|
+
function z(i, n) {
|
|
11579
|
+
return "or" in i ? i.or.some((m) => z(m, n)) : "and" in i ? i.and.every((m) => z(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;
|
|
11591
11580
|
}
|
|
11592
|
-
function Ye(
|
|
11593
|
-
const m = n.toLowerCase().trim(), s =
|
|
11594
|
-
return s ||
|
|
11581
|
+
function Ye(i, n) {
|
|
11582
|
+
const m = n.toLowerCase().trim(), s = i.find((u) => u.id === m);
|
|
11583
|
+
return s || i.find((u) => u.provider_match && z(u.provider_match, m));
|
|
11595
11584
|
}
|
|
11596
|
-
function Je(
|
|
11597
|
-
|
|
11585
|
+
function Je(i, { modelId: n, providerApiUrl: m, providerId: s }) {
|
|
11586
|
+
if (s)
|
|
11587
|
+
return Ye(i, s);
|
|
11588
|
+
if (m)
|
|
11589
|
+
return i.find((u) => new RegExp(u.api_pattern).test(m));
|
|
11590
|
+
if (n)
|
|
11591
|
+
return i.find((u) => u.model_match && z(u.model_match, n));
|
|
11598
11592
|
}
|
|
11599
|
-
function Ze(
|
|
11600
|
-
return
|
|
11593
|
+
function Ze(i, n) {
|
|
11594
|
+
return i.find((m) => z(m.match, n));
|
|
11601
11595
|
}
|
|
11602
|
-
let Xe =
|
|
11603
|
-
Promise.resolve(
|
|
11604
|
-
function et(
|
|
11605
|
-
const s = Je(Xe,
|
|
11606
|
-
if (!s) return null;
|
|
11607
|
-
const u = Ze(s.models, n);
|
|
11596
|
+
let Xe = ie;
|
|
11597
|
+
Promise.resolve(ie);
|
|
11598
|
+
function et(i, n, m) {
|
|
11599
|
+
const s = n.toLowerCase().trim(), u = m?.provider ?? Je(Xe, { modelId: s, providerApiUrl: m?.providerApiUrl, providerId: m?.providerId });
|
|
11608
11600
|
if (!u) return null;
|
|
11609
|
-
const _ =
|
|
11601
|
+
const _ = Ze(u.models, s);
|
|
11602
|
+
if (!_) return null;
|
|
11603
|
+
const k = m?.timestamp ?? /* @__PURE__ */ new Date(), h = Ke(_, k), f = Ue(i, h);
|
|
11610
11604
|
return {
|
|
11611
11605
|
auto_update_timestamp: void 0,
|
|
11612
|
-
model:
|
|
11613
|
-
model_price:
|
|
11614
|
-
provider:
|
|
11615
|
-
...
|
|
11606
|
+
model: _,
|
|
11607
|
+
model_price: h,
|
|
11608
|
+
provider: u,
|
|
11609
|
+
...f
|
|
11616
11610
|
};
|
|
11617
11611
|
}
|
|
11618
11612
|
const b = de(Ce(process.argv)).scriptName("genai-prices").command(
|
|
11619
11613
|
"list [provider]",
|
|
11620
11614
|
"List providers and models",
|
|
11621
|
-
(
|
|
11615
|
+
(i) => i.positional("provider", { describe: "Provider ID to filter", type: "string" })
|
|
11622
11616
|
).command(
|
|
11623
11617
|
"calc <model...>",
|
|
11624
11618
|
"Calculate price",
|
|
11625
|
-
(
|
|
11619
|
+
(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" })
|
|
11626
11620
|
).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();
|
|
11627
11621
|
function tt() {
|
|
11628
11622
|
if (b._[0] === "list") {
|
|
11629
|
-
const m =
|
|
11623
|
+
const m = ie;
|
|
11630
11624
|
if (b.provider) {
|
|
11631
11625
|
const s = m.find((u) => u.id === b.provider);
|
|
11632
11626
|
s || (console.error(`Provider ${b.provider} not found.`), process.exit(1)), console.log(`${s.name}: (${s.models.length} models)`);
|
|
@@ -11662,11 +11656,11 @@ function tt() {
|
|
|
11662
11656
|
u = !0, console.error(`No price found for model ${_}`);
|
|
11663
11657
|
continue;
|
|
11664
11658
|
}
|
|
11665
|
-
const
|
|
11659
|
+
const T = f.model.context_window, C = [
|
|
11666
11660
|
["Provider", f.provider.name],
|
|
11667
11661
|
["Model", f.model.name ?? f.model.id],
|
|
11668
11662
|
["Model Prices", JSON.stringify(f.model_price)],
|
|
11669
|
-
["Context Window",
|
|
11663
|
+
["Context Window", T !== void 0 ? T.toLocaleString() : void 0],
|
|
11670
11664
|
["Total Price", `$${f.total_price}`],
|
|
11671
11665
|
["Input Price", `$${f.input_price}`],
|
|
11672
11666
|
["Output Price", `$${f.output_price}`]
|