feat(ai-models): a runtime catalog of models, prices, and capabilities #1772
Showing 66 changed files with 139 additions and 0 deletions (loading 62).
x
@@ -0,0 +1,9 @@
+---
+'@tanstack/ai-models': minor
+---
+
+New package: a runtime catalog of 1,853 models across 38 providers, generated from models.dev and the OpenRouter and Vercel AI Gateway model lists. `getProviders`, `getModels`, and `getModel` return each model's id, input modalities, context window, output limit, prices, reasoning data, and request quirks (`compat`). A record's `reasoning` has the `ModelReasoning` shape of `@tanstack/ai` (`false`, or `{ levels, budget }`). `supportedReasoningLevels`, `clampReasoningLevel`, and `modelCost` work on a record, and `generatedAt` is the date of the data. Each provider also has its own subpath, for example `@tanstack/ai-models/deepseek`.
+
+`modelCost` prices long context and 1-hour cache writes. A record's `cost.tiers` (from models.dev) holds higher prices above an input size, and a call uses the tier with the highest `inputTokensAbove` below its input. `TokenCounts.cacheWrite1h`, the part of `cacheWrite` with a 1-hour retention, costs 2 times the input price.
+
+The `google-vertex` and `azure-openai-responses` providers have only the models on their own wire, so no Claude models. Use `anthropicVertexText` from `@tanstack/ai-anthropic/vertex` for Claude on Vertex. Embedding, reranking, and transcription models are not in the catalog.
@@ -0,0 +1,125 @@
+---
+title: Model Catalog
+id: catalog
+description: "Look up models, reasoning levels, prices, and context windows at runtime with @tanstack/ai-models."
+keywords:
+ - tanstack ai
+ - model catalog
+ - models.dev
+ - model metadata
+ - reasoning levels
+ - model pricing
+---
+
+A model picker, a cost display, or a settings menu needs facts about models at runtime: which models a provider has, which reasoning levels a model takes, and what a call costs. `@tanstack/ai-models` is a catalog of that data for more than 1,800 models across 38 providers.
+
+## Install
+
+<!-- ::start:tabs variant="package-manager" mode="install" -->