ai-speedometer 2.0.4 → 2.0.5
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/ai-speedometer +76 -54
- package/package.json +1 -1
- package/dist/highlights-eq9cgrbb.scm +0 -604
- package/dist/highlights-ghv9g403.scm +0 -205
- package/dist/highlights-hk7bwhj4.scm +0 -284
- package/dist/highlights-r812a2qc.scm +0 -150
- package/dist/highlights-x6tmsnaa.scm +0 -115
- package/dist/injections-73j83es3.scm +0 -27
- package/dist/tree-sitter-javascript-nd0q4pe9.wasm +0 -0
- package/dist/tree-sitter-markdown-411r6y9b.wasm +0 -0
- package/dist/tree-sitter-markdown_inline-j5349f42.wasm +0 -0
- package/dist/tree-sitter-typescript-zxjzwt75.wasm +0 -0
- package/dist/tree-sitter-zig-e78zbjpm.wasm +0 -0
package/dist/ai-speedometer
CHANGED
|
@@ -1474,61 +1474,85 @@ var getXDGPaths = () => ({
|
|
|
1474
1474
|
}
|
|
1475
1475
|
return merged;
|
|
1476
1476
|
}, getOpencodeGlobalConfigProviders = async () => {
|
|
1477
|
+
return getAuthenticatedProviders();
|
|
1478
|
+
}, getAuthenticatedProviders = async () => {
|
|
1477
1479
|
try {
|
|
1478
|
-
const globalConfig =
|
|
1479
|
-
|
|
1480
|
-
|
|
1481
|
-
|
|
1482
|
-
|
|
1483
|
-
|
|
1484
|
-
|
|
1485
|
-
|
|
1486
|
-
|
|
1487
|
-
|
|
1488
|
-
let models = [];
|
|
1489
|
-
if (entry.models && Object.keys(entry.models).length > 0) {
|
|
1490
|
-
models = Object.entries(entry.models).map(([modelKey, m]) => ({
|
|
1491
|
-
id: `${providerId}_${m.id ?? modelKey}`,
|
|
1492
|
-
name: m.name ?? m.id ?? modelKey
|
|
1493
|
-
}));
|
|
1494
|
-
} else if (mdProvider) {
|
|
1495
|
-
models = mdProvider.models.map((m) => ({ id: `${providerId}_${m.id}`, name: m.name }));
|
|
1480
|
+
const [allModelsDevProviders, authData, globalConfig] = await Promise.all([
|
|
1481
|
+
getAllProviders(),
|
|
1482
|
+
readAuthJson(),
|
|
1483
|
+
Promise.resolve(readOpencodeGlobalConfig())
|
|
1484
|
+
]);
|
|
1485
|
+
const database = new Map;
|
|
1486
|
+
for (const mdProvider of allModelsDevProviders) {
|
|
1487
|
+
const modelMap = new Map;
|
|
1488
|
+
for (const m of mdProvider.models) {
|
|
1489
|
+
modelMap.set(`${mdProvider.id}_${m.id}`, { id: `${mdProvider.id}_${m.id}`, name: m.name });
|
|
1496
1490
|
}
|
|
1497
|
-
|
|
1498
|
-
|
|
1499
|
-
|
|
1500
|
-
|
|
1501
|
-
|
|
1502
|
-
|
|
1503
|
-
baseUrl: entry.options?.baseURL ?? entry.api ?? mdProvider?.baseUrl ?? "",
|
|
1504
|
-
apiKey,
|
|
1505
|
-
models
|
|
1491
|
+
database.set(mdProvider.id, {
|
|
1492
|
+
id: mdProvider.id,
|
|
1493
|
+
name: mdProvider.name,
|
|
1494
|
+
type: mdProvider.type,
|
|
1495
|
+
baseUrl: mdProvider.baseUrl,
|
|
1496
|
+
models: modelMap
|
|
1506
1497
|
});
|
|
1507
1498
|
}
|
|
1508
|
-
|
|
1509
|
-
|
|
1510
|
-
|
|
1511
|
-
|
|
1512
|
-
|
|
1513
|
-
|
|
1514
|
-
|
|
1515
|
-
|
|
1516
|
-
|
|
1517
|
-
|
|
1518
|
-
|
|
1519
|
-
|
|
1520
|
-
|
|
1521
|
-
|
|
1522
|
-
|
|
1523
|
-
|
|
1524
|
-
|
|
1525
|
-
|
|
1499
|
+
for (const [providerID, entry] of Object.entries(globalConfig.provider ?? {})) {
|
|
1500
|
+
const existing = database.get(providerID);
|
|
1501
|
+
const modelMap = existing ? new Map(existing.models) : new Map;
|
|
1502
|
+
for (const [modelKey, m] of Object.entries(entry.models ?? {})) {
|
|
1503
|
+
const resolvedId = `${providerID}_${m.id ?? modelKey}`;
|
|
1504
|
+
modelMap.set(resolvedId, { id: resolvedId, name: m.name ?? m.id ?? modelKey });
|
|
1505
|
+
}
|
|
1506
|
+
database.set(providerID, {
|
|
1507
|
+
id: providerID,
|
|
1508
|
+
name: entry.name ?? existing?.name ?? providerID,
|
|
1509
|
+
type: existing?.type ?? "openai-compatible",
|
|
1510
|
+
baseUrl: entry.options?.baseURL ?? entry.api ?? existing?.baseUrl ?? "",
|
|
1511
|
+
models: modelMap,
|
|
1512
|
+
npm: entry.npm
|
|
1513
|
+
});
|
|
1514
|
+
}
|
|
1515
|
+
const providerMap = new Map;
|
|
1516
|
+
for (const [providerID, authInfo] of Object.entries(authData)) {
|
|
1517
|
+
if (authInfo.type !== "api" || !authInfo.key)
|
|
1518
|
+
continue;
|
|
1519
|
+
const dbEntry = database.get(providerID);
|
|
1520
|
+
if (!dbEntry)
|
|
1521
|
+
continue;
|
|
1522
|
+
const configEntry = globalConfig.provider?.[providerID];
|
|
1523
|
+
const npm = dbEntry.npm ?? configEntry?.npm;
|
|
1524
|
+
const type = npm?.includes("anthropic") ? "anthropic" : dbEntry.type;
|
|
1525
|
+
providerMap.set(providerID, {
|
|
1526
|
+
id: providerID,
|
|
1527
|
+
name: dbEntry.name,
|
|
1528
|
+
type,
|
|
1529
|
+
baseUrl: dbEntry.baseUrl,
|
|
1526
1530
|
apiKey: authInfo.key,
|
|
1527
|
-
models:
|
|
1531
|
+
models: Array.from(dbEntry.models.values())
|
|
1528
1532
|
});
|
|
1529
1533
|
}
|
|
1534
|
+
for (const [providerID, entry] of Object.entries(globalConfig.provider ?? {})) {
|
|
1535
|
+
if (!entry.options?.apiKey)
|
|
1536
|
+
continue;
|
|
1537
|
+
const dbEntry = database.get(providerID);
|
|
1538
|
+
if (!dbEntry)
|
|
1539
|
+
continue;
|
|
1540
|
+
const npm = dbEntry.npm ?? entry.npm;
|
|
1541
|
+
const type = npm?.includes("anthropic") ? "anthropic" : dbEntry.type;
|
|
1542
|
+
providerMap.set(providerID, {
|
|
1543
|
+
id: providerID,
|
|
1544
|
+
name: dbEntry.name,
|
|
1545
|
+
type,
|
|
1546
|
+
baseUrl: dbEntry.baseUrl,
|
|
1547
|
+
apiKey: entry.options.apiKey,
|
|
1548
|
+
models: Array.from(dbEntry.models.values())
|
|
1549
|
+
});
|
|
1550
|
+
}
|
|
1551
|
+
return Array.from(providerMap.values());
|
|
1552
|
+
} catch (error) {
|
|
1553
|
+
console.warn("Warning: Could not load providers:", error.message);
|
|
1554
|
+
return [];
|
|
1530
1555
|
}
|
|
1531
|
-
return authenticatedProviders;
|
|
1532
1556
|
}, getCustomProviders = async () => [], verifyProvider = async (providerId) => {
|
|
1533
1557
|
try {
|
|
1534
1558
|
const allProviders = await getAllProviders();
|
|
@@ -1549,7 +1573,7 @@ var getXDGPaths = () => ({
|
|
|
1549
1573
|
}
|
|
1550
1574
|
return true;
|
|
1551
1575
|
}, getAllAvailableProviders = async (includeAllProviders = false) => {
|
|
1552
|
-
const [
|
|
1576
|
+
const [opencodeProviders, customProvidersFromConfig, customVerifiedProviders] = await Promise.all([
|
|
1553
1577
|
getAuthenticatedProviders(),
|
|
1554
1578
|
(async () => {
|
|
1555
1579
|
try {
|
|
@@ -1566,18 +1590,16 @@ var getXDGPaths = () => ({
|
|
|
1566
1590
|
console.warn("Warning: Could not load custom verified providers:", error.message);
|
|
1567
1591
|
return [];
|
|
1568
1592
|
}
|
|
1569
|
-
})()
|
|
1570
|
-
getOpencodeGlobalConfigProviders()
|
|
1593
|
+
})()
|
|
1571
1594
|
]);
|
|
1572
1595
|
const providerMap = new Map;
|
|
1573
1596
|
customVerifiedProviders.forEach((p) => providerMap.set(p.id, p));
|
|
1574
|
-
|
|
1597
|
+
opencodeProviders.forEach((p) => providerMap.set(p.id, p));
|
|
1575
1598
|
customProvidersFromConfig.forEach((p) => providerMap.set(p.id, p));
|
|
1576
|
-
authenticatedProviders.forEach((p) => providerMap.set(p.id, p));
|
|
1577
1599
|
if (includeAllProviders) {
|
|
1578
1600
|
try {
|
|
1579
1601
|
const allModelsDevProviders = await getAllProviders();
|
|
1580
|
-
const authenticatedIds = new Set(
|
|
1602
|
+
const authenticatedIds = new Set(opencodeProviders.map((p) => p.id));
|
|
1581
1603
|
const customIds = new Set(customProvidersFromConfig.map((p) => p.id));
|
|
1582
1604
|
const customVerifiedIds = new Set(customVerifiedProviders.map((p) => p.id));
|
|
1583
1605
|
allModelsDevProviders.forEach((provider) => {
|
|
@@ -2127,7 +2149,7 @@ var package_default;
|
|
|
2127
2149
|
var init_package = __esm(() => {
|
|
2128
2150
|
package_default = {
|
|
2129
2151
|
name: "ai-speedometer",
|
|
2130
|
-
version: "2.0.
|
|
2152
|
+
version: "2.0.5",
|
|
2131
2153
|
description: "A comprehensive CLI tool for benchmarking AI models across multiple providers with parallel execution and professional metrics",
|
|
2132
2154
|
bin: {
|
|
2133
2155
|
"ai-speedometer": "dist/ai-speedometer",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ai-speedometer",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.5",
|
|
4
4
|
"description": "A comprehensive CLI tool for benchmarking AI models across multiple providers with parallel execution and professional metrics",
|
|
5
5
|
"bin": {
|
|
6
6
|
"ai-speedometer": "dist/ai-speedometer",
|