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_defaults because factory defaults and runtime profiles intentionally operate on first-class supported providers.

  • Preserve arbitrary LiteLLM provider labels such as fireworks_ai, bedrock, openrouter, or together_ai.

  • Reuse the same filter vocabulary as the supported model catalog wherever the raw metadata is available.

Classes

LiteLLMRegistryModel

One raw LiteLLM registry row with normalized display metadata.

LiteLLMRegistryResult

Result of listing raw LiteLLM registry rows.

Functions

list_litellm_registry(→ LiteLLMRegistryResult)

List LiteLLM's raw local registry across arbitrary provider labels.

Module Contents

class ooai_llm.litellm_registry.LiteLLMRegistryModel(/, **data: Any)[source]

Bases: pydantic.BaseModel

One 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].

provider: str[source]
model_key: str[source]
model_id: str[source]
source: str = 'litellm_registry'[source]
display_name: str | None = None[source]
created: int | None = None[source]
created_at: str | None = None[source]
input_cost_per_token: decimal.Decimal | None = None[source]
output_cost_per_token: decimal.Decimal | None = None[source]
max_input_tokens: int | None = None[source]
max_output_tokens: int | None = None[source]
mode: str | None = None[source]
supports_vision: bool | None = None[source]
supports_function_calling: bool | None = None[source]
supports_tool_choice: bool | None = None[source]
supports_parallel_tool_calls: bool | None = None[source]
supports_structured_output: bool | None = None[source]
raw: dict[str, Any] = None[source]
property model_string: str[source]

Return the LiteLLM registry key used to identify the model.

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 context_window: int | None[source]

Return the best known input/context window.

property supports_chat: bool[source]

Return whether this registry row looks usable for chat/generation.

property supports_reasoning: bool[source]

Return whether this model appears reasoning-oriented.

property supports_coding: bool[source]

Return whether this model appears coding-oriented.

property supports_tool_calling: bool[source]

Return whether this row appears tool/function-call capable.

property capability_labels: list[str][source]

Return display labels for inferred model capabilities.

class ooai_llm.litellm_registry.LiteLLMRegistryResult(/, **data: Any)[source]

Bases: pydantic.BaseModel

Result 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]
notes: list[str] = 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 openrouter or fireworks_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.