Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

llm.get_models() and .get_async_models() documented functions #640

Closed
simonw opened this issue Nov 19, 2024 · 1 comment
Closed

llm.get_models() and .get_async_models() documented functions #640

simonw opened this issue Nov 19, 2024 · 1 comment
Labels
enhancement New feature or request python-api

Comments

@simonw
Copy link
Owner

simonw commented Nov 19, 2024

For the Python API. Currently you have to mess around with this function instead:

def get_models_with_aliases() -> List["ModelWithAliases"]:

@simonw simonw added enhancement New feature or request python-api labels Nov 19, 2024
@simonw simonw closed this as completed in c52cfee Nov 21, 2024
@simonw
Copy link
Owner Author

simonw commented Nov 21, 2024

llm/llm/__init__.py

Lines 170 to 177 in c52cfee

def get_models() -> List[Model]:
"Get all registered models"
return [model for model in get_model_aliases().values()]
def get_async_models() -> List[AsyncModel]:
"Get all registered async models"
return [model for model in get_async_model_aliases().values()]

Documented here: https://github.com/simonw/llm/blob/c52cfee881d2150643bd3fa80cd82a3f81b76b59/docs/python-api.md#listing-models

simonw added a commit that referenced this issue Nov 21, 2024
simonw added a commit that referenced this issue Dec 1, 2024
simonw added a commit that referenced this issue Dec 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request python-api
Projects
None yet
Development

No branches or pull requests

1 participant