Skip to main content

Module models_dev

Module models_dev 

Source
Expand description

Client for the models.dev model catalog API. Client for the models.dev model catalog API.

Fetches the live catalog from https://models.dev/api.json, whose top-level shape is a provider-keyed map:

{ "<provider_id>": { "id": ..., "env": [...], "api": ...,
                     "models": { "<model_id>": { "cost": {...}, "limit": {...}, ... } } } }

Results are flattened into ModelEntry records carrying the full models.dev metadata (pricing, limits, modalities, capabilities) so they can feed crate::provider::ProviderIndex::with_discovered.

Structs§

ModelEntry
A single model entry discovered from a remote catalog.
ModelLimits
Token limits reported by a discovery source for a single model.
ModelsDevPayload
Top-level response payload from the models.dev API: a provider-keyed map.

Functions§

fetch
Fetch and parse the catalog from the default models.dev endpoint (no cache).
fetch_and_cache
Fetch models from the models.dev API and cache the raw payload to disk.
fetch_from
Fetch and parse the models.dev catalog from url (no disk cache).
load_cache
Load previously cached models.dev data.