Liking cljdoc? Tell your friends :D

llm.sdk.catalog

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 lookups (get-model, context-length, model-capable?) scan across providers and return the first match — stable for globally unique model ids (gpt-4o, claude-opus-4-7), non-deterministic for ambiguous ids that exist under multiple providers (e.g. a model served by both :openrouter and :openai). Prefer the provider-aware overloads when the id is ambiguous.

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 lookups (get-model, context-length, model-capable?) scan
across providers and return the first match — stable for globally
unique model ids (gpt-4o, claude-opus-4-7), non-deterministic for
ambiguous ids that exist under multiple providers (e.g. a model
served by both :openrouter and :openai). Prefer the
provider-aware overloads when the id is ambiguous.
raw docstring

context-lengthclj

(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.
sourceraw docstring

get-modelclj

(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.
sourceraw docstring

list-modelsclj

(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.
sourceraw docstring

max-output-tokensclj

(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.
sourceraw docstring

model-capable?clj

(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.
sourceraw docstring

models-by-providerclj

(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.
sourceraw docstring

register-modelclj

(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.
sourceraw docstring

resolve-modelclj

(resolve-model model-name)

Fuzzy-match a model name against the registry. Tries: exact id, provider-prefixed id (anthropic/claude → claude), then substring over every known model id. Returns a registry entry or nil.

Fuzzy-match a model name against the registry. Tries: exact id,
provider-prefixed id (anthropic/claude → claude), then substring
over every known model id. Returns a registry entry or nil.
sourceraw docstring

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
Move to previous article
Move to next article
Ctrl+/Jump to the search field
× close