Fetch GET /v1/models from Vultr Inference and turn each Model Document 2.4
entry into a flat CatalogModel. This is the base the TypeScript harness
integrations (Pi, OpenClaw, OpenCode) build on. The Python twin is
model-catalog-python; both produce the same output for the same input.
npm install @vultr/model-catalogNo runtime dependencies. Node 20+ or Bun.
import { isChatModel, loadCatalog, pricePerMillion } from "@vultr/model-catalog";
const catalog = await loadCatalog({ cachePath: "/home/me/.cache/vultr/catalog.json", maxAgeMs: 300_000 });
for (const model of catalog.models.filter(isChatModel)) {
console.log(model.id, model.contextWindow, pricePerMillion(model).prompt);
}loadCatalog(options): fetch, normalize, fall back to the last good payload when the network fails.catalog.sourceisnetwork,cacheorstale-cache. ThrowsCatalogErroronly when there is nothing to servefetchCatalog(options): the raw JSON payload. The catalog is public;apiKeyis optional.userAgentputs the caller's product token ahead of the library's ownUser-Agent(docs/catalog.md, Request)parseCatalog(payload): documents plusissues. A bad entry is skipped and reported, it never fails the catalognormalizeModel(document): oneCatalogModelisChatModel,isAgentModel,acceptsInput,pricePerMillion,usdPerMilliontoCanonical(model): the snake_case form shared with the Python libraryoutputOf(model, type),inputOf(model, type): one modality ofoutputs/inputs, or nullloadMediaCatalog(options): the per-surface catalogs (image, video, music, voices, tiers, price options, limits and alignment languages), oneModelMediaper model, its alignment anAlignmentRecord;fetchMediaPayloads,buildMediaCatalog,speechModelIds,toCanonicalMediaandMEDIA_SOURCESare its parts (docs/catalog.md, Media catalog)
CatalogModel carries contextWindow, maxOutputTokens, inputModalities,
outputModalities, pricing (exact USD per token strings), tools,
structuredOutputs, streaming, supportedParameters, parameters,
reasoning, isReady, deprecationDate, and every modality as outputs and
inputs. Rerankers, embedders, image
generators, transcription and decision models are in the catalog too;
isChatModel keeps the ones that output text. isAgentModel keeps the chat
models a coding harness can drive: ready, with tool calling and a known context
window. A safety classifier outputs text but calls no tools, so it is a chat
model and not an agent model.
See docs/catalog.md for the field mapping and the cache format.
npm install
npm run typecheck
npm test
npm run buildTests run the .ts sources directly on Node's type stripping. fixtures/ is
shared with the Python project: after changing normalization, run
UPDATE_FIXTURES=1 npm test and copy fixtures/*.json to
model-catalog-python/fixtures/.