@suluk/models 0.1.0 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/scripts/refresh.ts +12 -0
- package/src/index.ts +5 -0
- package/src/openrouter-catalog.json +1 -0
- package/test/catalog.test.ts +22 -0
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { test, expect, describe } from "bun:test";
|
|
2
|
+
import { OPENROUTER_CATALOG, selectModel } from "../src/index";
|
|
3
|
+
|
|
4
|
+
/** The committed live catalog is real data that churns weekly, so assert SHAPE + invariants, not exact values. */
|
|
5
|
+
describe("@suluk/models — the committed OpenRouter catalog", () => {
|
|
6
|
+
test("loads with rows, a content-addressed snapshot, and well-formed fact cells", () => {
|
|
7
|
+
expect(OPENROUTER_CATALOG.rows.length).toBeGreaterThan(100);
|
|
8
|
+
expect(OPENROUTER_CATALOG.snapshotHash).toStartWith("sha256-");
|
|
9
|
+
for (const r of OPENROUTER_CATALOG.rows.slice(0, 20)) {
|
|
10
|
+
expect(r.id).toBeTruthy();
|
|
11
|
+
expect(r.cost.inputPerMtok.value === null || typeof r.cost.inputPerMtok.value === "number").toBe(true);
|
|
12
|
+
// benchmark tiers are UNKNOWN in the facts-only catalog (never imputed)
|
|
13
|
+
expect(r.intel.agenticToolUse.value).toBeNull();
|
|
14
|
+
}
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
test("the selector runs end-to-end against the real catalog (tool-reliable, min-context)", () => {
|
|
18
|
+
const r = selectModel({ needsTools: true, minWindowRequired: 200000 }, { profile: "tool-reliable" }, OPENROUTER_CATALOG);
|
|
19
|
+
expect(r.ranked.length).toBeGreaterThan(0);
|
|
20
|
+
expect(r.ranked[0].why.passedFilters).toContain("tool-calling");
|
|
21
|
+
});
|
|
22
|
+
});
|