Per-provider /models endpoint fetchers.
Each supported provider has a fetcher that hits its public /models endpoint and returns a vector of normalized ModelEntry maps with :model/source :live-models-api.
The registry layer (llm.sdk.registry) merges these entries with the models.dev breadth registry and a bundled offline snapshot to produce one unified view per (provider, model).
Profiles with :profile/supports-model-listing true and :profile/protocol-family :openai-chat use the generic OpenAI-compatible listing path. Other providers without a native listing method are rejected.
Per-provider /models endpoint fetchers. Each supported provider has a fetcher that hits its public /models endpoint and returns a vector of normalized ModelEntry maps with :model/source :live-models-api. The registry layer (llm.sdk.registry) merges these entries with the models.dev breadth registry and a bundled offline snapshot to produce one unified view per (provider, model). Profiles with :profile/supports-model-listing true and :profile/protocol-family :openai-chat use the generic OpenAI-compatible listing path. Other providers without a native listing method are rejected.
Fetch the live model catalog for a provider. Returns a vector of ModelEntry maps tagged with :model/source :live-models-api. Throws ex-info on auth / HTTP / unsupported.
Fetch the live model catalog for a provider. Returns a vector of ModelEntry maps tagged with :model/source :live-models-api. Throws ex-info on auth / HTTP / unsupported.
(listing-provider-ids)Current registered/native providers whose profiles advertise model listing.
Current registered/native providers whose profiles advertise model listing.
Canonical model registry entry. Every layer (live /models, models.dev, bundled snapshot) emits maps of this shape. :model/source describes the highest-precedence contributor, while :model/sources retains every contributing tier and :model/cost-source identifies the pricing origin.
Canonical model registry entry. Every layer (live /models, models.dev, bundled snapshot) emits maps of this shape. :model/source describes the highest-precedence contributor, while :model/sources retains every contributing tier and :model/cost-source identifies the pricing origin.
(parse-anthropic-models body provider-id source-url)Shape: {data [{type, id, display_name, created_at}], has_more, ...}.
Shape: {data [{type, id, display_name, created_at}], has_more, ...}.
(parse-gemini-models body provider-id source-url)Shape (Gemini Native + Vertex): Native - {models [{name 'models/gemini-2.5-pro', ...}]} Vertex - {publisherModels [{name 'publishers/google/models/...', ...}]} Each entry carries displayName, inputTokenLimit, outputTokenLimit, supportedGenerationMethods (mapped to capability keywords).
Shape (Gemini Native + Vertex):
Native - {models [{name 'models/gemini-2.5-pro', ...}]}
Vertex - {publisherModels [{name 'publishers/google/models/...', ...}]}
Each entry carries displayName, inputTokenLimit, outputTokenLimit,
supportedGenerationMethods (mapped to capability keywords).(parse-openai-style body provider-id source-url)Shape: {object 'list', data [{id, object, created, owned_by}]}. Used by OpenAI, DeepSeek, Kimi - none surface context length or pricing via /models, so entries are id-only.
Shape: {object 'list', data [{id, object, created, owned_by}]}.
Used by OpenAI, DeepSeek, Kimi - none surface context length or
pricing via /models, so entries are id-only.(parse-openrouter-models body provider-id source-url)Shape: {data [{id, name, context_length, pricing {prompt, completion, request, image, cache_read, cache_write, ...}, architecture {modality, tokenizer, instruct_type}, top_provider {context_length, max_completion_tokens, is_moderated}, per_request_limits}]}. Per-token pricing strings are converted to per-million USD numbers.
Shape: {data [{id, name, context_length,
pricing {prompt, completion, request, image, cache_read,
cache_write, ...},
architecture {modality, tokenizer, instruct_type},
top_provider {context_length, max_completion_tokens,
is_moderated},
per_request_limits}]}.
Per-token pricing strings are converted to per-million USD numbers.(supports-models-listing? provider-id)Does this provider expose a /models endpoint we can call? Registered profile metadata is authoritative. Unknown custom providers are not assumed to use the generic OpenAI-compatible path.
Does this provider expose a /models endpoint we can call? Registered profile metadata is authoritative. Unknown custom providers are not assumed to use the generic OpenAI-compatible path.
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |