@plurnk/plurnk-models
v4.2.0
Published
Release-time snapshot of Models.dev provider and model metadata for PLURNK.
Maintainers
Readme
@plurnk/plurnk-models
A release-time snapshot of provider and model metadata from
Models.dev. @plurnk/plurnk-providers uses it to
construct cataloged providers and resolve model facts without a Models.dev
request during installation or runtime. Clients may use the same snapshot for
model discovery.
Data
The generated snapshot retains only the facts PLURNK consumes:
| Lookup | Snapshot facts |
| ------------------ | ---------------------------------------------------------------------- |
| lookupProvider() | Provider id, protocol adapter (ProviderAdapter), credential names, and optional API URL. |
| lookup() | Context window, optional input/output limits, reasoning flag and optional efforts, optional input modalities, and USD prices. |
Model entries without a positive context window are omitted. reasoning: true
means the source asserted that capability; absence does not activate or disable
runtime reasoning. A missing cost means Models.dev supplied no complete
input/output rate pair.
import { lookup } from "@plurnk/plurnk-models";
const info = lookup("openrouter", "deepseek/deepseek-v4.1-flash");
// → {
// contextWindow: 1_048_576,
// maxOutputTokens: 393_216,
// reasoning: true,
// cost: {
// inputPer1M: 0.15,
// outputPer1M: 0.6,
// cacheReadPer1M: 0.003,
// },
// …
// }
// miss → nullprovider is the PLURNK provider name. model is the provider-native id; for
relays this is commonly publisher/model. resolveModel() also accepts an
unambiguous provider-native suffix. listProviders(), listCatalogProviders(),
and queryCatalog() serve indexed SQLite discovery without materializing the
full catalog in Node heap; catalogSnapshot() and providerCatalogSnapshot()
materialize complete read-only maps on demand.
XDG catalog cache (update)
Startup and inference make zero implicit Models.dev network calls. Explicit
updateCatalogCache(cachePath, options) refreshes $XDG_CACHE_HOME/plurnk/models.db
(conditional ETag revalidation, backing plurnk-service update, plurnk update,
and /update), loadCatalogCache(cachePath) overlays a newer cache over the
shipped catalog.db via read-only @possumtech/sqlrite ATTACH views, and
resetCatalog() restores the shipped snapshot ({§model-catalog-cache}).
Resolution boundary
This package owns snapshot generation and lookup, not runtime precedence. Context windows, output envelopes, reasoning activation, and prices resolve by different rules in the provider contract ({§model-fact-resolution}). In particular, PLURNK does not fetch live per-token prices.
Build and refresh
The lockfile selects Models.dev's official
@opencode-ai/models/snapshot
as a build-only dependency. Normal build and prepack generate the pruned SQLite
snapshot (catalog.db) and include it with its @possumtech/sqlrite SQL files
in dist; the generated database stays out of Git. Generation works offline
after dependency installation, and consumers need no upstream SDK.
To refresh the catalog from the repository root:
npm install --save-dev @opencode-ai/models@latest --workspace plurnk-models --no-audit --no-fund
npm run build --workspace plurnk-models
npm test --workspace plurnk-modelsCommit the dependency/lockfile change, not the generated catalogs. npm run
generate --workspace plurnk-models regenerates from the already installed
snapshot without selecting a newer version. See {§model-catalog-build} and
{§model-catalog-projection}.
