List Models
List available models for a provider
The list_models and alist_models functions return the available models for a given provider.
any_llm.list_models()
def list_models(
provider: str | LLMProvider,
api_key: str | None = None,
api_base: str | None = None,
client_args: dict[str, Any] | None = None,
**kwargs: Any,
) -> Sequence[Model]any_llm.alist_models()
Async variant with the same parameters.
async def alist_models(
provider: str | LLMProvider,
api_key: str | None = None,
api_base: str | None = None,
client_args: dict[str, Any] | None = None,
**kwargs: Any,
) -> Sequence[Model]Parameters
Parameter
Type
Default
Description
provider
str | LLMProvider
required
api_key
str | None
None
api_base
str | None
None
client_args
dict[str, Any] | None
None
**kwargs
Any
required
Return Value
Returns a Sequence of Model objects. Each Model has at minimum an id field containing the model identifier string.
Usage
Async
Using the AnyLLM class
Last updated