@plurnk/plurnk-models 1.3.11 → 1.4.0
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/README.md +44 -16
- package/dist/catalog.json +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +6 -11
- package/dist/index.js.map +1 -1
- package/dist/providers.json +1 -1
- package/package.json +8 -6
package/README.md
CHANGED
|
@@ -1,35 +1,63 @@
|
|
|
1
1
|
# @plurnk/plurnk-models
|
|
2
2
|
|
|
3
|
-
A
|
|
3
|
+
A release-time snapshot of provider and model metadata from
|
|
4
|
+
[Models.dev](https://models.dev/). `@plurnk/plurnk-providers` uses it to
|
|
5
|
+
construct cataloged providers and resolve model facts without a Models.dev
|
|
6
|
+
request during installation or runtime. Clients may use the same snapshot for
|
|
7
|
+
model discovery.
|
|
4
8
|
|
|
5
|
-
##
|
|
6
|
-
|
|
7
|
-
This snapshot is a **last resort**, never a primary source. A backend's probed context window and a provider's fetched per-token pricing are ground truth and can change; a vendored snapshot must never shadow them — especially cost. Consumers resolve in this order:
|
|
9
|
+
## Data
|
|
8
10
|
|
|
9
|
-
|
|
10
|
-
env override → live probe / live pricing fetch → THIS catalog → null
|
|
11
|
-
```
|
|
11
|
+
The generated snapshot retains only the facts PLURNK consumes:
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
| Lookup | Snapshot facts |
|
|
14
|
+
| ------------------ | ---------------------------------------------------------------------- |
|
|
15
|
+
| `lookupProvider()` | Provider id, AI SDK package, credential names, and optional API URL. |
|
|
16
|
+
| `lookup()` | Context window, optional output limit, reasoning flag, and USD prices. |
|
|
14
17
|
|
|
15
|
-
|
|
18
|
+
Model entries without a positive context window are omitted. `reasoning: true`
|
|
19
|
+
means the source asserted that capability; absence does not activate or disable
|
|
20
|
+
runtime reasoning. A missing cost means Models.dev supplied no complete
|
|
21
|
+
input/output rate pair.
|
|
16
22
|
|
|
17
23
|
```ts
|
|
18
24
|
import { lookup } from "@plurnk/plurnk-models";
|
|
19
25
|
|
|
20
26
|
const info = lookup("openrouter", "anthropic/claude-sonnet-4");
|
|
21
|
-
// → {
|
|
27
|
+
// → {
|
|
28
|
+
// contextWindow: 1_000_000,
|
|
29
|
+
// maxOutput: 64_000,
|
|
30
|
+
// reasoning: true,
|
|
31
|
+
// cost: {
|
|
32
|
+
// inputPer1M: 3,
|
|
33
|
+
// outputPer1M: 15,
|
|
34
|
+
// cacheReadPer1M: 0.3,
|
|
35
|
+
// cacheWritePer1M: 3.75,
|
|
36
|
+
// },
|
|
37
|
+
// }
|
|
22
38
|
// miss → null
|
|
23
39
|
```
|
|
24
40
|
|
|
25
|
-
`provider` is the
|
|
41
|
+
`provider` is the PLURNK provider name. `model` is the provider-native id; for
|
|
42
|
+
relays this is commonly `publisher/model`. `resolveModel()` also accepts an
|
|
43
|
+
unambiguous provider-native suffix. `catalogSnapshot()` and
|
|
44
|
+
`providerCatalogSnapshot()` expose the complete read-only maps.
|
|
26
45
|
|
|
27
|
-
##
|
|
46
|
+
## Resolution boundary
|
|
28
47
|
|
|
29
|
-
|
|
48
|
+
This package owns snapshot generation and lookup, not runtime precedence.
|
|
49
|
+
Context windows, output envelopes, reasoning activation, and prices resolve by
|
|
50
|
+
different rules in the provider contract ({§model-fact-resolution}). In
|
|
51
|
+
particular, PLURNK does not fetch live per-token prices.
|
|
30
52
|
|
|
31
|
-
|
|
53
|
+
## Refresh
|
|
32
54
|
|
|
55
|
+
The committed snapshot is refreshed deliberately at release time:
|
|
56
|
+
|
|
57
|
+
```sh
|
|
58
|
+
npm run generate
|
|
33
59
|
```
|
|
34
|
-
|
|
35
|
-
|
|
60
|
+
|
|
61
|
+
That command fetches `https://models.dev/api.json`, retains providers whose AI
|
|
62
|
+
SDK package PLURNK supports, prunes the model facts, and rewrites the two source
|
|
63
|
+
JSON files.
|