Model catalog — registry-backed lookups for model metadata.
Every fn here delegates to llm.sdk.registry; the hardcoded catalog atom that previously lived here is gone (all former entries are present in the bundled models.dev snapshot at resources/models-dev-snapshot.json).
Single-arg metadata lookups scan providers in the documented preference order for compatibility. resolve-model is stricter: it accepts only exact ids or an explicit provider/id pair and reports ambiguous exact ids instead of choosing pricing from an arbitrary provider.
Model catalog — registry-backed lookups for model metadata. Every fn here delegates to llm.sdk.registry; the hardcoded catalog atom that previously lived here is gone (all former entries are present in the bundled models.dev snapshot at resources/models-dev-snapshot.json). Single-arg metadata lookups scan providers in the documented preference order for compatibility. resolve-model is stricter: it accepts only exact ids or an explicit provider/id pair and reports ambiguous exact ids instead of choosing pricing from an arbitrary provider.
(context-length model-id)(context-length provider model-id)Return the context length for a model in tokens, or nil when unknown.
Return the context length for a model in tokens, or nil when unknown.
(get-model model-id)(get-model provider model-id)Look up a model entry by id. With one arg, scans across providers (first match wins). With two args, queries the registry directly.
Look up a model entry by id. With one arg, scans across providers (first match wins). With two args, queries the registry directly.
(list-models)Return a sorted seq of unique model ids the registry knows about.
Return a sorted seq of unique model ids the registry knows about.
(max-output-tokens model-id)(max-output-tokens provider model-id)Return the maximum output tokens for a model, or nil when unknown.
Return the maximum output tokens for a model, or nil when unknown.
(model-capable? model-id capability)(model-capable? provider model-id capability)Check if a model supports a capability keyword (e.g. :tools, :vision, :cache). Returns false when the model is unknown or has no :model/capabilities set on its registry entry.
Check if a model supports a capability keyword (e.g. :tools, :vision, :cache). Returns false when the model is unknown or has no :model/capabilities set on its registry entry.
(models-by-provider provider)Return every model entry the registry has under the given SDK provider keyword.
Return every model entry the registry has under the given SDK provider keyword.
(register-model model-id entry)(register-model provider model-id entry)Register a model entry. Pushes into the registry's override tier. Accepts either a (model-id, entry) pair or a (provider, model-id, entry) triple. With a single id, derives the provider from the entry's :model/provider key.
Register a model entry. Pushes into the registry's override tier. Accepts either a (model-id, entry) pair or a (provider, model-id, entry) triple. With a single id, derives the provider from the entry's :model/provider key.
(resolve-model model-name)(resolve-model provider model-id)Resolve an exact model id. A leading known provider segment is treated as an explicit provider selection (for example, openai/gpt-4o). Otherwise the id must have exactly one provider match; ambiguity throws ex-info with :error :catalog/ambiguous-model. No substring guessing is performed.
Resolve an exact model id. A leading known provider segment is treated as an explicit provider selection (for example, openai/gpt-4o). Otherwise the id must have exactly one provider match; ambiguity throws ex-info with :error :catalog/ambiguous-model. No substring guessing is performed.
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 |