@suluk/models 0.1.1 → 0.1.2
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 +6 -3
- package/src/index.ts +1 -0
- package/src/normalize.ts +3 -2
- package/src/openrouter-catalog.json +1 -1
- package/src/overlay.ts +43 -0
- package/test/catalog.test.ts +12 -6
package/src/overlay.ts
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The Class-B TIER OVERLAY — patches `intel.*` coarse tiers onto the facts-only catalog. Tiers are ADOPTED PUBLIC
|
|
3
|
+
* PRIORS (cited + asOf-stamped), never our measured facts — we do not self-test. The real pass curates them from
|
|
4
|
+
* BFCL/IFEval/SWE-bench/GPQA/RULER/MMLU-Pro/LMArena snapshots through `applyBucketing` (see REFRESH.md); this file
|
|
5
|
+
* also ships a SMALL, conservative seed of well-established frontier standings so the catalog's intelligence
|
|
6
|
+
* dimension isn't entirely UNKNOWN. UNKNOWN axes are left absent (NEVER imputed to worst).
|
|
7
|
+
*/
|
|
8
|
+
import type { ModelCatalog, Tier } from "./types";
|
|
9
|
+
import { catalogFrom } from "./normalize";
|
|
10
|
+
|
|
11
|
+
export type IntelAxis = "agenticToolUse" | "instructionFollowing" | "reasoning" | "coding" | "longCtxComprehension" | "knowledge" | "humanPreference";
|
|
12
|
+
|
|
13
|
+
/** Overlay coarse tiers onto matching rows' intel cells, then re-hash (selection now depends on these tiers). */
|
|
14
|
+
export function applyTierOverlay(catalog: ModelCatalog, tiers: Record<string, Partial<Record<IntelAxis, Tier>>>, opts: { source: string; asOf: string }): ModelCatalog {
|
|
15
|
+
const rows = catalog.rows.map((r) => {
|
|
16
|
+
const t = tiers[r.id];
|
|
17
|
+
if (!t) return r;
|
|
18
|
+
const intel = { ...r.intel };
|
|
19
|
+
for (const axis of Object.keys(t) as IntelAxis[]) {
|
|
20
|
+
const v = t[axis];
|
|
21
|
+
if (v) intel[axis] = { value: v, source: opts.source, asOf: opts.asOf };
|
|
22
|
+
}
|
|
23
|
+
return { ...r, intel };
|
|
24
|
+
});
|
|
25
|
+
return catalogFrom(rows, catalog.generatedAt);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* A SMALL, conservatively-CITED seed of coarse public standings for headline frontier models (the bootstrap until
|
|
30
|
+
* the full Class-B curation lands). These are adopted public-consensus priors at a LOW ceiling — verify at source;
|
|
31
|
+
* tune at review. Absent axes stay UNKNOWN. Source stamped `public-leaderboard-consensus`.
|
|
32
|
+
*/
|
|
33
|
+
export const KNOWN_TIERS: Record<string, Partial<Record<IntelAxis, Tier>>> = {
|
|
34
|
+
"anthropic/claude-opus-4.1": { agenticToolUse: "frontier", instructionFollowing: "frontier", reasoning: "frontier", coding: "frontier", knowledge: "frontier", humanPreference: "frontier" },
|
|
35
|
+
"anthropic/claude-opus-4": { agenticToolUse: "frontier", instructionFollowing: "frontier", reasoning: "frontier", coding: "frontier", knowledge: "frontier", humanPreference: "frontier" },
|
|
36
|
+
"anthropic/claude-sonnet-4.5": { agenticToolUse: "frontier", instructionFollowing: "frontier", reasoning: "strong", coding: "frontier", knowledge: "strong", humanPreference: "strong" },
|
|
37
|
+
"google/gemini-2.5-pro": { agenticToolUse: "strong", instructionFollowing: "frontier", reasoning: "frontier", coding: "strong", longCtxComprehension: "frontier", knowledge: "frontier", humanPreference: "frontier" },
|
|
38
|
+
"google/gemini-2.5-flash": { agenticToolUse: "strong", instructionFollowing: "strong", reasoning: "mid", coding: "strong", knowledge: "strong", humanPreference: "strong" },
|
|
39
|
+
"openai/gpt-5": { agenticToolUse: "frontier", instructionFollowing: "frontier", reasoning: "frontier", coding: "frontier", knowledge: "frontier", humanPreference: "frontier" },
|
|
40
|
+
"deepseek/deepseek-chat-v3.1": { agenticToolUse: "mid", instructionFollowing: "strong", reasoning: "strong", coding: "strong", knowledge: "strong", humanPreference: "strong" },
|
|
41
|
+
"x-ai/grok-4.3": { agenticToolUse: "strong", instructionFollowing: "strong", reasoning: "frontier", coding: "strong", knowledge: "frontier", humanPreference: "strong" },
|
|
42
|
+
"meta-llama/llama-4-maverick": { instructionFollowing: "mid", reasoning: "mid", coding: "mid", knowledge: "strong", humanPreference: "mid" },
|
|
43
|
+
};
|
package/test/catalog.test.ts
CHANGED
|
@@ -9,14 +9,20 @@ describe("@suluk/models — the committed OpenRouter catalog", () => {
|
|
|
9
9
|
for (const r of OPENROUTER_CATALOG.rows.slice(0, 20)) {
|
|
10
10
|
expect(r.id).toBeTruthy();
|
|
11
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
12
|
}
|
|
13
|
+
// a few frontier rows carry CITED intel tiers (the Class-B seed); the long tail stays UNKNOWN, never imputed
|
|
14
|
+
const withTier = OPENROUTER_CATALOG.rows.filter((r) => r.intel.reasoning.value !== null);
|
|
15
|
+
expect(withTier.length).toBeGreaterThan(0);
|
|
16
|
+
expect(withTier.length).toBeLessThan(OPENROUTER_CATALOG.rows.length);
|
|
17
|
+
expect(withTier[0].intel.reasoning.source).toBeTruthy();
|
|
15
18
|
});
|
|
16
19
|
|
|
17
|
-
test("the selector runs end-to-end against the real catalog
|
|
18
|
-
const
|
|
19
|
-
expect(
|
|
20
|
-
expect(
|
|
20
|
+
test("the selector runs end-to-end against the real catalog + uses the overlaid tiers", () => {
|
|
21
|
+
const tool = selectModel({ needsTools: true, minWindowRequired: 200000 }, { profile: "tool-reliable" }, OPENROUTER_CATALOG);
|
|
22
|
+
expect(tool.ranked.length).toBeGreaterThan(0);
|
|
23
|
+
expect(tool.ranked[0].why.passedFilters).toContain("tool-calling");
|
|
24
|
+
// max-reasoning ⇒ a frontier/strong reasoner floats to the top (the overlay is live)
|
|
25
|
+
const reason = selectModel({ needsTools: true, minWindowRequired: 200000 }, { profile: "max-reasoning" }, OPENROUTER_CATALOG);
|
|
26
|
+
expect(["frontier", "strong"]).toContain(reason.ranked[0].why.tierByAxis.intelligence.tier);
|
|
21
27
|
});
|
|
22
28
|
});
|