ooai_llm.litellm_registry¶
Raw LiteLLM registry exploration helpers.
- Purpose:
Expose LiteLLM’s full local pricing/context registry for exploratory CLI and TUI workflows without forcing every provider into ooai’s canonical provider enum.
- Design:
Keep this separate from
model_defaultsbecause factory defaults and runtime profiles intentionally operate on first-class supported providers.Preserve arbitrary LiteLLM provider labels such as
fireworks_ai,bedrock,openrouter, ortogether_ai.Reuse the same filter vocabulary as the supported model catalog wherever the raw metadata is available.
Classes¶
One raw LiteLLM registry row with normalized display metadata. |
|
Result of listing raw LiteLLM registry rows. |
Functions¶
|
List LiteLLM's raw local registry across arbitrary provider labels. |
Module Contents¶
- class ooai_llm.litellm_registry.LiteLLMRegistryModel(/, **data: Any)[source]¶
Bases:
pydantic.BaseModelOne raw LiteLLM registry row with normalized display metadata.
- model_config[source]¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- property release_date: str | None[source]¶
Return the best available release-date label for display.
- property input_cost_per_1m_tokens: decimal.Decimal | None[source]¶
Return input-token cost normalized to one million tokens.
- property output_cost_per_1m_tokens: decimal.Decimal | None[source]¶
Return output-token cost normalized to one million tokens.
- property supports_chat: bool[source]¶
Return whether this registry row looks usable for chat/generation.
- class ooai_llm.litellm_registry.LiteLLMRegistryResult(/, **data: Any)[source]¶
Bases:
pydantic.BaseModelResult of listing raw LiteLLM registry rows.
- model_config[source]¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- models: list[LiteLLMRegistryModel] = None[source]¶
- ooai_llm.litellm_registry.list_litellm_registry(*, providers: collections.abc.Iterable[str] | None = None, include_non_chat: bool = False, capabilities: collections.abc.Iterable[ooai_llm.model_defaults.ModelCapabilityName] | None = None, min_context_tokens: int | None = None, min_output_tokens: int | None = None, max_input_cost_per_1m: decimal.Decimal | None = None, max_output_cost_per_1m: decimal.Decimal | None = None, released_after: str | None = None, released_before: str | None = None, sort_by: ooai_llm.model_defaults.ModelCatalogSortName = 'provider', strict: bool = False) LiteLLMRegistryResult[source]¶
List LiteLLM’s raw local registry across arbitrary provider labels.
- Parameters:
providers – Optional provider labels such as
openrouterorfireworks_ai. Unknown labels simply produce no rows.include_non_chat – Include embeddings, audio, image, rerank, and other non-chat registry entries.
capabilities – Required capability labels.
min_context_tokens – Optional minimum context/input-token window.
min_output_tokens – Optional minimum output-token limit.
max_input_cost_per_1m – Optional maximum input cost per one million tokens.
max_output_cost_per_1m – Optional maximum output cost per one million tokens.
released_after – Optional lower release-date bound.
released_before – Optional upper release-date bound.
sort_by – Sort mode for returned rows.
strict – Raise when LiteLLM cannot be imported or inspected.
- Returns:
Raw registry rows and explanatory notes.