LemonAgent. ModelRuntime. ModelCatalog
(lemon_agent v0.1.0)
View Source
Consumer-facing "what can I pick from right now" model catalog.
Centralizes the provider-alias credential-fallback rules, health blocklist,
and picker sort order that model-picker-style consumers need, so callers
don't have to reach into LemonAi.Models and the provider config table
themselves. This mirrors (and replaces) logic that used to be duplicated
across Telegram transport modules in lemon_channels.
Summary
Functions
Returns the catalog of models available for selection, grouped by provider and filtered down to providers with usable credentials, in picker display order (each provider's models sorted newest/most-relevant first).
Model at a given index for a provider within a catalog, or nil.
Human-readable label for a model map.
Formats a model map as a provider:id spec string.
Models for a given provider within a catalog, or [] if unknown.
Provider ids present in a catalog, in display order.
Types
Functions
@spec available_catalog() :: [provider_group()]
Returns the catalog of models available for selection, grouped by provider and filtered down to providers with usable credentials, in picker display order (each provider's models sorted newest/most-relevant first).
Falls back to a small built-in catalog if the model registry is unavailable or errors.
@spec model_at_index([provider_group()], String.t(), integer()) :: model_map() | nil
Model at a given index for a provider within a catalog, or nil.
Human-readable label for a model map.
Formats a model map as a provider:id spec string.
@spec models_for_provider([provider_group()], String.t()) :: [model_map()]
Models for a given provider within a catalog, or [] if unknown.
@spec providers([provider_group()]) :: [String.t()]
Provider ids present in a catalog, in display order.