@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
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@suluk/models",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.1",
|
|
4
4
|
"description": "A weekly, PUBLIC-DATA-ONLY catalog of OpenRouter models + a selector: a suluk skill declares NEEDS (hard filters) + a small PREFERENCE (a named profile), and selectModel picks the best CURRENT model — never a hard-coded id. Decidable OpenRouter facts as numbers; noisy benchmarks as COARSE TIERS with {source, asOf}; no cross-axis composite (blending is the selector's job). CANDIDATE tooling — NOT official OAS.",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Weekly refresh (Class A) — fetch OpenRouter /models, normalize to the fact-cell catalog, and write the committed,
|
|
3
|
+
* content-addressed artifact `src/openrouter-catalog.json`. Run: `bun scripts/refresh.ts [asOf]`. NETWORK.
|
|
4
|
+
* The benchmark TIER overlay (Class B) is a separate, lower-cadence, human-reviewed step (see REFRESH.md).
|
|
5
|
+
*/
|
|
6
|
+
import { fetchOpenRouterCatalog } from "../src/index";
|
|
7
|
+
|
|
8
|
+
const asOf = process.argv[2] ?? new Date().toISOString().slice(0, 10);
|
|
9
|
+
const cat = await fetchOpenRouterCatalog(asOf);
|
|
10
|
+
const out = new URL("../src/openrouter-catalog.json", import.meta.url);
|
|
11
|
+
await Bun.write(out, JSON.stringify(cat) + "\n"); // compact — it ships in the npm package (transitively via @suluk/agents)
|
|
12
|
+
console.log(`@suluk/models: wrote ${cat.rows.length} models · asOf ${asOf} · ${cat.snapshotHash}`);
|
package/src/index.ts
CHANGED
|
@@ -6,10 +6,15 @@
|
|
|
6
6
|
* Council wf_729cde52-cc7. CANDIDATE tooling — NOT official OAS. The live weekly fetcher is specified in REFRESH.md
|
|
7
7
|
* (this package ships the schema + selector + a SEED catalog; the 200-row generated catalog is the data-eng spine).
|
|
8
8
|
*/
|
|
9
|
+
import type { ModelCatalog } from "./types";
|
|
9
10
|
export type {
|
|
10
11
|
Tier, Cell, DataRetention, ModelRecord, ModelCatalog, HardFilters, Profile, Preferences, RankedModel, SelectResult,
|
|
11
12
|
} from "./types";
|
|
12
13
|
export { SEED_CATALOG } from "./catalog";
|
|
14
|
+
// the committed, content-addressed OpenRouter fact catalog (generated weekly by scripts/refresh.ts): real prices /
|
|
15
|
+
// context / caps for ~300+ models. Benchmark TIER cells (intel.*) stay UNKNOWN until the Class-B overlay lands.
|
|
16
|
+
import OPENROUTER_CATALOG_JSON from "./openrouter-catalog.json";
|
|
17
|
+
export const OPENROUTER_CATALOG = OPENROUTER_CATALOG_JSON as unknown as ModelCatalog;
|
|
13
18
|
export { PROFILES, type ResolvedProfile } from "./profiles";
|
|
14
19
|
export { selectModel, deriveRequirements } from "./select";
|
|
15
20
|
// the weekly fetcher spine: documented tier bucketing rules (red-line) + the pure OpenRouter facts transform + a thin live fetch.
|